Skip to main content

Interface: TextDocument

Defined in: packages/cspell-lib/src/lib/Models/TextDocument.ts:56

A simple text document. Not to be implemented. The document keeps the content as string.

Properties

languageId

readonly languageId: string | string[]

Defined in: packages/cspell-lib/src/lib/Models/TextDocument.ts:66

The identifier of the language associated with this document.


locale?

readonly optional locale: string

Defined in: packages/cspell-lib/src/lib/Models/TextDocument.ts:80

The natural language locale.


text

readonly text: string

Defined in: packages/cspell-lib/src/lib/Models/TextDocument.ts:75

the raw Document Text


uri

readonly uri: DocumentUri

Defined in: packages/cspell-lib/src/lib/Models/TextDocument.ts:62

The associated URI for this document. Most documents have the file-scheme, indicating that they represent files on disk. However, some documents may have other schemes indicating that they are not available on disk.


version

readonly version: number

Defined in: packages/cspell-lib/src/lib/Models/TextDocument.ts:71

The version number of this document (it will increase after each change, including undo/redo).

Methods

getLine()

getLine(lineNum): TextDocumentLine

Defined in: packages/cspell-lib/src/lib/Models/TextDocument.ts:85

Parameters

lineNum

number

Returns

TextDocumentLine


getLines()

getLines(): Iterable<TextDocumentLine>

Defined in: packages/cspell-lib/src/lib/Models/TextDocument.ts:86

Returns

Iterable<TextDocumentLine>


lineAt()

lineAt(offset): TextDocumentLine

Defined in: packages/cspell-lib/src/lib/Models/TextDocument.ts:84

Parameters

offset

number

Returns

TextDocumentLine


offsetAt()

offsetAt(position): number

Defined in: packages/cspell-lib/src/lib/Models/TextDocument.ts:83

Parameters

position

Position

Returns

number


positionAt()

positionAt(offset): Position

Defined in: packages/cspell-lib/src/lib/Models/TextDocument.ts:82

Parameters

offset

number

Returns

Position