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

Function parseProjectReferenceConfigFile

test/fixtures/snapshot/typescript.js:118631–118676  ·  view source on GitHub ↗
(ref)

Source from the content-addressed store, hash-verified

118629 return allFilesBelongToPath;
118630 }
118631 function parseProjectReferenceConfigFile(ref) {
118632 if (!projectReferenceRedirects) {
118633 projectReferenceRedirects = new ts.Map();
118634 }
118635 // The actual filename (i.e. add "/tsconfig.json" if necessary)
118636 var refPath = resolveProjectReferencePath(ref);
118637 var sourceFilePath = toPath(refPath);
118638 var fromCache = projectReferenceRedirects.get(sourceFilePath);
118639 if (fromCache !== undefined) {
118640 return fromCache || undefined;
118641 }
118642 var commandLine;
118643 var sourceFile;
118644 if (host.getParsedCommandLine) {
118645 commandLine = host.getParsedCommandLine(refPath);
118646 if (!commandLine) {
118647 addFileToFilesByName(/*sourceFile*/ undefined, sourceFilePath, /*redirectedPath*/ undefined);
118648 projectReferenceRedirects.set(sourceFilePath, false);
118649 return undefined;
118650 }
118651 sourceFile = ts.Debug.checkDefined(commandLine.options.configFile);
118652 ts.Debug.assert(!sourceFile.path || sourceFile.path === sourceFilePath);
118653 addFileToFilesByName(sourceFile, sourceFilePath, /*redirectedPath*/ undefined);
118654 }
118655 else {
118656 // An absolute path pointing to the containing directory of the config file
118657 var basePath = ts.getNormalizedAbsolutePath(ts.getDirectoryPath(refPath), host.getCurrentDirectory());
118658 sourceFile = host.getSourceFile(refPath, 100 /* ScriptTarget.JSON */);
118659 addFileToFilesByName(sourceFile, sourceFilePath, /*redirectedPath*/ undefined);
118660 if (sourceFile === undefined) {
118661 projectReferenceRedirects.set(sourceFilePath, false);
118662 return undefined;
118663 }
118664 commandLine = ts.parseJsonSourceFileConfigFileContent(sourceFile, configParsingHost, basePath, /*existingOptions*/ undefined, refPath);
118665 }
118666 sourceFile.fileName = refPath;
118667 sourceFile.path = sourceFilePath;
118668 sourceFile.resolvedPath = sourceFilePath;
118669 sourceFile.originalFileName = refPath;
118670 var resolvedRef = { commandLine: commandLine, sourceFile: sourceFile };
118671 projectReferenceRedirects.set(sourceFilePath, resolvedRef);
118672 if (commandLine.projectReferences) {
118673 resolvedRef.references = commandLine.projectReferences.map(parseProjectReferenceConfigFile);
118674 }
118675 return resolvedRef;
118676 }
118677 function verifyCompilerOptions() {
118678 if (options.strictPropertyInitialization && !ts.getStrictOptionValue(options, "strictNullChecks")) {
118679 createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "strictPropertyInitialization", "strictNullChecks");

Callers 1

Calls 7

toPathFunction · 0.85
addFileToFilesByNameFunction · 0.85
assertMethod · 0.80
getMethod · 0.65
mapMethod · 0.65
setMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…