Skip to content

Commit

Permalink
Fix completion provider isApplicable() for Console (#1023)
Browse files Browse the repository at this point in the history
  • Loading branch information
krassowski committed Nov 26, 2023
1 parent ea1b220 commit 14b12f7
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 @@ -93,6 +93,10 @@ export class EnhancedKernelCompleterProvider extends KernelCompleterProvider {

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

if (!adapter) {
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 @@ -301,6 +301,10 @@ export class CompletionProvider implements ICompletionProvider<CompletionItem> {
}
const manager = this.options.connectionManager;
const widget = context.widget as IDocumentWidget;
if (typeof widget.context === 'undefined') {
// there is no path for Console as it is not a DocumentWidget
return false;
}
const adapter = manager.adapters.get(widget.context.path);
if (!adapter) {
return false;
Expand Down

0 comments on commit 14b12f7

Please sign in to comment.