MCPcopy Create free account
hub / github.com/nodejs/node / watchFailedLookupLocationOfResolution

Function watchFailedLookupLocationOfResolution

test/fixtures/snapshot/typescript.js:121616–121648  ·  view source on GitHub ↗
(resolution)

Source from the content-addressed store, hash-verified

121614 (resolution.files || (resolution.files = [])).push(filePath);
121615 }
121616 function watchFailedLookupLocationOfResolution(resolution) {
121617 ts.Debug.assert(!!resolution.refCount);
121618 var failedLookupLocations = resolution.failedLookupLocations;
121619 if (!failedLookupLocations.length)
121620 return;
121621 resolutionsWithFailedLookups.push(resolution);
121622 var setAtRoot = false;
121623 for (var _i = 0, failedLookupLocations_1 = failedLookupLocations; _i < failedLookupLocations_1.length; _i++) {
121624 var failedLookupLocation = failedLookupLocations_1[_i];
121625 var failedLookupLocationPath = resolutionHost.toPath(failedLookupLocation);
121626 var toWatch = getDirectoryToWatchFailedLookupLocation(failedLookupLocation, failedLookupLocationPath);
121627 if (toWatch) {
121628 var dir = toWatch.dir, dirPath = toWatch.dirPath, nonRecursive = toWatch.nonRecursive;
121629 // If the failed lookup location path is not one of the supported extensions,
121630 // store it in the custom path
121631 if (!isPathWithDefaultFailedLookupExtension(failedLookupLocationPath)) {
121632 var refCount = customFailedLookupPaths.get(failedLookupLocationPath) || 0;
121633 customFailedLookupPaths.set(failedLookupLocationPath, refCount + 1);
121634 }
121635 if (dirPath === rootPath) {
121636 ts.Debug.assert(!nonRecursive);
121637 setAtRoot = true;
121638 }
121639 else {
121640 setDirectoryWatcher(dir, dirPath, nonRecursive);
121641 }
121642 }
121643 }
121644 if (setAtRoot) {
121645 // This is always non recursive
121646 setDirectoryWatcher(rootDir, rootPath, /*nonRecursive*/ true); // TODO: GH#18217
121647 }
121648 }
121649 function watchFailedLookupLocationOfNonRelativeModuleResolutions(resolutions, name) {
121650 var program = resolutionHost.getCurrentProgram();
121651 if (!program || !program.getTypeChecker().tryFindAmbientModuleWithoutAugmentations(name)) {

Calls 7

setDirectoryWatcherFunction · 0.85
assertMethod · 0.80
getMethod · 0.65
pushMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected