MCPcopy Index your code
hub / github.com/nodejs/node / createProgramHost

Function createProgramHost

test/fixtures/snapshot/typescript.js:123193–123216  ·  view source on GitHub ↗

* Creates the watch compiler host that can be extended with config file or root file names and options host

(system, createProgram)

Source from the content-addressed store, hash-verified

123191 * Creates the watch compiler host that can be extended with config file or root file names and options host
123192 */
123193 function createProgramHost(system, createProgram) {
123194 var getDefaultLibLocation = ts.memoize(function () { return ts.getDirectoryPath(ts.normalizePath(system.getExecutingFilePath())); });
123195 return {
123196 useCaseSensitiveFileNames: function () { return system.useCaseSensitiveFileNames; },
123197 getNewLine: function () { return system.newLine; },
123198 getCurrentDirectory: ts.memoize(function () { return system.getCurrentDirectory(); }),
123199 getDefaultLibLocation: getDefaultLibLocation,
123200 getDefaultLibFileName: function (options) { return ts.combinePaths(getDefaultLibLocation(), ts.getDefaultLibFileName(options)); },
123201 fileExists: function (path) { return system.fileExists(path); },
123202 readFile: function (path, encoding) { return system.readFile(path, encoding); },
123203 directoryExists: function (path) { return system.directoryExists(path); },
123204 getDirectories: function (path) { return system.getDirectories(path); },
123205 readDirectory: function (path, extensions, exclude, include, depth) { return system.readDirectory(path, extensions, exclude, include, depth); },
123206 realpath: ts.maybeBind(system, system.realpath),
123207 getEnvironmentVariable: ts.maybeBind(system, system.getEnvironmentVariable),
123208 trace: function (s) { return system.write(s + system.newLine); },
123209 createDirectory: function (path) { return system.createDirectory(path); },
123210 writeFile: function (path, data, writeByteOrderMark) { return system.writeFile(path, data, writeByteOrderMark); },
123211 createHash: ts.maybeBind(system, system.createHash),
123212 createProgram: createProgram || ts.createEmitAndSemanticDiagnosticsBuilderProgram,
123213 disableUseFileVersionAsSignature: system.disableUseFileVersionAsSignature,
123214 storeFilesChangingSignatureDuringEmit: system.storeFilesChangingSignatureDuringEmit,
123215 };
123216 }
123217 ts.createProgramHost = createProgramHost;
123218 /**
123219 * Creates the watch compiler host that can be extended with config file or root file names and options host

Callers 1

createWatchCompilerHostFunction · 0.85

Calls 4

getDefaultLibLocationFunction · 0.85
readFileMethod · 0.45
writeMethod · 0.45
writeFileMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…