mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-13 13:48:50 +00:00
Fixes to progress display
This commit is contained in:
parent
e4d217074d
commit
ef24721640
2 changed files with 12 additions and 17 deletions
|
@ -11,17 +11,6 @@ let ctx!: Ctx;
|
|||
export async function activate(context: vscode.ExtensionContext) {
|
||||
ctx = new Ctx(context);
|
||||
|
||||
// Note: we try to start the server before we register various commands, so
|
||||
// that it registers its `onDidChangeDocument` handler before us.
|
||||
//
|
||||
// This a horribly, horribly wrong way to deal with this problem.
|
||||
try {
|
||||
await ctx.restartServer();
|
||||
} catch (e) {
|
||||
vscode.window.showErrorMessage(e.message);
|
||||
}
|
||||
|
||||
|
||||
// Commands which invokes manually via command pallet, shortcut, etc.
|
||||
ctx.registerCommand('analyzerStatus', commands.analyzerStatus);
|
||||
ctx.registerCommand('collectGarbage', commands.collectGarbage);
|
||||
|
@ -42,7 +31,17 @@ export async function activate(context: vscode.ExtensionContext) {
|
|||
ctx.overrideCommand('type', commands.onEnter);
|
||||
}
|
||||
activateStatusDisplay(ctx);
|
||||
|
||||
activateHighlighting(ctx);
|
||||
// Note: we try to start the server before we activate type hints so that it
|
||||
// registers its `onDidChangeDocument` handler before us.
|
||||
//
|
||||
// This a horribly, horribly wrong way to deal with this problem.
|
||||
try {
|
||||
await ctx.restartServer();
|
||||
} catch (e) {
|
||||
vscode.window.showErrorMessage(e.message);
|
||||
}
|
||||
activateInlayHints(ctx);
|
||||
}
|
||||
|
||||
|
|
|
@ -36,13 +36,9 @@ class StatusDisplay implements vscode.Disposable {
|
|||
this.timer ||
|
||||
setInterval(() => {
|
||||
if (this.packageName) {
|
||||
this.statusBarItem!.text = `cargo ${this.command} [${
|
||||
this.packageName
|
||||
}] ${this.frame()}`;
|
||||
this.statusBarItem!.text = `${this.frame()} cargo ${this.command} [${this.packageName}]`;
|
||||
} else {
|
||||
this.statusBarItem!.text = `cargo ${
|
||||
this.command
|
||||
} ${this.frame()}`;
|
||||
this.statusBarItem!.text = `${this.frame()} cargo ${this.command}`;
|
||||
}
|
||||
}, 300);
|
||||
|
||||
|
|
Loading…
Reference in a new issue