Closed alcarney closed 12 months ago
This is probably good enough to merge now, I expect the best way to get some feedback is to get this out there in a release so people can try it out
Any thoughts?
Let's merge this then? Would be good to get the confirmation from Karthik, but sounds like you're happy Alex?
but sounds like you're happy Alex?
Yes :)
Description (e.g. "Related to ...", etc.)
This is a first pass at implementing support for the
notebookDocument/did*
group of messages from the LSP spec.This PR depends on a future version of
lsprotocol
that has some additional fixes (see microsoft/lsprotocol#228, microsoft/lsprotocol#259)Servers can advertise support for notebooks by passing an instance of
NotebookDocumentSyncOptions
to theLanguageServer
constructor. e.g. from theinlay_hints.py
serverNotebooks as a whole are represented using instances of the
NotebookDocument
class that comes fromlsprotocol
Like regular text documents, notebook cell contents are represented as instances of
pygls.workspace.TextDocument
(previously calledDocument
)Notebooks can be accessed from the
Workspace
using the newworkspace.get_notebook_document()
method eithernotebook_uri
of the notebook itself orcell_uri
of one of the text documents representing the contents of a cell in the notebookCurrently this is the only notebook specific method exposed to server authors - @karthiknadig let me know if you have anything specific you'd like
pygls
to handle/provideGeneric references to "document" have been renamed to "text_document" so that it's clear which kind of document a method/object is referring to. Old names still work, but emit deprecation warnings where possible - see https://github.com/openlawlibrary/pygls/pull/356/commits/9034bdbd6fd28d9b79ba778cfa65a49595590cb9
The example
inlays_hints.py
server has been updated to support notebooks.#
characters on a line on their own are annotated with the notebook's uri and index of the cell it resides in - let me know if you can think of a more interesting demonstration of the notebook support! :sweat_smile:Closes #311
Code review checklist (for code reviewer to complete)