diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-02-04 09:52:57 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2020-02-04 09:52:57 +0000 |
commit | c1a06499fa5f9a40750cbfc30a7d399228a5fab0 (patch) | |
tree | 9f2a049a5d9e49c55f41fd27b1a264d051f044c9 /editors/code/package.json | |
parent | 73c36fdbd2060bd455ffeef33dca1ecc2ae07ebb (diff) | |
parent | 875dc6d1a4973f70cd48b797ae755d1bd7a83fa5 (diff) |
Merge #2981
2981: vscode: Add ability to call onEnter without overriding "type". r=matklad a=71
Before this PR, the only way to get enhanced typing (right now, only with `onEnter`) was to override VS Code's `type` command. This leads to issues with extensions like [VsCodeVim](https://github.com/VSCodeVim/Vim) that need to override `type` as well.
This PR adds an additional command, `onEnter`. This command can be used with the following keybinding, which allows the user to get smart `onEnter` behavior without overriding `type`.
```json
{
"key": "enter",
"command": "rust-analyzer.onEnter",
"when": "editorTextFocus && editorLangId == rust"
}
```
Co-authored-by: Gregoire Geis <[email protected]>
Co-authored-by: Grégoire Geis <[email protected]>
Diffstat (limited to 'editors/code/package.json')
-rw-r--r-- | editors/code/package.json | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/editors/code/package.json b/editors/code/package.json index c0d8f0183..c9404a4dd 100644 --- a/editors/code/package.json +++ b/editors/code/package.json | |||
@@ -114,6 +114,11 @@ | |||
114 | "command": "rust-analyzer.reload", | 114 | "command": "rust-analyzer.reload", |
115 | "title": "Restart server", | 115 | "title": "Restart server", |
116 | "category": "Rust Analyzer" | 116 | "category": "Rust Analyzer" |
117 | }, | ||
118 | { | ||
119 | "command": "rust-analyzer.onEnter", | ||
120 | "title": "Enhanced enter key", | ||
121 | "category": "Rust Analyzer" | ||
117 | } | 122 | } |
118 | ], | 123 | ], |
119 | "keybindings": [ | 124 | "keybindings": [ |
@@ -136,6 +141,11 @@ | |||
136 | "command": "rust-analyzer.run", | 141 | "command": "rust-analyzer.run", |
137 | "key": "ctrl+r", | 142 | "key": "ctrl+r", |
138 | "when": "editorTextFocus && editorLangId == rust" | 143 | "when": "editorTextFocus && editorLangId == rust" |
144 | }, | ||
145 | { | ||
146 | "command": "rust-analyzer.onEnter", | ||
147 | "key": "enter", | ||
148 | "when": "editorTextFocus && !suggestWidgetVisible && editorLangId == rust" | ||
139 | } | 149 | } |
140 | ], | 150 | ], |
141 | "configuration": { | 151 | "configuration": { |
@@ -157,11 +167,6 @@ | |||
157 | "default": {}, | 167 | "default": {}, |
158 | "description": "Fine grained feature flags to disable annoying features" | 168 | "description": "Fine grained feature flags to disable annoying features" |
159 | }, | 169 | }, |
160 | "rust-analyzer.enableEnhancedTyping": { | ||
161 | "type": "boolean", | ||
162 | "default": true, | ||
163 | "description": "Enables enhanced typing. NOTE: If using a VIM extension, you should set this to false" | ||
164 | }, | ||
165 | "rust-analyzer.raLspServerPath": { | 170 | "rust-analyzer.raLspServerPath": { |
166 | "type": [ | 171 | "type": [ |
167 | "string" | 172 | "string" |