-
Notifications
You must be signed in to change notification settings - Fork 28.2k
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
Add support for notebook types in DocumentSelector #141143
Comments
This is API delta/addition which complements the existing vscode/src/vscode-dts/vscode.proposed.notebookDocumentSelector.d.ts Lines 10 to 16 in 609eea3
The presence of Also, the idea of also allowing to filter on notebook kernels/controllers didn't stick. A controller is a private object, meaning a controller that adds language features knows the current notebook and can filter on that, e.g in its // controller-specific language feature
myKernel.onDidChangeSelectedNotebooks(e => {
vscode.languages.registerTypeDefinitionProvider({
language: 'plaintext',
pattern: e.notebook.uri.path,
notebookType: e.notebook.notebookType
}, new class implements vscode.TypeDefinitionProvider {
provideTypeDefinition(document: vscode.TextDocument, position: vscode.Position, token: vscode.CancellationToken) {
return new vscode.Location(document.uri, new vscode.Position(0, 0));
}
})
}) |
When |
@dbaeumer please verify that this is stable API now |
Throughout the API the
DocumentSelector
is used to "bind" features like completions or code navigations against certain documents. However, it doesn't allows to narrow down on documents that are part of a notebook, extensions want to say python-language but only in jupyter-notebooks./cc @dbaeumer who brought this up for the notebook related LSP work
The text was updated successfully, but these errors were encountered: