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
More about `when` clause contexts https://code.visualstudio.com/docs/getstarted/keybindings#_when-clause-contexts[here].
79
-
80
65
==== Updates
81
66
82
67
The extension will be updated automatically as new versions become available. It will ask your permission to download the matching language server version binary if needed.
@@ -124,10 +109,23 @@ Here are some useful self-diagnostic commands:
124
109
* To log all LSP requests, add `"rust-analyzer.trace.server": "verbose"` to the settings and look for `Server Trace` in the panel.
125
110
* To enable client-side logging, add `"rust-analyzer.trace.extension": true` to the settings and open the `Console` tab of VS Code developer tools.
126
111
112
+
==== Special `when` clause context for keybindings.
113
+
You may use `inRustProject` context to configure keybindings for rust projects only. For example:
114
+
[source,json]
115
+
----
116
+
{
117
+
"key": "ctrl+i",
118
+
"command": "rust-analyzer.toggleInlayHints",
119
+
"when": "inRustProject"
120
+
}
121
+
----
122
+
More about `when` clause contexts https://code.visualstudio.com/docs/getstarted/keybindings#_when-clause-contexts[here].
123
+
127
124
=== rust-analyzer Language Server Binary
128
125
129
126
Other editors generally require the `rust-analyzer` binary to be in `$PATH`.
130
-
You can download the pre-built binary from the https://github.com/rust-analyzer/rust-analyzer/releases[releases] page. Typically, you then need to rename the binary for your platform, e.g. `rust-analyzer-mac` if you're on Mac OS, to `rust-analyzer` and make it executable in addition to moving it into a directory in your `$PATH`.
127
+
You can download the pre-built binary from the https://github.com/rust-analyzer/rust-analyzer/releases[releases] page.
128
+
Typically, you then need to rename the binary for your platform, e.g. `rust-analyzer-mac` if you're on Mac OS, to `rust-analyzer` and make it executable in addition to moving it into a directory in your `$PATH`.
131
129
132
130
On Linux to install the `rust-analyzer` binary into `~/.local/bin`, this commands could be used
If your editor can't find the binary even though the binary is on your `$PATH`, the likely explanation is that it doesn't see the same `$PATH` as the shell, see https://github.com/rust-analyzer/rust-analyzer/issues/1811[this issue]. On Unix, running the editor from a shell or changing the `.desktop` file to set the environment should help.
148
+
If your editor can't find the binary even though the binary is on your `$PATH`, the likely explanation is that it doesn't see the same `$PATH` as the shell, see https://github.com/rust-analyzer/rust-analyzer/issues/1811[this issue].
149
+
On Unix, running the editor from a shell or changing the `.desktop` file to set the environment should help.
0 commit comments