MCPcopy Create free account
hub / github.com/Snapchat/Valdi / constructor

Method constructor

compiler/companion/src/Workspace.ts:118–137  ·  view source on GitHub ↗
(
    workspaceRoot: string,
    shouldDebounceOpenFile: boolean,
    readonly logger: ILogger | undefined,
    readonly compilerOptions: ts.CompilerOptions | undefined,
  )

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

debounceFunction · 0.50

Tested by

no test coverage detected