#VSC Rust-analyzer extension error

6 messages · Page 1 of 1 (latest)

glass portal
#

Well, the first question is: do you have a properly set up workspace/package?
The easiest way to check that is to open a terminal and run cargo check in the same directory yourself.

#

show your file list?

#

okay so I've seen this sometimes work and sometimes not … try this: close vscode and open RustProjects as your vscode workspace dir (that is, it should appear at the top level thing in the file outline, not a folder wwithin)

#

I have vscode on mac so it might be different … would be like

  • File > New Window
  • close the old window
  • click "Open..." in the new window
  • pick the RustProjects dir in the open dialog that you get from that
#

I am unclear on how much rust-analyzer is supposed to support — some sources say that projects in subdirectories of the top level should work but I have also seen many error reports

#

but in general you should expect a vscode workspace to go with one project — one bunch of related code, not "all my rust projects"