mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 05:45:12 +00:00
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).
This commit is contained in:
parent
f0a1b64d7e
commit
fb6e655de8
13 changed files with 270 additions and 696 deletions
|
@ -1,20 +1,10 @@
|
|||
import * as vscode from 'vscode';
|
||||
import { ensureServerBinary } from '../installation/server';
|
||||
import * as vscode from "vscode";
|
||||
import { spawnSync } from "child_process";
|
||||
import { Ctx, Cmd } from '../ctx';
|
||||
import { spawnSync } from 'child_process';
|
||||
|
||||
export function serverVersion(ctx: Ctx): Cmd {
|
||||
return async () => {
|
||||
const binaryPath = await ensureServerBinary(ctx.config, ctx.state);
|
||||
|
||||
if (binaryPath == null) {
|
||||
throw new Error(
|
||||
"Rust Analyzer Language Server is not available. " +
|
||||
"Please, ensure its [proper installation](https://rust-analyzer.github.io/manual.html#installation)."
|
||||
);
|
||||
}
|
||||
|
||||
const version = spawnSync(binaryPath, ["--version"], { encoding: "utf8" }).stdout;
|
||||
const version = spawnSync(ctx.serverPath, ["--version"], { encoding: "utf8" }).stdout;
|
||||
vscode.window.showInformationMessage('rust-analyzer version : ' + version);
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue