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.ts13
1 files changed, 7 insertions, 6 deletions
diff --git a/editors/code/src/main.ts b/editors/code/src/main.ts
index 1900d900a..5c0b0be26 100644
--- a/editors/code/src/main.ts
+++ b/editors/code/src/main.ts
@@ -76,7 +76,7 @@ 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 await setContextValue(RUST_PROJECT_CONTEXT_NAME, true);
80 80
81 // Commands which invokes manually via command palette, shortcut, etc. 81 // Commands which invokes manually via command palette, shortcut, etc.
82 82
@@ -142,7 +142,7 @@ async function tryActivate(context: vscode.ExtensionContext) {
142} 142}
143 143
144export async function deactivate() { 144export async function deactivate() {
145 setContextValue(RUST_PROJECT_CONTEXT_NAME, undefined); 145 await setContextValue(RUST_PROJECT_CONTEXT_NAME, undefined);
146 await ctx?.client.stop(); 146 await ctx?.client.stop();
147 ctx = undefined; 147 ctx = undefined;
148} 148}
@@ -183,10 +183,10 @@ async function bootstrapExtension(config: Config, state: PersistentState): Promi
183 183
184 const release = await downloadWithRetryDialog(state, async () => { 184 const release = await downloadWithRetryDialog(state, async () => {
185 return await fetchRelease("nightly", state.githubToken); 185 return await fetchRelease("nightly", state.githubToken);
186 }).catch((e) => { 186 }).catch(async (e) => {
187 log.error(e); 187 log.error(e);
188 if (state.releaseId === undefined) { // Show error only for the initial download 188 if (state.releaseId === undefined) { // Show error only for the initial download
189 vscode.window.showErrorMessage(`Failed to download rust-analyzer nightly ${e}`); 189 await vscode.window.showErrorMessage(`Failed to download rust-analyzer nightly ${e}`);
190 } 190 }
191 return undefined; 191 return undefined;
192 }); 192 });
@@ -298,7 +298,7 @@ async function getServer(config: Config, state: PersistentState): Promise<string
298 }; 298 };
299 const platform = platforms[`${process.arch} ${process.platform}`]; 299 const platform = platforms[`${process.arch} ${process.platform}`];
300 if (platform === undefined) { 300 if (platform === undefined) {
301 vscode.window.showErrorMessage( 301 await vscode.window.showErrorMessage(
302 "Unfortunately we don't ship binaries for your platform yet. " + 302 "Unfortunately we don't ship binaries for your platform yet. " +
303 "You need to manually clone rust-analyzer repository and " + 303 "You need to manually clone rust-analyzer repository and " +
304 "run `cargo xtask install --server` to build the language server from sources. " + 304 "run `cargo xtask install --server` to build the language server from sources. " +
@@ -433,6 +433,7 @@ function warnAboutExtensionConflicts() {
433 vscode.window.showWarningMessage( 433 vscode.window.showWarningMessage(
434 `You have both the ${fst[0]} (${fst[1]}) and ${sec[0]} (${sec[1]}) ` + 434 `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 " + 435 "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"); 436 "both plugins to not work correctly. You should disable one of them.", "Got it")
437 .then(() => { }, console.error);
437 }; 438 };
438} 439}