aboutsummaryrefslogtreecommitdiff
path: root/editors/code/src/ctx.ts
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2020-03-17 11:44:31 +0000
committerAleksey Kladov <[email protected]>2020-03-19 08:04:59 +0000
commitfb6e655de8a44c65275ad45a27bf5bd684670ba0 (patch)
tree9c307ac69c8fc59465ee2fb6f9a8a619fc064167 /editors/code/src/ctx.ts
parentf0a1b64d7ee3baa7ccf980b35b85f0a4a3b85b1a (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/ctx.ts')
-rw-r--r--editors/code/src/ctx.ts9
1 files changed, 4 insertions, 5 deletions
diff --git a/editors/code/src/ctx.ts b/editors/code/src/ctx.ts
index c929ab063..84c170ea8 100644
--- a/editors/code/src/ctx.ts
+++ b/editors/code/src/ctx.ts
@@ -4,21 +4,20 @@ import * as lc from 'vscode-languageclient';
4import { Config } from './config'; 4import { Config } from './config';
5import { createClient } from './client'; 5import { createClient } from './client';
6import { isRustEditor, RustEditor } from './util'; 6import { isRustEditor, RustEditor } from './util';
7import { PersistentState } from './persistent_state';
8 7
9export class Ctx { 8export class Ctx {
10 private constructor( 9 private constructor(
11 readonly config: Config, 10 readonly config: Config,
12 readonly state: PersistentState,
13 private readonly extCtx: vscode.ExtensionContext, 11 private readonly extCtx: vscode.ExtensionContext,
14 readonly client: lc.LanguageClient 12 readonly client: lc.LanguageClient,
13 readonly serverPath: string,
15 ) { 14 ) {
16 15
17 } 16 }
18 17
19 static async create(config: Config, state: PersistentState, extCtx: vscode.ExtensionContext, serverPath: string): Promise<Ctx> { 18 static async create(config: Config, extCtx: vscode.ExtensionContext, serverPath: string): Promise<Ctx> {
20 const client = await createClient(config, serverPath); 19 const client = await createClient(config, serverPath);
21 const res = new Ctx(config, state, extCtx, client); 20 const res = new Ctx(config, extCtx, client, serverPath);
22 res.pushCleanup(client.start()); 21 res.pushCleanup(client.start());
23 await client.onReady(); 22 await client.onReady();
24 return res; 23 return res;