3534: Feature: vscode impl nightlies download and installation r=Veetaha a=Veetaha

I need to test things more, but the core shape of the code is quite well-formed.
The main problem is that we save the release date only for nightlies and there are no means to get the release date of the stable extension (i.e. for this we would need to consult the github releases via a network request, or we would need to somehow save this info into package.json or any other file accessible from the extension code during the deployment step, but this will be very hard I guess).
So there is an invariant that the users can install nightly only from our extension and they can't do it manually, because when installing the nightly `.vsix` we actually save its release date to `globalState`

Closes: #3402

TODO:
- [x] More manual tests and documentation

cc @matklad @lnicola 

Co-authored-by: Veetaha <gerzoh1@gmail.com>
Co-authored-by: Veetaha <veetaha2@gmail.com>
This commit is contained in:
bors[bot] 2020-03-16 10:26:31 +00:00 committed by GitHub
commit 200c275c2e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 454 additions and 147 deletions

View file

@ -5,7 +5,7 @@ import { spawnSync } from 'child_process';
export function serverVersion(ctx: Ctx): Cmd {
return async () => {
const binaryPath = await ensureServerBinary(ctx.config.serverSource);
const binaryPath = await ensureServerBinary(ctx.config);
if (binaryPath == null) {
throw new Error(
@ -18,4 +18,3 @@ export function serverVersion(ctx: Ctx): Cmd {
vscode.window.showInformationMessage('rust-analyzer version : ' + version);
};
}