Skip to content

Commit

Permalink
Merge pull request #4621 from JoeRobich/set-statusbaritem-name
Browse files Browse the repository at this point in the history
Set the names of the status bar items
  • Loading branch information
JoeRobich authored Jun 21, 2021
2 parents 3aa3167 + b0010f2 commit 77dee00
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 12 deletions.
19 changes: 9 additions & 10 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
"@types/semver": "5.5.0",
"@types/tmp": "0.0.33",
"@types/unzipper": "^0.9.1",
"@types/vscode": "1.53.0",
"@types/vscode": "1.57.0",
"@types/yauzl": "2.9.1",
"archiver": "5.3.0",
"chai": "4.3.4",
Expand Down Expand Up @@ -381,7 +381,7 @@
}
],
"engines": {
"vscode": "^1.53.0"
"vscode": "^1.57.0"
},
"activationEvents": [
"onDebugInitialConfigurations",
Expand Down
3 changes: 3 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,17 @@ export async function activate(context: vscode.ExtensionContext): Promise<CSharp
eventStream.subscribe(errorMessageObserver.post);

let omnisharpStatusBar = new StatusBarItemAdapter(vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Left, Number.MIN_VALUE + 2));
omnisharpStatusBar.name = "C# Language Service Status";
let omnisharpStatusBarObserver = new OmnisharpStatusBarObserver(omnisharpStatusBar);
eventStream.subscribe(omnisharpStatusBarObserver.post);

let projectStatusBar = new StatusBarItemAdapter(vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Left, Number.MIN_VALUE + 1));
projectStatusBar.name = "C# Project Selector";
let projectStatusBarObserver = new ProjectStatusBarObserver(projectStatusBar);
eventStream.subscribe(projectStatusBarObserver.post);

let backgroundWorkStatusBar = new StatusBarItemAdapter(vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Left, Number.MIN_VALUE));
backgroundWorkStatusBar.name = "C# Code Analysis";
let backgroundWorkStatusBarObserver = new BackgroundWorkStatusBarObserver(backgroundWorkStatusBar);
eventStream.subscribe(backgroundWorkStatusBarObserver.post);

Expand Down
8 changes: 8 additions & 0 deletions src/statusBarItemAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,14 @@ export class StatusBarItemAdapter implements vscodeAdapter.StatusBarItem {
this.statusBarItem.command = value;
}

get name(): string {
return this.statusBarItem.name;
}

set name(value: string) {
this.statusBarItem.name = value;
}

show(): void {
this.statusBarItem.show();
}
Expand Down

0 comments on commit 77dee00

Please sign in to comment.