aboutsummaryrefslogtreecommitdiff
path: root/editors
diff options
context:
space:
mode:
authorfrai <[email protected]>2018-12-22 13:26:18 +0000
committerfrai <[email protected]>2018-12-22 13:26:18 +0000
commit0f5d9a03221ec9a4597f3e0bc29f210607713cb4 (patch)
treea0224a5e049e27f61c20f8d7fd0b723e832192b6 /editors
parent5c7e8f47a8318e744b8e5d5bcb127ca9753ca04b (diff)
Fix analyzer extension fail when there are enabled any VIM extension.
Diffstat (limited to 'editors')
-rw-r--r--editors/code/src/extension.ts30
1 files changed, 17 insertions, 13 deletions
diff --git a/editors/code/src/extension.ts b/editors/code/src/extension.ts
index d1c525f68..4acd54d90 100644
--- a/editors/code/src/extension.ts
+++ b/editors/code/src/extension.ts
@@ -23,19 +23,23 @@ export function activate(context: vscode.ExtensionContext) {
23 const original = (...args: any[]) => 23 const original = (...args: any[]) =>
24 vscode.commands.executeCommand(defaultCmd, ...args); 24 vscode.commands.executeCommand(defaultCmd, ...args);
25 25
26 registerCommand(name, async (...args: any[]) => { 26 try {
27 const editor = vscode.window.activeTextEditor; 27 registerCommand(name, async (...args: any[]) => {
28 if ( 28 const editor = vscode.window.activeTextEditor;
29 !editor || 29 if (
30 !editor.document || 30 !editor ||
31 editor.document.languageId !== 'rust' 31 !editor.document ||
32 ) { 32 editor.document.languageId !== 'rust'
33 return await original(...args); 33 ) {
34 } 34 return await original(...args);
35 if (!(await f(...args))) { 35 }
36 return await original(...args); 36 if (!(await f(...args))) {
37 } 37 return await original(...args);
38 }); 38 }
39 });
40 } catch(_) {
41 vscode.window.showWarningMessage('Enhanced typing feature is disabled because of incompatibility with VIM extension');
42 }
39 } 43 }
40 44
41 // Commands are requests from vscode to the language server 45 // Commands are requests from vscode to the language server