Skip to main content

Class: VscodeTextDocumentImpl

ide/vscode/VscodeTextDocumentImpl.VscodeTextDocumentImpl

Implements

Constructors

constructor

new VscodeTextDocumentImpl(document)

Parameters

NameType
documentTextDocument

Defined in

ide/vscode/VscodeTextDocumentImpl.ts:33

Accessors

languageId

get languageId(): string

The identifier of the language associated with this document.

Returns

string

Implementation of

TextDocument.languageId

Defined in

ide/vscode/VscodeTextDocumentImpl.ts:16


lineCount

get lineCount(): number

The number of lines in this document.

Returns

number

Implementation of

TextDocument.lineCount

Defined in

ide/vscode/VscodeTextDocumentImpl.ts:24


range

get range(): Range

The range of the text document.

Returns

Range

Implementation of

TextDocument.range

Defined in

ide/vscode/VscodeTextDocumentImpl.ts:28


uri

get uri(): URI

The associated uri for this document.

Note that most documents use the file-scheme, which means they are files on disk. However, not all documents are saved on disk and therefore the scheme must be checked before trying to access the underlying file or siblings on disk.

Returns

URI

Implementation of

TextDocument.uri

Defined in

ide/vscode/VscodeTextDocumentImpl.ts:12


version

get version(): number

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

Returns

number

Implementation of

TextDocument.version

Defined in

ide/vscode/VscodeTextDocumentImpl.ts:20

Methods

getText

getText(range?): string

Get the text of this document. A substring can be retrieved by providing a range.

The range will be adjusted if it extends outside TextDocument.range.

Parameters

NameType
range?Range

Returns

string

Implementation of

TextDocument.getText

Defined in

ide/vscode/VscodeTextDocumentImpl.ts:53


lineAt

lineAt(lineOrPosition): TextLine

Returns a text line denoted by the line number. Note that the returned object is not live and changes to the document are not reflected.

Parameters

NameType
lineOrPositionnumber | Position

Returns

TextLine

Implementation of

TextDocument.lineAt

Defined in

ide/vscode/VscodeTextDocumentImpl.ts:35


offsetAt

offsetAt(position): number

Converts the position to a zero-based offset.

The position will be adjusted if it is outside range.

Parameters

NameType
positionPosition

Returns

number

Implementation of

TextDocument.offsetAt

Defined in

ide/vscode/VscodeTextDocumentImpl.ts:45


positionAt

positionAt(offset): Position

Converts a zero-based offset to a position.

Parameters

NameType
offsetnumber

Returns

Position

Implementation of

TextDocument.positionAt

Defined in

ide/vscode/VscodeTextDocumentImpl.ts:49