aboutsummaryrefslogtreecommitdiff
path: root/editors/code/src/main.ts
diff options
context:
space:
mode:
Diffstat (limited to 'editors/code/src/main.ts')
-rw-r--r--editors/code/src/main.ts14
1 files changed, 9 insertions, 5 deletions
diff --git a/editors/code/src/main.ts b/editors/code/src/main.ts
index 1900d900a..a5c728b67 100644
--- a/editors/code/src/main.ts
+++ b/editors/code/src/main.ts
@@ -76,7 +76,8 @@ async function tryActivate(context: vscode.ExtensionContext) {
76 // This a horribly, horribly wrong way to deal with this problem. 76 // This a horribly, horribly wrong way to deal with this problem.
77 ctx = await Ctx.create(config, context, serverPath, workspaceFolder.uri.fsPath); 77 ctx = await Ctx.create(config, context, serverPath, workspaceFolder.uri.fsPath);
78 78
79 setContextValue(RUST_PROJECT_CONTEXT_NAME, true); 79 setContextValue(RUST_PROJECT_CONTEXT_NAME, true)
80 .then(() => {}, console.error);
80 81
81 // Commands which invokes manually via command palette, shortcut, etc. 82 // Commands which invokes manually via command palette, shortcut, etc.
82 83
@@ -142,7 +143,8 @@ async function tryActivate(context: vscode.ExtensionContext) {
142} 143}
143 144
144export async function deactivate() { 145export async function deactivate() {
145 setContextValue(RUST_PROJECT_CONTEXT_NAME, undefined); 146 setContextValue(RUST_PROJECT_CONTEXT_NAME, undefined)
147 .then(() => {}, console.error);
146 await ctx?.client.stop(); 148 await ctx?.client.stop();
147 ctx = undefined; 149 ctx = undefined;
148} 150}
@@ -186,7 +188,8 @@ async function bootstrapExtension(config: Config, state: PersistentState): Promi
186 }).catch((e) => { 188 }).catch((e) => {
187 log.error(e); 189 log.error(e);
188 if (state.releaseId === undefined) { // Show error only for the initial download 190 if (state.releaseId === undefined) { // Show error only for the initial download
189 vscode.window.showErrorMessage(`Failed to download rust-analyzer nightly ${e}`); 191 vscode.window.showErrorMessage(`Failed to download rust-analyzer nightly ${e}`)
192 .then(() => {}, console.error);
190 } 193 }
191 return undefined; 194 return undefined;
192 }); 195 });
@@ -305,7 +308,7 @@ async function getServer(config: Config, state: PersistentState): Promise<string
305 "If you feel that your platform should be supported, please create an issue " + 308 "If you feel that your platform should be supported, please create an issue " +
306 "about that [here](https://github.com/rust-analyzer/rust-analyzer/issues) and we " + 309 "about that [here](https://github.com/rust-analyzer/rust-analyzer/issues) and we " +
307 "will consider it." 310 "will consider it."
308 ); 311 ).then(() => {}, console.error);
309 return undefined; 312 return undefined;
310 } 313 }
311 const ext = platform.indexOf("-windows-") !== -1 ? ".exe" : ""; 314 const ext = platform.indexOf("-windows-") !== -1 ? ".exe" : "";
@@ -433,6 +436,7 @@ function warnAboutExtensionConflicts() {
433 vscode.window.showWarningMessage( 436 vscode.window.showWarningMessage(
434 `You have both the ${fst[0]} (${fst[1]}) and ${sec[0]} (${sec[1]}) ` + 437 `You have both the ${fst[0]} (${fst[1]}) and ${sec[0]} (${sec[1]}) ` +
435 "plugins enabled. These are known to conflict and cause various functions of " + 438 "plugins enabled. These are known to conflict and cause various functions of " +
436 "both plugins to not work correctly. You should disable one of them.", "Got it"); 439 "both plugins to not work correctly. You should disable one of them.", "Got it")
440 .then(() => {}, console.error);
437 }; 441 };
438} 442}