TextDocumentManager

Helper struct which should have one unique instance in the application which processes document events sent by a LSP client to an LSP server and creates an in-memory representation of all the files managed by the client.

Members

Functions

loadFromFilesystem
Document loadFromFilesystem(string uri)

Tries to load a given URI manually without having it received via LSP methods. Note that a LSP close method will unload this early.

opIndex
Document opIndex(string uri)

Same as tryGet but throws an exception if the URI doesn't exist.

process
bool process(RequestMessage msg)

Processes an LSP packet and performs the document update in-memory that is requested.

tryGet
Document tryGet(string uri)

Tries to get a document from a URI, returns Document.init if it is not in the in-memory cache / not sent by the client.

unloadDocument
bool unloadDocument(string uri)

Unloads the given URI so it's no longer accessible. Note that this should only be done for documents loaded manually and never for LSP documents as it will break all features in that file until reopened.

Static functions

syncKind
TextDocumentSyncKind syncKind()

Returns the currently preferred syncKind to use with the client. Additionally always supports the full sync kind.

Variables

documentStore
Document[] documentStore;

Internal document storage. Only iterate over this using foreach, other operations are not considered officially supported.

Meta