diff options
Diffstat (limited to 'editors/code/src/main.ts')
-rw-r--r-- | editors/code/src/main.ts | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/editors/code/src/main.ts b/editors/code/src/main.ts index 43cae5c7f..d18d6c8a9 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 | ||
@@ -143,7 +143,7 @@ async function tryActivate(context: vscode.ExtensionContext) { | |||
143 | } | 143 | } |
144 | 144 | ||
145 | export async function deactivate() { | 145 | export async function deactivate() { |
146 | setContextValue(RUST_PROJECT_CONTEXT_NAME, undefined); | 146 | await setContextValue(RUST_PROJECT_CONTEXT_NAME, undefined); |
147 | await ctx?.client.stop(); | 147 | await ctx?.client.stop(); |
148 | ctx = undefined; | 148 | ctx = undefined; |
149 | } | 149 | } |
@@ -184,10 +184,10 @@ async function bootstrapExtension(config: Config, state: PersistentState): Promi | |||
184 | 184 | ||
185 | const release = await downloadWithRetryDialog(state, async () => { | 185 | const release = await downloadWithRetryDialog(state, async () => { |
186 | return await fetchRelease("nightly", state.githubToken); | 186 | return await fetchRelease("nightly", state.githubToken); |
187 | }).catch((e) => { | 187 | }).catch(async (e) => { |
188 | log.error(e); | 188 | log.error(e); |
189 | if (state.releaseId === undefined) { // Show error only for the initial download | 189 | if (state.releaseId === undefined) { // Show error only for the initial download |
190 | vscode.window.showErrorMessage(`Failed to download rust-analyzer nightly ${e}`); | 190 | await vscode.window.showErrorMessage(`Failed to download rust-analyzer nightly ${e}`); |
191 | } | 191 | } |
192 | return undefined; | 192 | return undefined; |
193 | }); | 193 | }); |
@@ -299,7 +299,7 @@ async function getServer(config: Config, state: PersistentState): Promise<string | |||
299 | }; | 299 | }; |
300 | const platform = platforms[`${process.arch} ${process.platform}`]; | 300 | const platform = platforms[`${process.arch} ${process.platform}`]; |
301 | if (platform === undefined) { | 301 | if (platform === undefined) { |
302 | vscode.window.showErrorMessage( | 302 | await vscode.window.showErrorMessage( |
303 | "Unfortunately we don't ship binaries for your platform yet. " + | 303 | "Unfortunately we don't ship binaries for your platform yet. " + |
304 | "You need to manually clone rust-analyzer repository and " + | 304 | "You need to manually clone rust-analyzer repository and " + |
305 | "run `cargo xtask install --server` to build the language server from sources. " + | 305 | "run `cargo xtask install --server` to build the language server from sources. " + |
@@ -434,6 +434,7 @@ function warnAboutExtensionConflicts() { | |||
434 | vscode.window.showWarningMessage( | 434 | vscode.window.showWarningMessage( |
435 | `You have both the ${fst[0]} (${fst[1]}) and ${sec[0]} (${sec[1]}) ` + | 435 | `You have both the ${fst[0]} (${fst[1]}) and ${sec[0]} (${sec[1]}) ` + |
436 | "plugins enabled. These are known to conflict and cause various functions of " + | 436 | "plugins enabled. These are known to conflict and cause various functions of " + |
437 | "both plugins to not work correctly. You should disable one of them.", "Got it"); | 437 | "both plugins to not work correctly. You should disable one of them.", "Got it") |
438 | .then(() => { }, console.error); | ||
438 | }; | 439 | }; |
439 | } | 440 | } |