Skip to content

Commit b4e91cb

Browse files
committed
Fix statusbar message pooling data from all editors
1 parent 807aae3 commit b4e91cb

File tree

3 files changed

+39
-4
lines changed

3 files changed

+39
-4
lines changed

atest/04_Interface/Statusbar.robot

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,20 @@ Statusbar Popup Opens
1818
Element Should Contain ${POPOVER} python
1919
Element Should Contain ${POPOVER} initialized
2020
[Teardown] Clean Up After Working With File Python.ipynb
21+
22+
Status Changes Correctly Between Editors
23+
Prepare File for Editing Python status example.py
24+
Wait Until Fully Initialized
25+
Open File example.plain
26+
Wait Until Element Contains ${STATUSBAR} Initialized (additional servers needed) timeout=60s
27+
Capture Page Screenshot 01-both-open.png
28+
Switch To Tab example.py
29+
Wait Until Fully Initialized
30+
Switch To Tab example.plain
31+
Wait Until Element Contains ${STATUSBAR} Initialized (additional servers needed) timeout=60s
32+
[Teardown] Clean Up After Working With File example.plain
33+
34+
*** Keywords ***
35+
Switch To Tab
36+
[Arguments] ${file}
37+
Click Element ${JLAB XP DOCK TAB}\[contains(., '${file}')]

atest/Keywords.robot

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,8 +285,12 @@ Prepare File for Editing
285285
[Arguments] ${Language} ${Screenshots} ${file}
286286
Set Tags language:${Language.lower()}
287287
Set Screenshot Directory ${OUTPUT DIR}${/}screenshots${/}${Screenshots}${/}${Language.lower()}
288-
Copy File examples${/}${file} ${OUTPUT DIR}${/}home${/}${file}
289288
Try to Close All Tabs
289+
Open File ${file}
290+
291+
Open File
292+
[Arguments] ${file}
293+
Copy File examples${/}${file} ${OUTPUT DIR}${/}home${/}${file}
290294
Open ${file} in ${MENU EDITOR}
291295
Capture Page Screenshot 00-opened.png
292296

packages/jupyterlab-lsp/src/components/statusbar.tsx

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -322,8 +322,7 @@ const classByStatus: StatusIconClass = {
322322
const shortMessageByStatus: StatusMap = {
323323
waiting: 'Waiting...',
324324
initialized: 'Fully initialized',
325-
initialized_but_some_missing:
326-
'Initialized (additional servers can be installed)',
325+
initialized_but_some_missing: 'Initialized (additional servers needed)',
327326
initializing: 'Partially initialized',
328327
connecting: 'Connecting...'
329328
};
@@ -436,7 +435,22 @@ export namespace LSPStatus {
436435
}
437436

438437
get status(): IStatus {
439-
const detected_documents = this._connection_manager.documents;
438+
let detected_documents: Map<string, VirtualDocument>;
439+
440+
if (!this.adapter?.virtual_editor) {
441+
detected_documents = new Map();
442+
} else {
443+
let main_document = this.adapter.virtual_editor.virtual_document;
444+
const all_documents = this._connection_manager.documents;
445+
// detected documents that are open in the current virtual editor
446+
const detected_documents_set = collect_documents(main_document);
447+
detected_documents = new Map(
448+
[...all_documents].filter(([id, doc]) =>
449+
detected_documents_set.has(doc)
450+
)
451+
);
452+
}
453+
440454
let connected_documents = new Set<VirtualDocument>();
441455
let initialized_documents = new Set<VirtualDocument>();
442456
let absent_documents = new Set<VirtualDocument>();

0 commit comments

Comments
 (0)