[Tooling] : Code completion with macros doesn't seem to work with current rust-analyzer of vscode #654
-
Hello guys, I'm trying to wrap my head around the utoipa crate and trying to tweak examples (the rocket-0_4-hello to be precise) and whenever I try to change the smallest thing within the Trying to get the code completion working (...)This is a tooling issue, very much probably on my side but I don't understand why this thing is not doing the proper stuff . As I understand it right now, the For a little bit more context (if it even has some importance) : It forces me to get through the documentation ( noticeably this part : path-attributes) and reading the utoipa source code to understand what's going on. Same thing here on the very top of the file :
Bottom line being : is it an issue with the rust-analyzer or I'm missing something (probably ...) Thanks for reading this guys 😄 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Make sure you are using Then you might want to check that imports = {
granularity = {
group = "module",
},
prefix = "self",
},
cargo = {
buildScripts = {
enable = true,
},
features = {},
noDefaultFeatures = false,
},
procMacro = {
enable = true,
attributes = {
enable = true,
},
},
checkOnSave = {
command = "clippy",
} Some of the above configs are default options, but procMacro related settings are not enabled by default and save command is not set to clippy by default. Then to the actual point, as what comes to the proc macros or macros in general, rust via Also note that the rocket 0.4 explicitly needs nightly toolchain to be present and it cannot be used / run without it. So you might also want to install it with Cheers |
Beta Was this translation helpful? Give feedback.
Make sure you are using
rust_analyzer
and for debuggin you might want to use codellb (not needed unless you plan to run apps through the debugger). Both of those can be found from extensions for VSCode.Then you might want to check that
rust_analyzer
has sensible settings, ones that I am using: (This config is in lua, but the settings are same for VSCode as well) https://rust-analyzer.github.io/manual.html#configuration