Add new configuration "enableEnhancedTyping" to control registering of "type" command

This further fixes problems when having a VIM extension (at least vscodevim)
enabled, by not calling `overrideCommand('type', commands.onEnter.handle)` when
enableEnhancedTyping is set to `false`.

The problem is dependent on the order in which extensions are activated, if
rust-analyzer is activated before `vscodevim`, rust-analyzer will register the
`type` command, and when `vscodevim` finally attempts to activate, it will fail
to register the command. This causes `vscodevim` to stop working properly.

This setting allows users to disable the registerCommand `type` in
rust-analyzer, allowing `vscodevim` to work. The setting defaults to `true`.

Currently changing the setting requires reloading of the window.
This commit is contained in:
Ville Penttinen 2019-02-07 12:37:36 +02:00
parent 736a55c97e
commit 77a4a311fe
3 changed files with 33 additions and 1 deletions

View file

@ -82,7 +82,9 @@ export function activate(context: vscode.ExtensionContext) {
}
);
overrideCommand('type', commands.onEnter.handle);
if (Server.config.enableEnhancedTyping) {
overrideCommand('type', commands.onEnter.handle);
}
// Notifications are events triggered by the language server
const allNotifications: Iterable<