Skip to content

Commit 2a9068f

Browse files
committed
Fix hiding of panel, fix illegal constructor for plain-text documentation
1 parent e8edf50 commit 2a9068f

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

packages/jupyterlab-lsp/src/features/completion/completion.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -261,18 +261,18 @@ export class CompletionLabIntegration implements IFeatureLabIntegration {
261261

262262
docPanel.setAttribute('style', '');
263263
} else {
264-
docPanel.setAttribute('style', 'none');
264+
docPanel.setAttribute('style', 'display: none');
265265
}
266266
}
267267

268-
set_doc_panel_placeholder(enabled: boolean) {
268+
set_doc_panel_placeholder(enable: boolean) {
269269
let completer = this.current_completion_handler.completer;
270270
const docPanel = completer.node.querySelector(DOC_PANEL_SELECTOR);
271-
if (enabled) {
271+
if (enable) {
272272
docPanel.setAttribute('style', '');
273273
docPanel.classList.add(DOC_PANEL_PLACEHOLDER_CLASS);
274-
} else {
275-
docPanel.setAttribute('style', 'none');
274+
} else if (docPanel.classList.contains(DOC_PANEL_PLACEHOLDER_CLASS)) {
275+
docPanel.setAttribute('style', 'display: none');
276276
docPanel.classList.remove(DOC_PANEL_PLACEHOLDER_CLASS);
277277
}
278278
}

packages/jupyterlab-lsp/src/features/completion/completion_handler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,12 +130,12 @@ export class LazyCompletionItem implements CompletionHandler.ICompletionItem {
130130
connection
131131
.getCompletionResolve(this.match)
132132
.then(resolvedCompletionItem => {
133+
this.connector.lab_integration.set_doc_panel_placeholder(false);
133134
if (resolvedCompletionItem === null) {
134135
return;
135136
}
136137
this._setDocumentation(resolvedCompletionItem.documentation);
137138
this._resolved = true;
138-
this.connector.lab_integration.set_doc_panel_placeholder(false);
139139
this.connector.lab_integration.refresh_doc_panel(this);
140140
})
141141
.catch(e => {

packages/jupyterlab-lsp/src/features/completion/renderer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export class LSPCompletionRenderer
6666
.catch(this.options.console.warn);
6767
return this.options.markdownRenderer.node;
6868
} else {
69-
let node = new HTMLDivElement();
69+
let node = document.createElement('div');
7070
node.textContent = item.documentation;
7171
return node;
7272
}

0 commit comments

Comments
 (0)