Skip to content

Commit

Permalink
Fix completion provider isApplicable() for Console
Browse files Browse the repository at this point in the history
  • Loading branch information
krassowski committed Nov 25, 2023
1 parent ace7047 commit 85d2555
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/jupyterlab-lsp/src/features/completion/overrides.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ export class EnhancedKernelCompleterProvider extends KernelCompleterProvider {
}

const manager = this.options.connectionManager;
if (!context.widget.hasOwnProperty('path')) {
// there is no path for Console as it is not a DocumentWidget
return false;
}
const widget = context.widget as IDocumentWidget;
const adapter = manager.adapters.get(widget.context.path);

Expand Down
4 changes: 4 additions & 0 deletions packages/jupyterlab-lsp/src/features/completion/provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,10 @@ export class CompletionProvider implements ICompletionProvider<CompletionItem> {
return false;
}
const manager = this.options.connectionManager;
if (!context.widget.hasOwnProperty('path')) {
// there is no path for Console as it is not a DocumentWidget
return false;
}
const widget = context.widget as IDocumentWidget;
const adapter = manager.adapters.get(widget.context.path);
if (!adapter) {
Expand Down

0 comments on commit 85d2555

Please sign in to comment.