|
Asper Header
1.0.14
The header injector extension
|
Mock implementation of VS Code TextDocument for testing purposes. More...


Public Member Functions | |
| constructor (filePath:string, content:string='', languageId:string='typescript', eol:vscode.EndOfLine=vscode.EndOfLine.LF, isClosed:boolean=false) | |
| Creates a new mock text document with specified configuration. | |
Data Fields | |
| lines | : MockDocumentLine[] = [] |
| Array of document lines with metadata. | |
| uri | : vscode.Uri |
| File URI for the mock document. | |
| languageId | : string |
| Language identifier for syntax highlighting. | |
| eol | : vscode.EndOfLine |
| End-of-line character sequence type. | |
| version | : number |
| Document version number for change tracking. | |
| isClosed | : boolean |
| Whether the document is closed. | |
| lineCount | : number = 0 |
| Total number of lines in the document. | |
| fileName | : string = '' |
| Base filename without path. | |
| isUntitled | : boolean = false |
| Whether this is an untitled document. | |
| encoding | : string = 'utf8' |
| Document encoding format. | |
| isDirty | : boolean = false |
| Whether the document has unsaved changes. | |
Mock implementation of VS Code TextDocument for testing purposes.
Provides a comprehensive mock of the VS Code TextDocument interface, enabling isolated testing of document manipulation operations without requiring actual VS Code environment. Supports all essential TextDocument operations including line access, text retrieval, and position calculations.
Key Features:
Definition at line 69 of file commentGenerator.test.ts.
|
inline |
Creates a new mock text document with specified configuration.
| filePath | Absolute file path for the document URI |
| content | Initial text content (defaults to empty string) |
| languageId | Language identifier (defaults to 'typescript') |
| eol | End-of-line character type (defaults to LF) |
| isClosed | Whether document starts in closed state |
Initializes a fully functional mock document that can be used for testing text operations, header injection, and file manipulation without requiring actual VS Code document instances.
Definition at line 105 of file commentGenerator.test.ts.
| lines MockTextDocument::__pad0__ |
Array of document lines with metadata.
Definition at line 71 of file commentGenerator.test.ts.
| isDirty MockTextDocument::__pad10__ |
Whether the document has unsaved changes.
Definition at line 91 of file commentGenerator.test.ts.
| uri MockTextDocument::__pad1__ |
File URI for the mock document.
Definition at line 73 of file commentGenerator.test.ts.
| languageId MockTextDocument::__pad2__ |
Language identifier for syntax highlighting.
Definition at line 75 of file commentGenerator.test.ts.
| eol MockTextDocument::__pad3__ |
End-of-line character sequence type.
Definition at line 77 of file commentGenerator.test.ts.
| version MockTextDocument::__pad4__ |
Document version number for change tracking.
Definition at line 79 of file commentGenerator.test.ts.
| isClosed MockTextDocument::__pad5__ |
Whether the document is closed.
Definition at line 81 of file commentGenerator.test.ts.
| lineCount MockTextDocument::__pad6__ |
Total number of lines in the document.
Definition at line 83 of file commentGenerator.test.ts.
| fileName MockTextDocument::__pad7__ |
Base filename without path.
Definition at line 85 of file commentGenerator.test.ts.
| isUntitled MockTextDocument::__pad8__ |
Whether this is an untitled document.
Definition at line 87 of file commentGenerator.test.ts.
| encoding MockTextDocument::__pad9__ |
Document encoding format.
Definition at line 89 of file commentGenerator.test.ts.