mirror of
https://github.com/microsoft/language-server-protocol.git
synced 2025-12-23 08:48:16 +00:00
Clarify that notebook cell documents are always synchronized incrementally
This commit is contained in:
parent
d33a03cbf1
commit
e47cdddc79
2 changed files with 2 additions and 14 deletions
|
|
@ -234,7 +234,7 @@ The protocol will therefore support two modes when it comes to synchronizing cel
|
|||
* _cellContent_: in this mode only the cell text content is synchronized to the server using the standard `textDocument/did*` notification. No notebook document and no cell structure is synchronized. This mode allows for easy adoption of notebooks since servers can reuse most of it implementation logic.
|
||||
* _notebook_: in this mode the notebook document, the notebook cells and the notebook cell text content is synchronized to the server. To allow servers to create a consistent picture of a notebook document the cell text content is NOT synchronized using the standard `textDocument/did*` notifications. It is instead synchronized using special `notebookDocument/did*` notifications. This ensures that the cell and its text content arrives on the server using one open, change or close event.
|
||||
|
||||
In both modes, notebook cell text documents are treated as regular text documents. Therefore, they use the same synchronization mechanism as specified by the server's `textDocumentSync` capability. For the _notebook_ mode, the cell text content changes sent via `notebookDocument/didChange` follow the same full/incremental change format as `textDocument/didChange`, respecting the `TextDocumentSyncKind` specified in `textDocumentSync.change`.
|
||||
In both modes, notebook cell text documents are treated as regular text documents. They are always synchronized using incremental sync.
|
||||
|
||||
To request the cell content only a normal document selector can be used. For example the selector `[{ language: 'python' }]` will synchronize Python notebook document cells to the server. However since this might synchronize unwanted documents as well a document filter can also be a `NotebookCellTextDocumentFilter`. So `{ notebook: { scheme: 'file', notebookType: 'jupyter-notebook' }, language: 'python' }` synchronizes all Python cells in a Jupyter notebook stored on disk.
|
||||
|
||||
|
|
@ -507,12 +507,6 @@ export interface NotebookDocumentChangeEvent {
|
|||
|
||||
/**
|
||||
* Changes to the text content of notebook cells.
|
||||
*
|
||||
* Cell text content changes follow the same synchronization mode
|
||||
* as specified by the server's `textDocumentSync.change` capability.
|
||||
* If `textDocumentSync.change` is `TextDocumentSyncKind.Incremental`,
|
||||
* clients should send incremental updates. If it is
|
||||
* `TextDocumentSyncKind.Full`, clients must send the full content.
|
||||
*/
|
||||
textContent?: {
|
||||
document: VersionedTextDocumentIdentifier;
|
||||
|
|
|
|||
|
|
@ -252,7 +252,7 @@ The protocol will therefore support two modes when it comes to synchronizing cel
|
|||
* _cellContent_: in this mode, only the cell text content is synchronized to the server using the standard `textDocument/did*` notification. No notebook document and no cell structure is synchronized. This mode allows for easy adoption of notebooks since servers can reuse most of their implementation logic.
|
||||
* _notebook_: in this mode the notebook document, the notebook cells and the notebook cell text content is synchronized to the server. To allow servers to create a consistent picture of a notebook document, the cell text content is NOT synchronized using the standard `textDocument/did*` notifications. It is instead synchronized using special `notebookDocument/did*` notifications. This ensures that the cell and its text content arrive on the server using one open, change or close event.
|
||||
|
||||
In both modes, notebook cell text documents are treated as regular text documents. Therefore, they use the same synchronization mechanism as specified by the server's `textDocumentSync` capability. For the _notebook_ mode, the cell text content changes sent via `notebookDocument/didChange` follow the same full/incremental change format as `textDocument/didChange`, respecting the `TextDocumentSyncKind` specified in `textDocumentSync.change`.
|
||||
In both modes, notebook cell text documents are treated as regular text documents. They are always synchronized using incremental sync.
|
||||
|
||||
To request the cell content, only a normal document selector can be used. For example, the selector `[{ language: 'python' }]` will synchronize Python notebook document cells to the server. However, since this might synchronize unwanted documents as well, a document filter can also be a `NotebookCellTextDocumentFilter`. So `{ notebook: { scheme: 'file', notebookType: 'jupyter-notebook' }, language: 'python' }` synchronizes all Python cells in a Jupyter notebook stored on disk.
|
||||
|
||||
|
|
@ -525,12 +525,6 @@ export interface NotebookDocumentChangeEvent {
|
|||
|
||||
/**
|
||||
* Changes to the text content of notebook cells.
|
||||
*
|
||||
* Cell text content changes follow the same synchronization mode
|
||||
* as specified by the server's `textDocumentSync.change` capability.
|
||||
* If `textDocumentSync.change` is `TextDocumentSyncKind.Incremental`,
|
||||
* clients should send incremental updates. If it is
|
||||
* `TextDocumentSyncKind.Full`, clients must send the full content.
|
||||
*/
|
||||
textContent?: {
|
||||
document: VersionedTextDocumentIdentifier;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue