Skip to content

Commit 695d071

Browse files
authored
Merge pull request #3470 from 928PJY/statusBar
Reset and hide StatusBar after all dependencies installed
2 parents 362c4ed + 8e6b09b commit 695d071

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

src/observers/OmnisharpStatusBarObserver.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ export class OmnisharpStatusBarObserver extends BaseStatusBarItemObserver {
4242
case EventType.InstallationStart:
4343
this.SetAndShowStatusBar("$(desktop-download) Installing packages...", '', '', `Installing package '${(<InstallationStart>event).packageDescription}'`);
4444
break;
45+
case EventType.InstallationSuccess:
46+
this.ResetAndHideStatusBar();
47+
break;
4548
case EventType.DownloadProgress:
4649
let progressEvent = <DownloadProgress>event;
4750
this.SetAndShowStatusBar("$(cloud-download) Downloading packages", '', '', `Downloading package '${progressEvent.packageDescription}'... ${progressEvent.downloadPercentage}%`);

test/unitTests/logging/OmnisharpStatusBarObserver.test.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*--------------------------------------------------------------------------------------------*/
55

66
import { StatusBarItem } from '../../../src/vscodeAdapter';
7-
import { OmnisharpOnBeforeServerInstall, OmnisharpOnBeforeServerStart, OmnisharpServerOnServerError, OmnisharpServerOnStart, OmnisharpServerOnStop, DownloadStart, InstallationStart, DownloadProgress, OmnisharpServerOnStdErr, BaseEvent } from '../../../src/omnisharp/loggingEvents';
7+
import { OmnisharpOnBeforeServerInstall, OmnisharpOnBeforeServerStart, OmnisharpServerOnServerError, OmnisharpServerOnStart, OmnisharpServerOnStop, DownloadStart, InstallationStart, DownloadProgress, OmnisharpServerOnStdErr, BaseEvent, InstallationSuccess } from '../../../src/omnisharp/loggingEvents';
88
import { expect, should } from 'chai';
99
import { OmnisharpStatusBarObserver, StatusBarColors } from '../../../src/observers/OmnisharpStatusBarObserver';
1010

@@ -110,4 +110,17 @@ suite('OmnisharpStatusBarObserver', () => {
110110
expect(statusBarItem.tooltip).to.contain(event.packageDescription);
111111
expect(statusBarItem.tooltip).to.contain(event.downloadPercentage);
112112
});
113+
114+
test('InstallationSuccess: Status bar is hidden and the attributes are set to undefined', () => {
115+
let installationEvent = new InstallationStart("somePackage");
116+
observer.post(installationEvent);
117+
118+
let successEvent = new InstallationSuccess();
119+
observer.post(successEvent);
120+
121+
expect(hideCalled).to.be.true;
122+
expect(statusBarItem.text).to.be.undefined;
123+
expect(statusBarItem.command).to.be.undefined;
124+
expect(statusBarItem.color).to.be.undefined;
125+
});
113126
});

0 commit comments

Comments
 (0)