Workspace
Tracks the set of open files for an LSPClient and synchronizes their contents with the language server.
Mirrors upstream @codemirror/lsp-client's Workspace. Files are registered via openFile (which sends textDocument/didOpen) and removed via closeFile (which sends textDocument/didClose). Editor changes are recorded with updateFile and later flushed with syncFiles / LSPClient.sync, honoring the server's negotiated DocumentSyncMode.
Parameters
The owning LSPClient.
Properties
Functions
Remove a file from the workspace. Synchronous so it can run from a plugin's destroy; the textDocument/didClose notification is sent separately by didCloseFile.
Send the textDocument/didClose notification for uri, if the server's sync capability advertises open/close notifications (DocumentSyncMode.openClose).
Send the textDocument/didOpen notification for uri, if it is open and the server's sync capability advertises open/close notifications (DocumentSyncMode.openClose).
Surface the file at uri to the user and return the editor session showing it, or null when this is not possible.
Look up a tracked file by its URI.
Obtain a live WorkspaceMapping for uri that tracks edits applied after this call, or null if no such file is open. A feature that issues an LSP request should capture a mapping when it sends the request and use it to remap the response's positions; call releaseMapping when done.
Register a file as open in the workspace, snapshotting its current text as the version-1 baseline. Synchronous so it can run from a plugin's constructor; the textDocument/didOpen notification is sent separately by didOpenFile once the server handshake has completed.
Release a mapping previously obtained from getMapping.
Take all pending file updates, advancing each file's version/doc. Returns the updates that should be sent to the server as textDocument/didChange.