TextDocuments
- class TextDocuments
A thread-safe registry for
TextDocuments.Members defined in
TextDocuments(14 members)
Update contents of the text document at
url.
Remove a document at
urlfrom this registry.
Create
TextDocumentsfor multi-threaded applications
Create
TextDocumentsfor single-threaded applications
Find an existing document, or open a new one if either url does not exist, or an existing document has a different language.
Move document from
srctodst.
Open a new text document.
Signal that document at
urlhas been saved.
Visit all text documents in the registry.
Visit all text documents in the registry.
Visit all reachable urls in the registry.
Signal that document at
urlwill be saved.
Signal that document at
urlhas been saved and wait until corresponding handler completes. Methods
- __getitem__(url: syside.Url) syside.SharedMutex[syside.TextDocument]
- change_content(url: syside.Url, changes: Sequence[syside.TextDocumentEditUtf8], version: int | None = None) None
Update contents of the text document at
url.
- close(url: syside.Url) syside.SharedMutex[syside.TextDocument] | None
Remove a document at
urlfrom this registry.
- static create_mt() syside.TextDocuments
Create
TextDocumentsfor multi-threaded applications
- static create_st() syside.TextDocuments
Create
TextDocumentsfor single-threaded applications
- find_or_open(url: syside.Url, language: str, data: Callable[[], syside.PartialTextDocumentData]) tuple[syside.SharedMutex[syside.TextDocument], bool]
Find an existing document, or open a new one if either url does not exist, or an existing document has a different language.
The second return value is only
Trueif a new document was opened, andFalseif an existing document was found.
- move(src: syside.Url, dst: syside.Url) syside.SharedMutex[syside.TextDocument] | None
Move document from
srctodst.If
srcexists, steals its contents and creates a new document atdstand returns the new document. Note that any references to the old document atsrcwill not be updated todst.This overwrites existing document at
dstifsrcexits.
- open(url: syside.Url, language: str, content: str, version: int = 0) syside.SharedMutex[syside.TextDocument]
Open a new text document.
This overwrites any text document already at
url.
- open(arg: syside.TextDocumentData, /) syside.SharedMutex[syside.TextDocument]
- save(url: syside.Url) None
Signal that document at
urlhas been saved.
- visit(visitor: Callable[[syside.Url, syside.SharedMutex[syside.TextDocument]], None]) None
Visit all text documents in the registry.
- visit_documents(visitor: Callable[[syside.SharedMutex[syside.TextDocument]], None]) None
Visit all text documents in the registry.
- visit_urls(visitor: Callable[[syside.Url], None]) None
Visit all reachable urls in the registry.
- will_save(url: syside.Url, reason: syside.TextDocumentSaveReason) None
Signal that document at
urlwill be saved.
- will_save_wait_until(url: syside.Url, reason: syside.TextDocumentSaveReason) list[syside.TextEdit]
Signal that document at
urlhas been saved and wait until corresponding handler completes.