diff options
Diffstat (limited to 'editors/code/src/main.ts')
-rw-r--r-- | editors/code/src/main.ts | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/editors/code/src/main.ts b/editors/code/src/main.ts index bd4661a36..94ecd4dab 100644 --- a/editors/code/src/main.ts +++ b/editors/code/src/main.ts | |||
@@ -9,6 +9,7 @@ import { ensureServerBinary } from './installation/server'; | |||
9 | import { Config } from './config'; | 9 | import { Config } from './config'; |
10 | import { log } from './util'; | 10 | import { log } from './util'; |
11 | import { ensureProperExtensionVersion } from './installation/extension'; | 11 | import { ensureProperExtensionVersion } from './installation/extension'; |
12 | import { PersistentState } from './persistent_state'; | ||
12 | 13 | ||
13 | let ctx: Ctx | undefined; | 14 | let ctx: Ctx | undefined; |
14 | 15 | ||
@@ -34,13 +35,14 @@ export async function activate(context: vscode.ExtensionContext) { | |||
34 | context.subscriptions.push(defaultOnEnter); | 35 | context.subscriptions.push(defaultOnEnter); |
35 | 36 | ||
36 | const config = new Config(context); | 37 | const config = new Config(context); |
38 | const state = new PersistentState(context); | ||
37 | 39 | ||
38 | vscode.workspace.onDidChangeConfiguration(() => ensureProperExtensionVersion(config).catch(log.error)); | 40 | vscode.workspace.onDidChangeConfiguration(() => ensureProperExtensionVersion(config, state).catch(log.error)); |
39 | 41 | ||
40 | // Don't await the user response here, otherwise we will block the lsp server bootstrap | 42 | // Don't await the user response here, otherwise we will block the lsp server bootstrap |
41 | void ensureProperExtensionVersion(config).catch(log.error); | 43 | void ensureProperExtensionVersion(config, state).catch(log.error); |
42 | 44 | ||
43 | const serverPath = await ensureServerBinary(config); | 45 | const serverPath = await ensureServerBinary(config, state); |
44 | 46 | ||
45 | if (serverPath == null) { | 47 | if (serverPath == null) { |
46 | throw new Error( | 48 | throw new Error( |
@@ -53,7 +55,7 @@ export async function activate(context: vscode.ExtensionContext) { | |||
53 | // registers its `onDidChangeDocument` handler before us. | 55 | // registers its `onDidChangeDocument` handler before us. |
54 | // | 56 | // |
55 | // This a horribly, horribly wrong way to deal with this problem. | 57 | // This a horribly, horribly wrong way to deal with this problem. |
56 | ctx = await Ctx.create(config, context, serverPath); | 58 | ctx = await Ctx.create(config, state, context, serverPath); |
57 | 59 | ||
58 | // Commands which invokes manually via command palette, shortcut, etc. | 60 | // Commands which invokes manually via command palette, shortcut, etc. |
59 | ctx.registerCommand('reload', (ctx) => { | 61 | ctx.registerCommand('reload', (ctx) => { |