BasicDocument

class BasicDocument

The base type of all documents corresponding to a single source file.

Children
Members defined in BasicDocument (11 members)

build_state

RW

The current build state of this document.

document_state

R

The current state of this document inside a pipeline.

document_tier

R

The tier of this document.

language

R

Language identifier of this document

mutex

R

Retrieve the mutex associated with this document

text_document

RW

The source text document associated with this document.

url

RW

Location of this document.

version

R

The version of the last build.

__hash__

Identity based hash of this document.

change_document_tier

Set document_tier to another value.

increment_version

Increment sema version.

Attributes

property build_state: syside.BuildState

The current build state of this document.

This is typically used by the pipeline to select and execute appropriate phases.

property document_state: syside.DocumentState

The current state of this document inside a pipeline.

This is automatically updated by the pipeline and allows monitoring its state from worker threads.

property document_tier: syside.DocumentTier

The tier of this document.

This is used internally to optimize certain operations, especially on standard library documents.

property language: str

Language identifier of this document

property mutex: syside.SharedMutex[Self]

Retrieve the mutex associated with this document

property text_document: syside.SharedMutex[syside.TextDocument] | None

The source text document associated with this document.

property url: syside.Url

Location of this document.

Url is used for compatibility with LSP. Typically, local files will have absolute file:///path/to/source.ext urls.

property version: syside.DocumentVersion

The version of the last build.

This corresponds to the version of TextDocument this was built from.

Methods

__hash__() int

Identity based hash of this document.

This is guaranteed to be unique or nearly unique globally (due to bit mixing). However, it is not stable across Python invocations.

change_document_tier(arg: syside.DocumentTier, /) None

Set document_tier to another value.

This is a method rather than a function because tier should not change throughout document lifetime. Nevertheless, this is still useful in cases where a document has just been constructed and its attributes need to be changed.

increment_version() None

Increment sema version.

Source version is automatically handled by source parser.

Used in