aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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