aboutsummaryrefslogtreecommitdiff
path: root/editors/code/src/main.ts
diff options
context:
space:
mode:
Diffstat (limited to 'editors/code/src/main.ts')
-rw-r--r--editors/code/src/main.ts9
1 files changed, 8 insertions, 1 deletions
diff --git a/editors/code/src/main.ts b/editors/code/src/main.ts
index a46dbde33..40701e4f5 100644
--- a/editors/code/src/main.ts
+++ b/editors/code/src/main.ts
@@ -13,6 +13,7 @@ import { log, assert } from './util';
13import { PersistentState } from './persistent_state'; 13import { PersistentState } from './persistent_state';
14import { fetchRelease, download } from './net'; 14import { fetchRelease, download } from './net';
15import { spawnSync } from 'child_process'; 15import { spawnSync } from 'child_process';
16import { activateTaskProvider } from './tasks';
16 17
17let ctx: Ctx | undefined; 18let ctx: Ctx | undefined;
18 19
@@ -41,11 +42,13 @@ export async function activate(context: vscode.ExtensionContext) {
41 const state = new PersistentState(context.globalState); 42 const state = new PersistentState(context.globalState);
42 const serverPath = await bootstrap(config, state); 43 const serverPath = await bootstrap(config, state);
43 44
45 const workspaceFolder = vscode.workspace.workspaceFolders?.[0] ?? null;
46
44 // Note: we try to start the server before we activate type hints so that it 47 // Note: we try to start the server before we activate type hints so that it
45 // registers its `onDidChangeDocument` handler before us. 48 // registers its `onDidChangeDocument` handler before us.
46 // 49 //
47 // This a horribly, horribly wrong way to deal with this problem. 50 // This a horribly, horribly wrong way to deal with this problem.
48 ctx = await Ctx.create(config, context, serverPath); 51 ctx = await Ctx.create(config, context, serverPath, workspaceFolder);
49 52
50 // Commands which invokes manually via command palette, shortcut, etc. 53 // Commands which invokes manually via command palette, shortcut, etc.
51 54
@@ -85,6 +88,10 @@ export async function activate(context: vscode.ExtensionContext) {
85 ctx.registerCommand('applySourceChange', commands.applySourceChange); 88 ctx.registerCommand('applySourceChange', commands.applySourceChange);
86 ctx.registerCommand('selectAndApplySourceChange', commands.selectAndApplySourceChange); 89 ctx.registerCommand('selectAndApplySourceChange', commands.selectAndApplySourceChange);
87 90
91 if (workspaceFolder !== null) {
92 ctx.pushCleanup(activateTaskProvider(workspaceFolder));
93 }
94
88 activateStatusDisplay(ctx); 95 activateStatusDisplay(ctx);
89 96
90 if (!ctx.config.highlightingSemanticTokens) { 97 if (!ctx.config.highlightingSemanticTokens) {