You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* **Rust Analyzer: Show RA Version** shows the version of `rust-analyzer` binary.
145
-
* **Rust Analyzer: Status** prints some statistics about the server, and dependency information for the current file.
146
-
* To enable server-side logging, run with `env RA_LOG=info` and see `Output > Rust Analyzer Language Server` in VS Code's panel.
147
-
* To log project loading (sysroot & `cargo metadata`), set `RA_LOG=project_model=debug`.
148
-
* To log all LSP requests, add `"rust-analyzer.trace.server": "verbose"` to the settings and look for `Rust Analyzer Language Server Trace` in the panel.
149
-
* To enable client-side logging, add `"rust-analyzer.trace.extension": true` to the settings and open `Output > Rust Analyzer Client` in the panel.
142
+
Start with looking at the rust-analyzer version.
143
+
Try **Rust Analyzer: Show RA Version** and `rust-analyzer --version` in the command line.
144
+
If the date is more than a week ago, it's better to update rust-analyzer version.
145
+
146
+
The next thing to check would be panic messages in rust-analyzer's log.
147
+
Log messages are printed to stderr, in VS Code you can see then in the `Output > Rust Analyzer Language Server` tab of the panel.
148
+
To see more logs, set `RA_LOG=info` environmental variable.
149
+
150
+
To fully capture LSP messages between the editor and the server, set `"rust-analyzer.trace.server": "verbose"` config and check
151
+
`Output > Rust Analyzer Language Server Trace`.
152
+
153
+
The root cause for many "`nothing works`" problems is that rust-analyzer fails to understand the project structure.
154
+
To debug that, first note the `rust-analyzer` section in the status bar.
155
+
If it has an error icon and red, that's the problem (hover will have somewhat helpful error message).
156
+
**Rust Analyzer: Status** prints dependency information for the current file.
157
+
Finally, `RA_LOG=project_model=debug` enables verbose logs during project loading.
158
+
159
+
If rust-analyzer outright crashes, try running `rust-analyzer analysis-stats /path/to/project/directory/` on the command line.
160
+
This command type checks the whole project in batch mode bypassing LSP machinery.
161
+
162
+
When filing issues, it is useful (but not necessary) to try to minimize examples.
0 commit comments