diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-02-27 09:00:31 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2020-02-27 09:00:31 +0000 |
commit | 04b3bd5ee854f04ca070770be1fc313dbe94ed75 (patch) | |
tree | b58ffb3de28089711f3c0e8a3b84fcfa330803f2 | |
parent | 50956f89fce93245e52b693ae63283274bc92142 (diff) | |
parent | 655c8337c07cdc18a4d7a5a3c44a2c2145b1ec88 (diff) |
Merge #3308
3308: vscode: fix vscode-vim keybindings conflict r=matklad a=Veetaha
Closes #3013 I hope
vscode-vim extension overrides the `type` command so that it prevents
some keypresses to reach the text document editor.
It conflicts with our `onEnter` keybinding
that is used to support automatic doc comments extending and
indentation insertion.
The VSCode-native way to implement this would be
to use regular expressions, but as per matklad it is
considered not acceptable for the language server.
Thus we implement it via a `Enter` keybinding that
invokes our `onEnter` command which does it via the language-server.
At the end of the day we may only apply
ad hoc workarounds for conflicting extensions.
But vscode has another bug for that. You
either cannot use parantheses in `when` condition
of a keybinding or it just malfunctions.
See an issue about that here: https://github.com/microsoft/vscode/issues/91473
To get the ultimate context, follow this [zulip thread](https://rust-lang.zulipchat.com/#narrow/stream/185405-t-compiler.2Fwg-rls-2.2E0/topic/Enhanced.20typing)
Co-authored-by: Veetaha <[email protected]>
-rw-r--r-- | editors/code/package.json | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/editors/code/package.json b/editors/code/package.json index ad1101603..8e58d6b77 100644 --- a/editors/code/package.json +++ b/editors/code/package.json | |||
@@ -161,7 +161,7 @@ | |||
161 | { | 161 | { |
162 | "command": "rust-analyzer.onEnter", | 162 | "command": "rust-analyzer.onEnter", |
163 | "key": "enter", | 163 | "key": "enter", |
164 | "when": "editorTextFocus && !suggestWidgetVisible && editorLangId == rust" | 164 | "when": "editorTextFocus && !suggestWidgetVisible && editorLangId == rust && !vim.active || vim.mode == 'Insert' && editorTextFocus && !suggestWidgetVisible && editorLangId == rust" |
165 | } | 165 | } |
166 | ], | 166 | ], |
167 | "configuration": { | 167 | "configuration": { |