diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-05-28 14:37:37 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-05-28 14:37:37 +0100 |
commit | 190a0595a478d059fdd95a179fe38d59cb6379be (patch) | |
tree | 24b22bf8c212df5b6bc6c8ba493d2d7171b24b7f /docs/user | |
parent | fc29d0e9248bf36c6e47f54f41e90a288729b1a7 (diff) | |
parent | 6d0f1e2e7209e85c1c558bd712d22e359f1f2786 (diff) |
Merge #4640
4640: Add `inRustProject` when-clause for commands in vscode r=vsrs a=vsrs
At the moment all rust-analyzer commands always visible in the command palette, even if there is no rust project opened.
This PR adds special [when-clause](https://code.visualstudio.com/docs/getstarted/keybindings#_when-clause-contexts) context. This context also might be used in key bindings.
Co-authored-by: vsrs <[email protected]>
Co-authored-by: vsrs <[email protected]>
Diffstat (limited to 'docs/user')
-rw-r--r-- | docs/user/readme.adoc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/docs/user/readme.adoc b/docs/user/readme.adoc index 9539d326d..64bd0feb1 100644 --- a/docs/user/readme.adoc +++ b/docs/user/readme.adoc | |||
@@ -65,6 +65,16 @@ The server binary is stored in: | |||
65 | 65 | ||
66 | Note that we only support two most recent versions of VS Code. | 66 | Note that we only support two most recent versions of VS Code. |
67 | 67 | ||
68 | ==== Special `when` clause context for keybindings. | ||
69 | You may use `inRustProject` context to configure keybindings for rust projects only. For example: | ||
70 | [source,json] | ||
71 | ---- | ||
72 | { "key": "ctrl+shift+f5", "command": "workbench.action.debug.restart", "when": "inDebugMode && !inRustProject"}, | ||
73 | { "key": "ctrl+shift+f5", "command": "rust-analyzer.debug", "when": "inRustProject"}, | ||
74 | { "key": "ctrl+i", "command": "rust-analyzer.toggleInlayHints", "when": "inRustProject" } | ||
75 | ---- | ||
76 | More about `when` clause contexts https://code.visualstudio.com/docs/getstarted/keybindings#_when-clause-contexts[here]. | ||
77 | |||
68 | ==== Updates | 78 | ==== Updates |
69 | 79 | ||
70 | 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. | 80 | 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. |