Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LSP extensionFactory is never called for file editors #15868

Closed
krassowski opened this issue Feb 24, 2024 · 0 comments · Fixed by #15873
Closed

LSP extensionFactory is never called for file editors #15868

krassowski opened this issue Feb 24, 2024 · 0 comments · Fixed by #15873
Milestone

Comments

@krassowski
Copy link
Member

krassowski commented Feb 24, 2024

Description

JupyterLab 4.1 introduced extensionFactory (#14920) to enable adapter-aware code editor extensions; it works fine for notebooks but not at all in file editors. This is because it is instantiated by EditorAdapter which is created when an editor (e.g. cell) gets added to a widget adapter:

private _onEditorAdded(
sender: WidgetLSPAdapter<T>,
change: IEditorChangedData
): void {
const { editor } = change;
const editorAdapter = new EditorAdapter({
editor: editor,
widgetAdapter: this,
extensions: this.options.featureManager.extensionFactories()
});
this._editorToAdapter.set(editor, editorAdapter);
}

While notebook adapter correctly emits this signal when new cells get added:

this._editorAdded.emit({
editor
});

It is never emitted from file adapter

export class FileEditorAdapter extends WidgetLSPAdapter<

Expected behavior

Editor extensions registered on LSP manager using widgetFactory in file editor too.

Context

  • JupyterLab version: 4.1.2
@krassowski krassowski added bug status:Needs Triage Applied to new issues that need triage pkg:lsp labels Feb 24, 2024
@krassowski krassowski changed the title LSP widgetFactory is never called for file editors LSP extensionFactory is never called for file editors Feb 24, 2024
@krassowski krassowski added this to the 4.1.x milestone Feb 24, 2024
@JasonWeill JasonWeill removed the status:Needs Triage Applied to new issues that need triage label Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants