-
-
Notifications
You must be signed in to change notification settings - Fork 106
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 notebooks #311
Comments
For anyone who's interested, you can kind of use function getClientOptions(): LanguageClientOptions {
return {
// Specify which documents you'd like to be sent to the language server
//
// For a list of available schemes in VSCode see: https://github.com/microsoft/vscode/blob/main/src/vs/base/common/network.ts#L10
documentSelector: [
{ scheme: "file" },
{ scheme: "untitled" },
{ scheme: "vscode-notebook-cell" }
],
outputChannelName: "[pygls] JsonLanguageServer",
synchronize: {
// Notify the server about file changes to '.clientrc files contain in the workspace
fileEvents: workspace.createFileSystemWatcher("**/.clientrc"),
},
};
} However to quote the LSP spec
This obviously won't be a viable long term solution 😅 but perhaps useful if you want to start playing around with notebooks and are waiting for |
This is what I use with The limitation is when we need to see notebook as a whole document. Like when using linting, we may have to provide a merged document to the linter containing only the python cell contents. Or in cases where the linter can handle notebook itself. |
Trust me to spot the non-hacky way to do it immediately after! 😅 - ask for the language you're interested in and not the scheme!
Also posting this here for future me (and anyone else who's interested) to refer to. To quote the spec
It sounds like there are 2 levels of sync available - a "high level" and a "low level" api if you like. What's missing is the "higher level" API were we can process groups of cells as complete notebooks! |
In notebook scenario, each cell is treated as a notebook. With events handing add, remove, move, change of each cell as notebook events. And the content changes as document events.
The text was updated successfully, but these errors were encountered: