[I] ServerSourceFile
Compiler source file that may have been read from an open editor document instead of disk.
Extends
Section titled âExtendsâProperties
Section titled âPropertiesâ| Property | Modifier | Type | Description | Inherited from |
|---|---|---|---|---|
document? | readonly | TextDocument | Open document associated with this file when it was read; absent for files read from disk. | - |
path | readonly | string | The source file path. This is used only for diagnostics. The command line compiler will populate it with the actual path from which the file was read, but it can actually be an arbitrary name for other scenarios. | SourceFile.path |
text | readonly | string | The source code text. | SourceFile.text |
Methods
Section titled âMethodsâgetLineAndCharacterOfPosition()
Section titled âgetLineAndCharacterOfPosition()âgetLineAndCharacterOfPosition(position): LineAndCharacter;Converts a one-dimensional position in the document (measured in UTF-16 code units) to line number and offset from line start.
Parameters
Section titled âParametersâ| Parameter | Type |
|---|---|
position | number |
Returns
Section titled âReturnsâInherited from
Section titled âInherited fromâSourceFile.getLineAndCharacterOfPosition
getLineStarts()
Section titled âgetLineStarts()âgetLineStarts(): readonly number[];Array of positions in the text where each line begins. There is one entry per line, in order of lines, and each entry represents the offset in UTF-16 code units from the start of the document to the beginning of the line.
Returns
Section titled âReturnsâreadonly number[]