typescript 4.7.0-dev.20220418 → 4.7.0-dev.20220421
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/tsc.js +93 -75
- package/lib/tsserver.js +117 -92
- package/lib/tsserverlibrary.js +117 -92
- package/lib/typescript.js +117 -92
- package/lib/typescriptServices.js +117 -92
- package/lib/typingsInstaller.js +117 -92
- package/package.json +1 -1
package/lib/tsserver.js
CHANGED
|
@@ -100,7 +100,7 @@ var ts;
|
|
|
100
100
|
// The following is baselined as a literal template type without intervention
|
|
101
101
|
/** The version of the TypeScript compiler release */
|
|
102
102
|
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
103
|
-
ts.version = ts.versionMajorMinor + ".0-dev.
|
|
103
|
+
ts.version = ts.versionMajorMinor + ".0-dev.20220421";
|
|
104
104
|
/* @internal */
|
|
105
105
|
var Comparison;
|
|
106
106
|
(function (Comparison) {
|
|
@@ -33186,7 +33186,8 @@ var ts;
|
|
|
33186
33186
|
var pos = getNodePos();
|
|
33187
33187
|
parseExpected(112 /* TypeOfKeyword */);
|
|
33188
33188
|
var entityName = parseEntityName(/*allowReservedWords*/ true, /*allowPrivateIdentifiers*/ true);
|
|
33189
|
-
|
|
33189
|
+
// Make sure we perform ASI to prevent parsing the next line's type arguments as part of an instantiation expression.
|
|
33190
|
+
var typeArguments = !scanner.hasPrecedingLineBreak() ? tryParseTypeArguments() : undefined;
|
|
33190
33191
|
return finishNode(factory.createTypeQueryNode(entityName, typeArguments), pos);
|
|
33191
33192
|
}
|
|
33192
33193
|
function parseTypeParameter() {
|
|
@@ -61934,11 +61935,14 @@ var ts;
|
|
|
61934
61935
|
return type[cache] = elementType;
|
|
61935
61936
|
}
|
|
61936
61937
|
}
|
|
61937
|
-
// If the object type is a mapped type { [P in K]: E }, where K is generic,
|
|
61938
|
-
//
|
|
61939
|
-
// construct the type Box<T[X]>.
|
|
61940
|
-
if (isGenericMappedType(objectType)
|
|
61941
|
-
|
|
61938
|
+
// If the object type is a mapped type { [P in K]: E }, where K is generic, or { [P in K as N]: E }, where
|
|
61939
|
+
// K is generic and N is assignable to P, instantiate E using a mapper that substitutes the index type for P.
|
|
61940
|
+
// For example, for an index access { [P in K]: Box<T[P]> }[X], we construct the type Box<T[X]>.
|
|
61941
|
+
if (isGenericMappedType(objectType)) {
|
|
61942
|
+
var nameType = getNameTypeFromMappedType(objectType);
|
|
61943
|
+
if (!nameType || isTypeAssignableTo(nameType, getTypeParameterFromMappedType(objectType))) {
|
|
61944
|
+
return type[cache] = mapType(substituteIndexedMappedType(objectType, type.indexType), function (t) { return getSimplifiedType(t, writing); });
|
|
61945
|
+
}
|
|
61942
61946
|
}
|
|
61943
61947
|
return type[cache] = type;
|
|
61944
61948
|
}
|
|
@@ -74258,10 +74262,15 @@ var ts;
|
|
|
74258
74262
|
prop = getPropertyOfType(apparentType, right.escapedText);
|
|
74259
74263
|
}
|
|
74260
74264
|
// In `Foo.Bar.Baz`, 'Foo' is not referenced if 'Bar' is a const enum or a module containing only const enums.
|
|
74265
|
+
// `Foo` is also not referenced in `enum FooCopy { Bar = Foo.Bar }`, because the enum member value gets inlined
|
|
74266
|
+
// here even if `Foo` is not a const enum.
|
|
74267
|
+
//
|
|
74261
74268
|
// The exceptions are:
|
|
74262
74269
|
// 1. if 'isolatedModules' is enabled, because the const enum value will not be inlined, and
|
|
74263
74270
|
// 2. if 'preserveConstEnums' is enabled and the expression is itself an export, e.g. `export = Foo.Bar.Baz`.
|
|
74264
|
-
if (ts.isIdentifier(left) && parentSymbol && (compilerOptions.isolatedModules ||
|
|
74271
|
+
if (ts.isIdentifier(left) && parentSymbol && (compilerOptions.isolatedModules ||
|
|
74272
|
+
!(prop && (isConstEnumOrConstEnumOnlyModule(prop) || prop.flags & 8 /* EnumMember */ && node.parent.kind === 299 /* EnumMember */)) ||
|
|
74273
|
+
ts.shouldPreserveConstEnums(compilerOptions) && isExportOrExportExpression(node))) {
|
|
74265
74274
|
markAliasReferenced(parentSymbol, node);
|
|
74266
74275
|
}
|
|
74267
74276
|
var propType;
|
|
@@ -85996,15 +86005,20 @@ var ts;
|
|
|
85996
86005
|
return propertyDeclaration;
|
|
85997
86006
|
}
|
|
85998
86007
|
}
|
|
85999
|
-
else if (ts.isMetaProperty(parent)) {
|
|
86000
|
-
|
|
86001
|
-
|
|
86002
|
-
if (propertyDeclaration) {
|
|
86003
|
-
return propertyDeclaration;
|
|
86004
|
-
}
|
|
86005
|
-
if (parent.keywordToken === 103 /* NewKeyword */) {
|
|
86008
|
+
else if (ts.isMetaProperty(parent) && parent.name === node) {
|
|
86009
|
+
if (parent.keywordToken === 103 /* NewKeyword */ && ts.idText(node) === "target") {
|
|
86010
|
+
// `target` in `new.target`
|
|
86006
86011
|
return checkNewTargetMetaProperty(parent).symbol;
|
|
86007
86012
|
}
|
|
86013
|
+
// The `meta` in `import.meta` could be given `getTypeOfNode(parent).symbol` (the `ImportMeta` interface symbol), but
|
|
86014
|
+
// we have a fake expression type made for other reasons already, whose transient `meta`
|
|
86015
|
+
// member should more exactly be the kind of (declarationless) symbol we want.
|
|
86016
|
+
// (See #44364 and #45031 for relevant implementation PRs)
|
|
86017
|
+
if (parent.keywordToken === 100 /* ImportKeyword */ && ts.idText(node) === "meta") {
|
|
86018
|
+
return getGlobalImportMetaExpressionType().members.get("meta");
|
|
86019
|
+
}
|
|
86020
|
+
// no other meta properties are valid syntax, thus no others should have symbols
|
|
86021
|
+
return undefined;
|
|
86008
86022
|
}
|
|
86009
86023
|
}
|
|
86010
86024
|
switch (node.kind) {
|
|
@@ -94682,7 +94696,7 @@ var ts;
|
|
|
94682
94696
|
}
|
|
94683
94697
|
resumeLexicalEnvironment();
|
|
94684
94698
|
var needsSyntheticConstructor = !constructor && isDerivedClass;
|
|
94685
|
-
var
|
|
94699
|
+
var indexOfFirstStatementAfterSuperAndPrologue = 0;
|
|
94686
94700
|
var prologueStatementCount = 0;
|
|
94687
94701
|
var superStatementIndex = -1;
|
|
94688
94702
|
var statements = [];
|
|
@@ -94691,8 +94705,11 @@ var ts;
|
|
|
94691
94705
|
superStatementIndex = ts.findSuperStatementIndex(constructor.body.statements, prologueStatementCount);
|
|
94692
94706
|
// If there was a super call, visit existing statements up to and including it
|
|
94693
94707
|
if (superStatementIndex >= 0) {
|
|
94694
|
-
|
|
94695
|
-
statements = __spreadArray(__spreadArray(__spreadArray([], statements.slice(0, prologueStatementCount), true), ts.visitNodes(constructor.body.statements, visitor, ts.isStatement, prologueStatementCount,
|
|
94708
|
+
indexOfFirstStatementAfterSuperAndPrologue = superStatementIndex + 1;
|
|
94709
|
+
statements = __spreadArray(__spreadArray(__spreadArray([], statements.slice(0, prologueStatementCount), true), ts.visitNodes(constructor.body.statements, visitor, ts.isStatement, prologueStatementCount, indexOfFirstStatementAfterSuperAndPrologue - prologueStatementCount), true), statements.slice(prologueStatementCount), true);
|
|
94710
|
+
}
|
|
94711
|
+
else if (prologueStatementCount >= 0) {
|
|
94712
|
+
indexOfFirstStatementAfterSuperAndPrologue = prologueStatementCount;
|
|
94696
94713
|
}
|
|
94697
94714
|
}
|
|
94698
94715
|
if (needsSyntheticConstructor) {
|
|
@@ -94728,22 +94745,20 @@ var ts;
|
|
|
94728
94745
|
}
|
|
94729
94746
|
}
|
|
94730
94747
|
if (parameterPropertyDeclarationCount > 0) {
|
|
94731
|
-
var parameterProperties = ts.visitNodes(constructor.body.statements, visitor, ts.isStatement,
|
|
94748
|
+
var parameterProperties = ts.visitNodes(constructor.body.statements, visitor, ts.isStatement, indexOfFirstStatementAfterSuperAndPrologue, parameterPropertyDeclarationCount);
|
|
94732
94749
|
// If there was a super() call found, add parameter properties immediately after it
|
|
94733
94750
|
if (superStatementIndex >= 0) {
|
|
94734
94751
|
ts.addRange(statements, parameterProperties);
|
|
94735
94752
|
}
|
|
94736
|
-
// If a synthetic super() call was added, add them just after it
|
|
94737
|
-
else if (needsSyntheticConstructor) {
|
|
94738
|
-
statements = __spreadArray(__spreadArray([
|
|
94739
|
-
statements[0]
|
|
94740
|
-
], parameterProperties, true), statements.slice(1), true);
|
|
94741
|
-
}
|
|
94742
|
-
// Since there wasn't a super() call, add them to the top of the constructor
|
|
94743
94753
|
else {
|
|
94744
|
-
|
|
94754
|
+
// Add add parameter properties to the top of the constructor after the prologue
|
|
94755
|
+
var superAndPrologueStatementCount = prologueStatementCount;
|
|
94756
|
+
// If a synthetic super() call was added, need to account for that
|
|
94757
|
+
if (needsSyntheticConstructor)
|
|
94758
|
+
superAndPrologueStatementCount++;
|
|
94759
|
+
statements = __spreadArray(__spreadArray(__spreadArray([], statements.slice(0, superAndPrologueStatementCount), true), parameterProperties, true), statements.slice(superAndPrologueStatementCount), true);
|
|
94745
94760
|
}
|
|
94746
|
-
|
|
94761
|
+
indexOfFirstStatementAfterSuperAndPrologue += parameterPropertyDeclarationCount;
|
|
94747
94762
|
}
|
|
94748
94763
|
}
|
|
94749
94764
|
}
|
|
@@ -94753,7 +94768,7 @@ var ts;
|
|
|
94753
94768
|
addPropertyOrClassStaticBlockStatements(statements, properties, receiver);
|
|
94754
94769
|
// Add existing statements after the initial prologues and super call
|
|
94755
94770
|
if (constructor) {
|
|
94756
|
-
ts.addRange(statements, ts.visitNodes(constructor.body.statements, visitBodyStatement, ts.isStatement,
|
|
94771
|
+
ts.addRange(statements, ts.visitNodes(constructor.body.statements, visitBodyStatement, ts.isStatement, indexOfFirstStatementAfterSuperAndPrologue));
|
|
94757
94772
|
}
|
|
94758
94773
|
statements = factory.mergeLexicalEnvironment(statements, endLexicalEnvironment());
|
|
94759
94774
|
return ts.setTextRange(factory.createBlock(ts.setTextRange(factory.createNodeArray(statements),
|
|
@@ -98794,7 +98809,7 @@ var ts;
|
|
|
98794
98809
|
// ```
|
|
98795
98810
|
insertCaptureThisForNodeIfNeeded(prologue, constructor);
|
|
98796
98811
|
}
|
|
98797
|
-
var body = factory.createBlock(ts.setTextRange(factory.createNodeArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], existingPrologue, true), prologue, true), (superStatementIndex <= existingPrologue.length ? ts.emptyArray : ts.visitNodes(constructor.body.statements, visitor, ts.isStatement, existingPrologue.length, superStatementIndex)), true), statements, true)),
|
|
98812
|
+
var body = factory.createBlock(ts.setTextRange(factory.createNodeArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], existingPrologue, true), prologue, true), (superStatementIndex <= existingPrologue.length ? ts.emptyArray : ts.visitNodes(constructor.body.statements, visitor, ts.isStatement, existingPrologue.length, superStatementIndex - existingPrologue.length)), true), statements, true)),
|
|
98798
98813
|
/*location*/ constructor.body.statements),
|
|
98799
98814
|
/*multiLine*/ true);
|
|
98800
98815
|
ts.setTextRange(body, constructor.body);
|
|
@@ -119770,6 +119785,18 @@ var ts;
|
|
|
119770
119785
|
}
|
|
119771
119786
|
return undefined;
|
|
119772
119787
|
}
|
|
119788
|
+
function removeDiagnosticsOfLibraryFiles(state) {
|
|
119789
|
+
if (!state.cleanedDiagnosticsOfLibFiles) {
|
|
119790
|
+
state.cleanedDiagnosticsOfLibFiles = true;
|
|
119791
|
+
var program_1 = ts.Debug.checkDefined(state.program);
|
|
119792
|
+
var options_2 = program_1.getCompilerOptions();
|
|
119793
|
+
ts.forEach(program_1.getSourceFiles(), function (f) {
|
|
119794
|
+
return program_1.isSourceFileDefaultLibrary(f) &&
|
|
119795
|
+
!ts.skipTypeChecking(f, options_2, program_1) &&
|
|
119796
|
+
removeSemanticDiagnosticsOf(state, f.resolvedPath);
|
|
119797
|
+
});
|
|
119798
|
+
}
|
|
119799
|
+
}
|
|
119773
119800
|
/**
|
|
119774
119801
|
* Handles semantic diagnostics and dts emit for affectedFile and files, that are referencing modules that export entities from affected file
|
|
119775
119802
|
* This is because even though js emit doesnt change, dts emit / type used can change resulting in need for dts emit and js change
|
|
@@ -119779,28 +119806,17 @@ var ts;
|
|
|
119779
119806
|
removeSemanticDiagnosticsOf(state, affectedFile.resolvedPath);
|
|
119780
119807
|
// If affected files is everything except default library, then nothing more to do
|
|
119781
119808
|
if (state.allFilesExcludingDefaultLibraryFile === state.affectedFiles) {
|
|
119782
|
-
|
|
119783
|
-
state.cleanedDiagnosticsOfLibFiles = true;
|
|
119784
|
-
var program_1 = ts.Debug.checkDefined(state.program);
|
|
119785
|
-
var options_2 = program_1.getCompilerOptions();
|
|
119786
|
-
ts.forEach(program_1.getSourceFiles(), function (f) {
|
|
119787
|
-
return program_1.isSourceFileDefaultLibrary(f) &&
|
|
119788
|
-
!ts.skipTypeChecking(f, options_2, program_1) &&
|
|
119789
|
-
removeSemanticDiagnosticsOf(state, f.resolvedPath);
|
|
119790
|
-
});
|
|
119791
|
-
}
|
|
119809
|
+
removeDiagnosticsOfLibraryFiles(state);
|
|
119792
119810
|
// When a change affects the global scope, all files are considered to be affected without updating their signature
|
|
119793
119811
|
// That means when affected file is handled, its signature can be out of date
|
|
119794
119812
|
// To avoid this, ensure that we update the signature for any affected file in this scenario.
|
|
119795
119813
|
ts.BuilderState.updateShapeSignature(state, ts.Debug.checkDefined(state.program), affectedFile, ts.Debug.checkDefined(state.currentAffectedFilesSignatures), cancellationToken, computeHash, state.currentAffectedFilesExportedModulesMap);
|
|
119796
119814
|
return;
|
|
119797
119815
|
}
|
|
119798
|
-
|
|
119799
|
-
|
|
119800
|
-
|
|
119801
|
-
|
|
119802
|
-
forEachReferencingModulesOfExportOfAffectedFile(state, affectedFile, function (state, path) { return handleDtsMayChangeOf(state, path, cancellationToken, computeHash, host); });
|
|
119803
|
-
}
|
|
119816
|
+
ts.Debug.assert(state.hasCalledUpdateShapeSignature.has(affectedFile.resolvedPath) || ((_a = state.currentAffectedFilesSignatures) === null || _a === void 0 ? void 0 : _a.has(affectedFile.resolvedPath)), "Signature not updated for affected file: " + affectedFile.fileName);
|
|
119817
|
+
if (state.compilerOptions.assumeChangesOnlyAffectDirectDependencies)
|
|
119818
|
+
return;
|
|
119819
|
+
handleDtsMayChangeOfReferencingExportOfAffectedFile(state, affectedFile, cancellationToken, computeHash, host);
|
|
119804
119820
|
}
|
|
119805
119821
|
/**
|
|
119806
119822
|
* Handle the dts may change, so they need to be added to pending emit if dts emit is enabled,
|
|
@@ -119842,16 +119858,41 @@ var ts;
|
|
|
119842
119858
|
var oldSignature = ts.Debug.checkDefined(state.fileInfos.get(path)).signature;
|
|
119843
119859
|
return newSignature !== oldSignature;
|
|
119844
119860
|
}
|
|
119861
|
+
function forEachKeyOfExportedModulesMap(state, filePath, fn) {
|
|
119862
|
+
// Go through exported modules from cache first
|
|
119863
|
+
var keys = state.currentAffectedFilesExportedModulesMap.getKeys(filePath);
|
|
119864
|
+
var result = keys && ts.forEachKey(keys, fn);
|
|
119865
|
+
if (result)
|
|
119866
|
+
return result;
|
|
119867
|
+
// If exported from path is not from cache and exported modules has path, all files referencing file exported from are affected
|
|
119868
|
+
keys = state.exportedModulesMap.getKeys(filePath);
|
|
119869
|
+
return keys && ts.forEachKey(keys, function (exportedFromPath) {
|
|
119870
|
+
var _a;
|
|
119871
|
+
// If the cache had an updated value, skip
|
|
119872
|
+
return !state.currentAffectedFilesExportedModulesMap.hasKey(exportedFromPath) &&
|
|
119873
|
+
!((_a = state.currentAffectedFilesExportedModulesMap.deletedKeys()) === null || _a === void 0 ? void 0 : _a.has(exportedFromPath)) ?
|
|
119874
|
+
fn(exportedFromPath) :
|
|
119875
|
+
undefined;
|
|
119876
|
+
});
|
|
119877
|
+
}
|
|
119878
|
+
function handleDtsMayChangeOfGlobalScope(state, filePath, cancellationToken, computeHash, host) {
|
|
119879
|
+
var _a;
|
|
119880
|
+
if (!((_a = state.fileInfos.get(filePath)) === null || _a === void 0 ? void 0 : _a.affectsGlobalScope))
|
|
119881
|
+
return false;
|
|
119882
|
+
// Every file needs to be handled
|
|
119883
|
+
ts.BuilderState.getAllFilesExcludingDefaultLibraryFile(state, state.program, /*firstSourceFile*/ undefined)
|
|
119884
|
+
.forEach(function (file) { return handleDtsMayChangeOf(state, file.resolvedPath, cancellationToken, computeHash, host); });
|
|
119885
|
+
removeDiagnosticsOfLibraryFiles(state);
|
|
119886
|
+
return true;
|
|
119887
|
+
}
|
|
119845
119888
|
/**
|
|
119846
|
-
* Iterate on referencing modules that export entities from affected file
|
|
119889
|
+
* Iterate on referencing modules that export entities from affected file and delete diagnostics and add pending emit
|
|
119847
119890
|
*/
|
|
119848
|
-
function
|
|
119849
|
-
var _a, _b;
|
|
119891
|
+
function handleDtsMayChangeOfReferencingExportOfAffectedFile(state, affectedFile, cancellationToken, computeHash, host) {
|
|
119850
119892
|
// If there was change in signature (dts output) for the changed file,
|
|
119851
119893
|
// then only we need to handle pending file emit
|
|
119852
|
-
if (!state.exportedModulesMap || !state.changedFilesSet.has(affectedFile.resolvedPath))
|
|
119894
|
+
if (!state.exportedModulesMap || !state.changedFilesSet.has(affectedFile.resolvedPath))
|
|
119853
119895
|
return;
|
|
119854
|
-
}
|
|
119855
119896
|
if (!isChangedSignature(state, affectedFile.resolvedPath))
|
|
119856
119897
|
return;
|
|
119857
119898
|
// Since isolated modules dont change js files, files affected by change in signature is itself
|
|
@@ -119864,7 +119905,9 @@ var ts;
|
|
|
119864
119905
|
var currentPath = queue.pop();
|
|
119865
119906
|
if (!seenFileNamesMap.has(currentPath)) {
|
|
119866
119907
|
seenFileNamesMap.set(currentPath, true);
|
|
119867
|
-
|
|
119908
|
+
if (handleDtsMayChangeOfGlobalScope(state, currentPath, cancellationToken, computeHash, host))
|
|
119909
|
+
return;
|
|
119910
|
+
handleDtsMayChangeOf(state, currentPath, cancellationToken, computeHash, host);
|
|
119868
119911
|
if (isChangedSignature(state, currentPath)) {
|
|
119869
119912
|
var currentSourceFile = ts.Debug.checkDefined(state.program).getSourceFileByPath(currentPath);
|
|
119870
119913
|
queue.push.apply(queue, ts.BuilderState.getReferencedByPaths(state, currentSourceFile.resolvedPath));
|
|
@@ -119876,56 +119919,38 @@ var ts;
|
|
|
119876
119919
|
var seenFileAndExportsOfFile = new ts.Set();
|
|
119877
119920
|
// Go through exported modules from cache first
|
|
119878
119921
|
// If exported modules has path, all files referencing file exported from are affected
|
|
119879
|
-
(
|
|
119880
|
-
|
|
119881
|
-
|
|
119882
|
-
|
|
119883
|
-
|
|
119884
|
-
|
|
119885
|
-
|
|
119886
|
-
return !state.currentAffectedFilesExportedModulesMap.hasKey(exportedFromPath) &&
|
|
119887
|
-
!((_a = state.currentAffectedFilesExportedModulesMap.deletedKeys()) === null || _a === void 0 ? void 0 : _a.has(exportedFromPath)) &&
|
|
119888
|
-
forEachFilesReferencingPath(state, exportedFromPath, seenFileAndExportsOfFile, fn);
|
|
119922
|
+
forEachKeyOfExportedModulesMap(state, affectedFile.resolvedPath, function (exportedFromPath) {
|
|
119923
|
+
if (handleDtsMayChangeOfGlobalScope(state, exportedFromPath, cancellationToken, computeHash, host))
|
|
119924
|
+
return true;
|
|
119925
|
+
var references = state.referencedMap.getKeys(exportedFromPath);
|
|
119926
|
+
return references && ts.forEachKey(references, function (filePath) {
|
|
119927
|
+
return handleDtsMayChangeOfFileAndExportsOfFile(state, filePath, seenFileAndExportsOfFile, cancellationToken, computeHash, host);
|
|
119928
|
+
});
|
|
119889
119929
|
});
|
|
119890
119930
|
}
|
|
119891
119931
|
/**
|
|
119892
|
-
*
|
|
119932
|
+
* handle dts and semantic diagnostics on file and iterate on anything that exports this file
|
|
119933
|
+
* return true when all work is done and we can exit handling dts emit and semantic diagnostics
|
|
119893
119934
|
*/
|
|
119894
|
-
function
|
|
119935
|
+
function handleDtsMayChangeOfFileAndExportsOfFile(state, filePath, seenFileAndExportsOfFile, cancellationToken, computeHash, host) {
|
|
119895
119936
|
var _a;
|
|
119896
|
-
|
|
119897
|
-
return
|
|
119898
|
-
|
|
119899
|
-
|
|
119900
|
-
|
|
119901
|
-
* fn on file and iterate on anything that exports this file
|
|
119902
|
-
*/
|
|
119903
|
-
function forEachFileAndExportsOfFile(state, filePath, seenFileAndExportsOfFile, fn) {
|
|
119904
|
-
var _a, _b, _c;
|
|
119905
|
-
if (!ts.tryAddToSet(seenFileAndExportsOfFile, filePath)) {
|
|
119906
|
-
return;
|
|
119907
|
-
}
|
|
119908
|
-
fn(state, filePath);
|
|
119937
|
+
if (!ts.tryAddToSet(seenFileAndExportsOfFile, filePath))
|
|
119938
|
+
return undefined;
|
|
119939
|
+
if (handleDtsMayChangeOfGlobalScope(state, filePath, cancellationToken, computeHash, host))
|
|
119940
|
+
return true;
|
|
119941
|
+
handleDtsMayChangeOf(state, filePath, cancellationToken, computeHash, host);
|
|
119909
119942
|
ts.Debug.assert(!!state.currentAffectedFilesExportedModulesMap);
|
|
119910
|
-
// Go through exported modules from cache first
|
|
119911
119943
|
// If exported modules has path, all files referencing file exported from are affected
|
|
119912
|
-
(
|
|
119913
|
-
return
|
|
119914
|
-
});
|
|
119915
|
-
// If exported from path is not from cache and exported modules has path, all files referencing file exported from are affected
|
|
119916
|
-
(_b = state.exportedModulesMap.getKeys(filePath)) === null || _b === void 0 ? void 0 : _b.forEach(function (exportedFromPath) {
|
|
119917
|
-
var _a;
|
|
119918
|
-
// If the cache had an updated value, skip
|
|
119919
|
-
return !state.currentAffectedFilesExportedModulesMap.hasKey(exportedFromPath) &&
|
|
119920
|
-
!((_a = state.currentAffectedFilesExportedModulesMap.deletedKeys()) === null || _a === void 0 ? void 0 : _a.has(exportedFromPath)) &&
|
|
119921
|
-
forEachFileAndExportsOfFile(state, exportedFromPath, seenFileAndExportsOfFile, fn);
|
|
119944
|
+
forEachKeyOfExportedModulesMap(state, filePath, function (exportedFromPath) {
|
|
119945
|
+
return handleDtsMayChangeOfFileAndExportsOfFile(state, exportedFromPath, seenFileAndExportsOfFile, cancellationToken, computeHash, host);
|
|
119922
119946
|
});
|
|
119923
119947
|
// Remove diagnostics of files that import this file (without going to exports of referencing files)
|
|
119924
|
-
(
|
|
119948
|
+
(_a = state.referencedMap.getKeys(filePath)) === null || _a === void 0 ? void 0 : _a.forEach(function (referencingFilePath) {
|
|
119925
119949
|
return !seenFileAndExportsOfFile.has(referencingFilePath) && // Not already removed diagnostic file
|
|
119926
|
-
|
|
119927
|
-
|
|
119928
|
-
);
|
|
119950
|
+
handleDtsMayChangeOf(// Dont add to seen since this is not yet done with the export removal
|
|
119951
|
+
state, referencingFilePath, cancellationToken, computeHash, host);
|
|
119952
|
+
});
|
|
119953
|
+
return undefined;
|
|
119929
119954
|
}
|
|
119930
119955
|
/**
|
|
119931
119956
|
* This is called after completing operation on the next affected file.
|