Class: VscodeTextDocumentImpl
ide/vscode/VscodeTextDocumentImpl.VscodeTextDocumentImpl
Implements
Constructors
constructor
• new VscodeTextDocumentImpl(document)
Parameters
| Name | Type |
|---|---|
document | TextDocument |
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
Defined in
ide/vscode/VscodeTextDocumentImpl.ts:16
lineCount
• get lineCount(): number
The number of lines in this document.
Returns
number
Implementation of
Defined in
ide/vscode/VscodeTextDocumentImpl.ts:24
range
• get range(): Range
The range of the text document.
Returns
Implementation of
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
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
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
| Name | Type |
|---|---|
range? | Range |
Returns
string
Implementation of
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
| Name | Type |
|---|---|
lineOrPosition | number | Position |
Returns
Implementation of
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
| Name | Type |
|---|---|
position | Position |
Returns
number
Implementation of
Defined in
ide/vscode/VscodeTextDocumentImpl.ts:45
positionAt
▸ positionAt(offset): Position
Converts a zero-based offset to a position.
Parameters
| Name | Type |
|---|---|
offset | number |
Returns
Implementation of
Defined in
ide/vscode/VscodeTextDocumentImpl.ts:49