(
workspaceRoot: string,
shouldDebounceOpenFile: boolean,
readonly logger: ILogger | undefined,
readonly compilerOptions: ts.CompilerOptions | undefined,
)
| 116 | private pendingFilesToOpen: PendingFileToOpen[] = []; |
| 117 | private scheduleFlushOpenQueuedFiles: () => void; |
| 118 | |
| 119 | constructor( |
| 120 | workspaceRoot: string, |
| 121 | shouldDebounceOpenFile: boolean, |
| 122 | readonly logger: ILogger | undefined, |
| 123 | readonly compilerOptions: ts.CompilerOptions | undefined, |
| 124 | readonly nativeApiMinVersion: number | undefined, |
| 125 | ) { |
| 126 | this.workspaceRoot = workspaceRoot; |
| 127 | const project = new Project(workspaceRoot, compilerOptions, logger ? new ProjectListener(logger) : undefined); |
| 128 | this.project = project; |
| 129 | this.importPathResolver = new ImportPathResolver(() => project.compilerOptions); |
| 130 | |
| 131 | const flushOpenQueuedFiles = () => { |
| 132 | this.openQueuedFiles(); |
| 133 | }; |
| 134 | if (shouldDebounceOpenFile) { |
| 135 | this.scheduleFlushOpenQueuedFiles = debounce(flushOpenQueuedFiles, 20, { trailing: true }); |
| 136 | } else { |
| 137 | this.scheduleFlushOpenQueuedFiles = flushOpenQueuedFiles; |
| 138 | } |
| 139 | } |
| 140 |
nothing calls this directly
no test coverage detected