diff options
author | Aleksey Kladov <[email protected]> | 2020-03-17 11:44:31 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2020-03-19 08:04:59 +0000 |
commit | fb6e655de8a44c65275ad45a27bf5bd684670ba0 (patch) | |
tree | 9c307ac69c8fc59465ee2fb6f9a8a619fc064167 /editors/code/src/commands | |
parent | f0a1b64d7ee3baa7ccf980b35b85f0a4a3b85b1a (diff) |
Rewrite auto-update
Everything now happens in main.ts, in the bootstrap family of
functions. The current flow is:
* check everything only on extension installation.
* if the user is on nightly channel, try to download the nightly
extension and reload.
* when we install nightly extension, we persist its release id, so
that we can check if the current release is different.
* if server binary was not downloaded by the current version of the
extension, redownload it (we persist the version of ext that
downloaded the server).
Diffstat (limited to 'editors/code/src/commands')
-rw-r--r-- | editors/code/src/commands/server_version.ts | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/editors/code/src/commands/server_version.ts b/editors/code/src/commands/server_version.ts index 83b1acf67..03528b825 100644 --- a/editors/code/src/commands/server_version.ts +++ b/editors/code/src/commands/server_version.ts | |||
@@ -1,20 +1,10 @@ | |||
1 | import * as vscode from 'vscode'; | 1 | import * as vscode from "vscode"; |
2 | import { ensureServerBinary } from '../installation/server'; | 2 | import { spawnSync } from "child_process"; |
3 | import { Ctx, Cmd } from '../ctx'; | 3 | import { Ctx, Cmd } from '../ctx'; |
4 | import { spawnSync } from 'child_process'; | ||
5 | 4 | ||
6 | export function serverVersion(ctx: Ctx): Cmd { | 5 | export function serverVersion(ctx: Ctx): Cmd { |
7 | return async () => { | 6 | return async () => { |
8 | const binaryPath = await ensureServerBinary(ctx.config, ctx.state); | 7 | const version = spawnSync(ctx.serverPath, ["--version"], { encoding: "utf8" }).stdout; |
9 | |||
10 | if (binaryPath == null) { | ||
11 | throw new Error( | ||
12 | "Rust Analyzer Language Server is not available. " + | ||
13 | "Please, ensure its [proper installation](https://rust-analyzer.github.io/manual.html#installation)." | ||
14 | ); | ||
15 | } | ||
16 | |||
17 | const version = spawnSync(binaryPath, ["--version"], { encoding: "utf8" }).stdout; | ||
18 | vscode.window.showInformationMessage('rust-analyzer version : ' + version); | 8 | vscode.window.showInformationMessage('rust-analyzer version : ' + version); |
19 | }; | 9 | }; |
20 | } | 10 | } |