Skip to content

Commit 7270488

Browse files
shad0wshayd3shad0wshayd3
shad0wshayd3
authored andcommitted
fix: Status Bar now hides with no active files
1 parent d0c86b1 commit 7270488

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/papyrus-lang-vscode/src/features/LanguageServiceStatusItems.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ class StatusBarItemController implements Disposable {
2121

2222
const activeEditor = eventToValueObservable(window.onDidChangeActiveTextEditor, () => window.activeTextEditor);
2323

24+
const visibleEditors = eventToValueObservable(window.onDidChangeVisibleTextEditors, () => window.visibleTextEditors);
25+
2426
const hostStatus = languageClientHost.pipe(
2527
mergeMap((host) => host.status),
2628
shareReplay(1)
@@ -55,12 +57,13 @@ class StatusBarItemController implements Disposable {
5557
hostStatus,
5658
hostError,
5759
activeEditor,
60+
visibleEditors,
5861
showOutputChannelCommand,
5962
activeDocumentScriptInfo
6063
).subscribe({
61-
next: ([host, status, _error, activeEditor, showOutputChannelCommand, activeDocumentScriptInfo]) => {
64+
next: ([host, status, _error, activeEditor, visibleEditors, showOutputChannelCommand, activeDocumentScriptInfo]) => {
6265
if (
63-
!activeEditor ||
66+
!activeEditor || !visibleEditors || (visibleEditors.length === 0) ||
6467
(activeEditor.document.languageId !== 'papyrus' &&
6568
activeEditor.document.languageId !== 'papyrus-project')
6669
) {
@@ -86,7 +89,7 @@ class StatusBarItemController implements Disposable {
8689
activeDocumentScriptInfo && activeDocumentScriptInfo.identifiers.length > 0
8790
? '$(verified)'
8891
: '$(check)'
89-
}`;
92+
}`;
9093
this._statusBarItem.tooltip = `${fullName} language service running.`;
9194
break;
9295
case ClientHostStatus.missing:

0 commit comments

Comments
 (0)