diff options
Diffstat (limited to 'editors/code')
-rw-r--r-- | editors/code/src/inlay_hints.ts | 3 | ||||
-rw-r--r-- | editors/code/src/main.ts | 21 | ||||
-rw-r--r-- | editors/code/src/status_display.ts | 8 |
3 files changed, 14 insertions, 18 deletions
diff --git a/editors/code/src/inlay_hints.ts b/editors/code/src/inlay_hints.ts index 6dd767d72..078d18f0f 100644 --- a/editors/code/src/inlay_hints.ts +++ b/editors/code/src/inlay_hints.ts | |||
@@ -41,10 +41,11 @@ const typeHintDecorationType = vscode.window.createTextEditorDecorationType({ | |||
41 | class HintsUpdater { | 41 | class HintsUpdater { |
42 | private pending: Map<string, vscode.CancellationTokenSource> = new Map(); | 42 | private pending: Map<string, vscode.CancellationTokenSource> = new Map(); |
43 | private ctx: Ctx; | 43 | private ctx: Ctx; |
44 | private enabled = true; | 44 | private enabled: boolean; |
45 | 45 | ||
46 | constructor(ctx: Ctx) { | 46 | constructor(ctx: Ctx) { |
47 | this.ctx = ctx; | 47 | this.ctx = ctx; |
48 | this.enabled = ctx.config.displayInlayHints; | ||
48 | } | 49 | } |
49 | 50 | ||
50 | async setEnabled(enabled: boolean) { | 51 | async setEnabled(enabled: boolean) { |
diff --git a/editors/code/src/main.ts b/editors/code/src/main.ts index 51dedd5ef..430ad31b4 100644 --- a/editors/code/src/main.ts +++ b/editors/code/src/main.ts | |||
@@ -11,17 +11,6 @@ let ctx!: Ctx; | |||
11 | export async function activate(context: vscode.ExtensionContext) { | 11 | export async function activate(context: vscode.ExtensionContext) { |
12 | ctx = new Ctx(context); | 12 | ctx = new Ctx(context); |
13 | 13 | ||
14 | // Note: we try to start the server before we register various commands, so | ||
15 | // that it registers its `onDidChangeDocument` handler before us. | ||
16 | // | ||
17 | // This a horribly, horribly wrong way to deal with this problem. | ||
18 | try { | ||
19 | await ctx.restartServer(); | ||
20 | } catch (e) { | ||
21 | vscode.window.showErrorMessage(e.message); | ||
22 | } | ||
23 | |||
24 | |||
25 | // Commands which invokes manually via command pallet, shortcut, etc. | 14 | // Commands which invokes manually via command pallet, shortcut, etc. |
26 | ctx.registerCommand('analyzerStatus', commands.analyzerStatus); | 15 | ctx.registerCommand('analyzerStatus', commands.analyzerStatus); |
27 | ctx.registerCommand('collectGarbage', commands.collectGarbage); | 16 | ctx.registerCommand('collectGarbage', commands.collectGarbage); |
@@ -42,7 +31,17 @@ export async function activate(context: vscode.ExtensionContext) { | |||
42 | ctx.overrideCommand('type', commands.onEnter); | 31 | ctx.overrideCommand('type', commands.onEnter); |
43 | } | 32 | } |
44 | activateStatusDisplay(ctx); | 33 | activateStatusDisplay(ctx); |
34 | |||
45 | activateHighlighting(ctx); | 35 | activateHighlighting(ctx); |
36 | // Note: we try to start the server before we activate type hints so that it | ||
37 | // registers its `onDidChangeDocument` handler before us. | ||
38 | // | ||
39 | // This a horribly, horribly wrong way to deal with this problem. | ||
40 | try { | ||
41 | await ctx.restartServer(); | ||
42 | } catch (e) { | ||
43 | vscode.window.showErrorMessage(e.message); | ||
44 | } | ||
46 | activateInlayHints(ctx); | 45 | activateInlayHints(ctx); |
47 | } | 46 | } |
48 | 47 | ||
diff --git a/editors/code/src/status_display.ts b/editors/code/src/status_display.ts index 08cdc8bdf..371a2f3bb 100644 --- a/editors/code/src/status_display.ts +++ b/editors/code/src/status_display.ts | |||
@@ -36,13 +36,9 @@ class StatusDisplay implements vscode.Disposable { | |||
36 | this.timer || | 36 | this.timer || |
37 | setInterval(() => { | 37 | setInterval(() => { |
38 | if (this.packageName) { | 38 | if (this.packageName) { |
39 | this.statusBarItem!.text = `cargo ${this.command} [${ | 39 | this.statusBarItem!.text = `${this.frame()} cargo ${this.command} [${this.packageName}]`; |
40 | this.packageName | ||
41 | }] ${this.frame()}`; | ||
42 | } else { | 40 | } else { |
43 | this.statusBarItem!.text = `cargo ${ | 41 | this.statusBarItem!.text = `${this.frame()} cargo ${this.command}`; |
44 | this.command | ||
45 | } ${this.frame()}`; | ||
46 | } | 42 | } |
47 | }, 300); | 43 | }, 300); |
48 | 44 | ||