Skip to content

Commit d5a1a5e

Browse files
bors[bot]matklad
andauthored
Merge #2715
2715: Fixes to progress display r=matklad a=matklad Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2 parents c3a8632 + ef24721 commit d5a1a5e

File tree

2 files changed

+12
-17
lines changed

2 files changed

+12
-17
lines changed

editors/code/src/main.ts

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,6 @@ let ctx!: Ctx;
1111
export async function activate(context: vscode.ExtensionContext) {
1212
ctx = new Ctx(context);
1313

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-
2514
// Commands which invokes manually via command pallet, shortcut, etc.
2615
ctx.registerCommand('analyzerStatus', commands.analyzerStatus);
2716
ctx.registerCommand('collectGarbage', commands.collectGarbage);
@@ -42,7 +31,17 @@ export async function activate(context: vscode.ExtensionContext) {
4231
ctx.overrideCommand('type', commands.onEnter);
4332
}
4433
activateStatusDisplay(ctx);
34+
4535
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+
}
4645
activateInlayHints(ctx);
4746
}
4847

editors/code/src/status_display.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,9 @@ class StatusDisplay implements vscode.Disposable {
3636
this.timer ||
3737
setInterval(() => {
3838
if (this.packageName) {
39-
this.statusBarItem!.text = `cargo ${this.command} [${
40-
this.packageName
41-
}] ${this.frame()}`;
39+
this.statusBarItem!.text = `${this.frame()} cargo ${this.command} [${this.packageName}]`;
4240
} else {
43-
this.statusBarItem!.text = `cargo ${
44-
this.command
45-
} ${this.frame()}`;
41+
this.statusBarItem!.text = `${this.frame()} cargo ${this.command}`;
4642
}
4743
}, 300);
4844

0 commit comments

Comments
 (0)