typescript 5.5.0-dev.20240417 → 5.5.0-dev.20240419
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/lib.es2021.weakref.d.ts +1 -1
- package/lib/tsc.js +78 -21
- package/lib/typescript.d.ts +0 -6
- package/lib/typescript.js +173 -87
- package/package.json +2 -3
|
@@ -60,7 +60,7 @@ interface FinalizationRegistry<T> {
|
|
|
60
60
|
* @param unregisterToken The token that was used as the unregisterToken argument when calling
|
|
61
61
|
* register to register the target value.
|
|
62
62
|
*/
|
|
63
|
-
unregister(unregisterToken: WeakKey):
|
|
63
|
+
unregister(unregisterToken: WeakKey): boolean;
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
interface FinalizationRegistryConstructor {
|
package/lib/tsc.js
CHANGED
|
@@ -18,7 +18,7 @@ and limitations under the License.
|
|
|
18
18
|
|
|
19
19
|
// src/compiler/corePublic.ts
|
|
20
20
|
var versionMajorMinor = "5.5";
|
|
21
|
-
var version = `${versionMajorMinor}.0-dev.
|
|
21
|
+
var version = `${versionMajorMinor}.0-dev.20240419`;
|
|
22
22
|
|
|
23
23
|
// src/compiler/core.ts
|
|
24
24
|
var emptyArray = [];
|
|
@@ -9175,11 +9175,6 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
9175
9175
|
}
|
|
9176
9176
|
const ch = codePointAt(text, pos);
|
|
9177
9177
|
if (pos === 0) {
|
|
9178
|
-
if (text.slice(0, 256).includes("\uFFFD")) {
|
|
9179
|
-
error(Diagnostics.File_appears_to_be_binary);
|
|
9180
|
-
pos = end;
|
|
9181
|
-
return token = 8 /* NonTextFileMarkerTrivia */;
|
|
9182
|
-
}
|
|
9183
9178
|
if (ch === 35 /* hash */ && isShebangTrivia(text, pos)) {
|
|
9184
9179
|
pos = scanShebangTrivia(text, pos);
|
|
9185
9180
|
if (skipTrivia2) {
|
|
@@ -9603,6 +9598,10 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
9603
9598
|
error(Diagnostics.Invalid_character, pos++, charSize(ch));
|
|
9604
9599
|
}
|
|
9605
9600
|
return token = 81 /* PrivateIdentifier */;
|
|
9601
|
+
case 65533 /* replacementCharacter */:
|
|
9602
|
+
error(Diagnostics.File_appears_to_be_binary, 0, 0);
|
|
9603
|
+
pos = end;
|
|
9604
|
+
return token = 8 /* NonTextFileMarkerTrivia */;
|
|
9606
9605
|
default:
|
|
9607
9606
|
const identifierKind = scanIdentifier(ch, languageVersion);
|
|
9608
9607
|
if (identifierKind) {
|
|
@@ -16794,8 +16793,15 @@ function createSymlinkCache(cwd, getCanonicalFileName) {
|
|
|
16794
16793
|
forEachResolvedTypeReferenceDirective((resolution) => processResolution(this, resolution.resolvedTypeReferenceDirective));
|
|
16795
16794
|
typeReferenceDirectives.forEach((resolution) => processResolution(this, resolution.resolvedTypeReferenceDirective));
|
|
16796
16795
|
},
|
|
16797
|
-
hasProcessedResolutions: () => hasProcessedResolutions
|
|
16796
|
+
hasProcessedResolutions: () => hasProcessedResolutions,
|
|
16797
|
+
setSymlinksFromResolution(resolution) {
|
|
16798
|
+
processResolution(this, resolution);
|
|
16799
|
+
},
|
|
16800
|
+
hasAnySymlinks
|
|
16798
16801
|
};
|
|
16802
|
+
function hasAnySymlinks() {
|
|
16803
|
+
return !!(symlinkedFiles == null ? void 0 : symlinkedFiles.size) || !!symlinkedDirectories && !!forEachEntry(symlinkedDirectories, (value) => !!value);
|
|
16804
|
+
}
|
|
16799
16805
|
function processResolution(cache, resolution) {
|
|
16800
16806
|
if (!resolution || !resolution.originalPath || !resolution.resolvedFileName)
|
|
16801
16807
|
return;
|
|
@@ -27337,7 +27343,7 @@ var Parser;
|
|
|
27337
27343
|
function currentNode2(position) {
|
|
27338
27344
|
const node = baseSyntaxCursor.currentNode(position);
|
|
27339
27345
|
if (topLevel && node && containsPossibleTopLevelAwait(node)) {
|
|
27340
|
-
node
|
|
27346
|
+
markAsIntersectingIncrementalChange(node);
|
|
27341
27347
|
}
|
|
27342
27348
|
return node;
|
|
27343
27349
|
}
|
|
@@ -28207,7 +28213,7 @@ var Parser;
|
|
|
28207
28213
|
return void 0;
|
|
28208
28214
|
}
|
|
28209
28215
|
const node = syntaxCursor.currentNode(pos ?? scanner.getTokenFullStart());
|
|
28210
|
-
if (nodeIsMissing(node) || node
|
|
28216
|
+
if (nodeIsMissing(node) || intersectsIncrementalChange(node) || containsParseError(node)) {
|
|
28211
28217
|
return void 0;
|
|
28212
28218
|
}
|
|
28213
28219
|
const nodeContextFlags = node.flags & 101441536 /* ContextFlags */;
|
|
@@ -33722,6 +33728,20 @@ var Parser;
|
|
|
33722
33728
|
}
|
|
33723
33729
|
})(JSDocParser = Parser2.JSDocParser || (Parser2.JSDocParser = {}));
|
|
33724
33730
|
})(Parser || (Parser = {}));
|
|
33731
|
+
var incrementallyParsedFiles = /* @__PURE__ */ new WeakSet();
|
|
33732
|
+
function markAsIncrementallyParsed(sourceFile) {
|
|
33733
|
+
if (incrementallyParsedFiles.has(sourceFile)) {
|
|
33734
|
+
Debug.fail("Source file has already been incrementally parsed");
|
|
33735
|
+
}
|
|
33736
|
+
incrementallyParsedFiles.add(sourceFile);
|
|
33737
|
+
}
|
|
33738
|
+
var intersectingChangeSet = /* @__PURE__ */ new WeakSet();
|
|
33739
|
+
function intersectsIncrementalChange(node) {
|
|
33740
|
+
return intersectingChangeSet.has(node);
|
|
33741
|
+
}
|
|
33742
|
+
function markAsIntersectingIncrementalChange(node) {
|
|
33743
|
+
intersectingChangeSet.add(node);
|
|
33744
|
+
}
|
|
33725
33745
|
var IncrementalParser;
|
|
33726
33746
|
((IncrementalParser2) => {
|
|
33727
33747
|
function updateSourceFile(sourceFile, newText, textChangeRange, aggressiveChecks) {
|
|
@@ -33744,10 +33764,8 @@ var IncrementalParser;
|
|
|
33744
33764
|
sourceFile.jsDocParsingMode
|
|
33745
33765
|
);
|
|
33746
33766
|
}
|
|
33747
|
-
|
|
33748
|
-
|
|
33749
|
-
incrementalSourceFile.hasBeenIncrementallyParsed = true;
|
|
33750
|
-
Parser.fixupParentReferences(incrementalSourceFile);
|
|
33767
|
+
markAsIncrementallyParsed(sourceFile);
|
|
33768
|
+
Parser.fixupParentReferences(sourceFile);
|
|
33751
33769
|
const oldText = sourceFile.text;
|
|
33752
33770
|
const syntaxCursor = createSyntaxCursor(sourceFile);
|
|
33753
33771
|
const changeRange = extendToAffectedRange(sourceFile, textChangeRange);
|
|
@@ -33756,7 +33774,7 @@ var IncrementalParser;
|
|
|
33756
33774
|
Debug.assert(textSpanEnd(changeRange.span) === textSpanEnd(textChangeRange.span));
|
|
33757
33775
|
Debug.assert(textSpanEnd(textChangeRangeNewSpan(changeRange)) === textSpanEnd(textChangeRangeNewSpan(textChangeRange)));
|
|
33758
33776
|
const delta = textChangeRangeNewSpan(changeRange).length - changeRange.span.length;
|
|
33759
|
-
updateTokenPositionsAndMarkElements(
|
|
33777
|
+
updateTokenPositionsAndMarkElements(sourceFile, changeRange.span.start, textSpanEnd(changeRange.span), textSpanEnd(textChangeRangeNewSpan(changeRange)), delta, oldText, newText, aggressiveChecks);
|
|
33760
33778
|
const result = Parser.parseSourceFile(
|
|
33761
33779
|
sourceFile.fileName,
|
|
33762
33780
|
newText,
|
|
@@ -33872,8 +33890,9 @@ var IncrementalParser;
|
|
|
33872
33890
|
);
|
|
33873
33891
|
Debug.assert(pos <= end);
|
|
33874
33892
|
if (element.parent) {
|
|
33875
|
-
|
|
33876
|
-
Debug.
|
|
33893
|
+
const parent = element.parent;
|
|
33894
|
+
Debug.assertGreaterThanOrEqual(pos, parent.pos);
|
|
33895
|
+
Debug.assertLessThanOrEqual(end, parent.end);
|
|
33877
33896
|
}
|
|
33878
33897
|
setTextRangePosEnd(element, pos, end);
|
|
33879
33898
|
}
|
|
@@ -33912,7 +33931,7 @@ var IncrementalParser;
|
|
|
33912
33931
|
}
|
|
33913
33932
|
const fullEnd = child.end;
|
|
33914
33933
|
if (fullEnd >= changeStart) {
|
|
33915
|
-
child
|
|
33934
|
+
markAsIntersectingIncrementalChange(child);
|
|
33916
33935
|
unsetNodeChildren(child);
|
|
33917
33936
|
adjustIntersectingElement(child, changeStart, changeRangeOldEnd, changeRangeNewEnd, delta);
|
|
33918
33937
|
forEachChild(child, visitNode3, visitArray2);
|
|
@@ -33942,7 +33961,7 @@ var IncrementalParser;
|
|
|
33942
33961
|
}
|
|
33943
33962
|
const fullEnd = array.end;
|
|
33944
33963
|
if (fullEnd >= changeStart) {
|
|
33945
|
-
array
|
|
33964
|
+
markAsIntersectingIncrementalChange(array);
|
|
33946
33965
|
adjustIntersectingElement(array, changeStart, changeRangeOldEnd, changeRangeNewEnd, delta);
|
|
33947
33966
|
for (const node of array) {
|
|
33948
33967
|
visitNode3(node);
|
|
@@ -43281,7 +43300,7 @@ function getModuleSpecifiersWithCacheInfo(moduleSymbol, checker, compilerOptions
|
|
|
43281
43300
|
if (!moduleSourceFile)
|
|
43282
43301
|
return { moduleSpecifiers: emptyArray, computedWithoutCache };
|
|
43283
43302
|
computedWithoutCache = true;
|
|
43284
|
-
modulePaths || (modulePaths = getAllModulePathsWorker(getInfo(importingSourceFile.fileName, host), moduleSourceFile.originalFileName, host));
|
|
43303
|
+
modulePaths || (modulePaths = getAllModulePathsWorker(getInfo(importingSourceFile.fileName, host), moduleSourceFile.originalFileName, host, compilerOptions, options));
|
|
43285
43304
|
const result = computeModuleSpecifiers(
|
|
43286
43305
|
modulePaths,
|
|
43287
43306
|
compilerOptions,
|
|
@@ -43488,7 +43507,42 @@ function forEachFileNameOfModule(importingFileName, importedFileName, host, pref
|
|
|
43488
43507
|
});
|
|
43489
43508
|
return result || (preferSymlinks ? forEach(targets, (p) => shouldFilterIgnoredPaths && containsIgnoredPath(p) ? void 0 : cb(p, p === referenceRedirect)) : void 0);
|
|
43490
43509
|
}
|
|
43491
|
-
|
|
43510
|
+
var runtimeDependencyFields = ["dependencies", "peerDependencies", "optionalDependencies"];
|
|
43511
|
+
function getAllRuntimeDependencies(packageJson) {
|
|
43512
|
+
let result;
|
|
43513
|
+
for (const field of runtimeDependencyFields) {
|
|
43514
|
+
const deps = packageJson[field];
|
|
43515
|
+
if (deps && typeof deps === "object") {
|
|
43516
|
+
result = concatenate(result, getOwnKeys(deps));
|
|
43517
|
+
}
|
|
43518
|
+
}
|
|
43519
|
+
return result;
|
|
43520
|
+
}
|
|
43521
|
+
function getAllModulePathsWorker(info, importedFileName, host, compilerOptions, options) {
|
|
43522
|
+
var _a, _b;
|
|
43523
|
+
const cache = (_a = host.getModuleResolutionCache) == null ? void 0 : _a.call(host);
|
|
43524
|
+
const links = (_b = host.getSymlinkCache) == null ? void 0 : _b.call(host);
|
|
43525
|
+
if (cache && links && host.readFile && !pathContainsNodeModules(info.importingSourceFileName)) {
|
|
43526
|
+
Debug.type(host);
|
|
43527
|
+
const state = getTemporaryModuleResolutionState(cache.getPackageJsonInfoCache(), host, {});
|
|
43528
|
+
const packageJson = getPackageScopeForPath(info.importingSourceFileName, state);
|
|
43529
|
+
if (packageJson) {
|
|
43530
|
+
const toResolve = getAllRuntimeDependencies(packageJson.contents.packageJsonContent);
|
|
43531
|
+
for (const depName of toResolve || emptyArray) {
|
|
43532
|
+
const resolved = resolveModuleName(
|
|
43533
|
+
depName,
|
|
43534
|
+
combinePaths(packageJson.packageDirectory, "package.json"),
|
|
43535
|
+
compilerOptions,
|
|
43536
|
+
host,
|
|
43537
|
+
cache,
|
|
43538
|
+
/*redirectedReference*/
|
|
43539
|
+
void 0,
|
|
43540
|
+
options.overrideImportMode
|
|
43541
|
+
);
|
|
43542
|
+
links.setSymlinksFromResolution(resolved.resolvedModule);
|
|
43543
|
+
}
|
|
43544
|
+
}
|
|
43545
|
+
}
|
|
43492
43546
|
const allFileNames = /* @__PURE__ */ new Map();
|
|
43493
43547
|
let importedFileFromNodeModules = false;
|
|
43494
43548
|
forEachFileNameOfModule(
|
|
@@ -118293,6 +118347,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
118293
118347
|
return false;
|
|
118294
118348
|
return host.fileExists(f);
|
|
118295
118349
|
},
|
|
118350
|
+
realpath: maybeBind(host, host.realpath),
|
|
118296
118351
|
useCaseSensitiveFileNames: () => host.useCaseSensitiveFileNames(),
|
|
118297
118352
|
getBuildInfo: () => {
|
|
118298
118353
|
var _a2;
|
|
@@ -118301,7 +118356,9 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
118301
118356
|
getSourceFileFromReference: (file, ref) => program.getSourceFileFromReference(file, ref),
|
|
118302
118357
|
redirectTargetsMap,
|
|
118303
118358
|
getFileIncludeReasons: program.getFileIncludeReasons,
|
|
118304
|
-
createHash: maybeBind(host, host.createHash)
|
|
118359
|
+
createHash: maybeBind(host, host.createHash),
|
|
118360
|
+
getModuleResolutionCache: () => program.getModuleResolutionCache(),
|
|
118361
|
+
trace: maybeBind(host, host.trace)
|
|
118305
118362
|
};
|
|
118306
118363
|
}
|
|
118307
118364
|
function writeFile2(fileName, text, writeByteOrderMark, onError, sourceFiles, data) {
|
package/lib/typescript.d.ts
CHANGED
|
@@ -4378,12 +4378,6 @@ declare namespace ts {
|
|
|
4378
4378
|
interface Identifier {
|
|
4379
4379
|
readonly text: string;
|
|
4380
4380
|
}
|
|
4381
|
-
interface Identifier {
|
|
4382
|
-
/** @deprecated Use `idKeyword(identifier)` instead. */
|
|
4383
|
-
readonly originalKeywordKind?: SyntaxKind;
|
|
4384
|
-
/** @deprecated Use `.parent` or the surrounding context to determine this instead. */
|
|
4385
|
-
readonly isInJSDocNamespace?: boolean;
|
|
4386
|
-
}
|
|
4387
4381
|
interface TransientIdentifier extends Identifier {
|
|
4388
4382
|
resolvedSymbol: Symbol;
|
|
4389
4383
|
}
|
package/lib/typescript.js
CHANGED
|
@@ -2350,7 +2350,7 @@ module.exports = __toCommonJS(typescript_exports);
|
|
|
2350
2350
|
|
|
2351
2351
|
// src/compiler/corePublic.ts
|
|
2352
2352
|
var versionMajorMinor = "5.5";
|
|
2353
|
-
var version = `${versionMajorMinor}.0-dev.
|
|
2353
|
+
var version = `${versionMajorMinor}.0-dev.20240419`;
|
|
2354
2354
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
2355
2355
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
2356
2356
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -7012,6 +7012,7 @@ var CharacterCodes = /* @__PURE__ */ ((CharacterCodes2) => {
|
|
|
7012
7012
|
CharacterCodes2[CharacterCodes2["ideographicSpace"] = 12288] = "ideographicSpace";
|
|
7013
7013
|
CharacterCodes2[CharacterCodes2["mathematicalSpace"] = 8287] = "mathematicalSpace";
|
|
7014
7014
|
CharacterCodes2[CharacterCodes2["ogham"] = 5760] = "ogham";
|
|
7015
|
+
CharacterCodes2[CharacterCodes2["replacementCharacter"] = 65533] = "replacementCharacter";
|
|
7015
7016
|
CharacterCodes2[CharacterCodes2["_"] = 95] = "_";
|
|
7016
7017
|
CharacterCodes2[CharacterCodes2["$"] = 36] = "$";
|
|
7017
7018
|
CharacterCodes2[CharacterCodes2["_0"] = 48] = "_0";
|
|
@@ -12776,11 +12777,6 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
12776
12777
|
}
|
|
12777
12778
|
const ch = codePointAt(text, pos);
|
|
12778
12779
|
if (pos === 0) {
|
|
12779
|
-
if (text.slice(0, 256).includes("\uFFFD")) {
|
|
12780
|
-
error2(Diagnostics.File_appears_to_be_binary);
|
|
12781
|
-
pos = end;
|
|
12782
|
-
return token = 8 /* NonTextFileMarkerTrivia */;
|
|
12783
|
-
}
|
|
12784
12780
|
if (ch === 35 /* hash */ && isShebangTrivia(text, pos)) {
|
|
12785
12781
|
pos = scanShebangTrivia(text, pos);
|
|
12786
12782
|
if (skipTrivia2) {
|
|
@@ -13204,6 +13200,10 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
13204
13200
|
error2(Diagnostics.Invalid_character, pos++, charSize(ch));
|
|
13205
13201
|
}
|
|
13206
13202
|
return token = 81 /* PrivateIdentifier */;
|
|
13203
|
+
case 65533 /* replacementCharacter */:
|
|
13204
|
+
error2(Diagnostics.File_appears_to_be_binary, 0, 0);
|
|
13205
|
+
pos = end;
|
|
13206
|
+
return token = 8 /* NonTextFileMarkerTrivia */;
|
|
13207
13207
|
default:
|
|
13208
13208
|
const identifierKind = scanIdentifier(ch, languageVersion);
|
|
13209
13209
|
if (identifierKind) {
|
|
@@ -21004,8 +21004,15 @@ function createSymlinkCache(cwd, getCanonicalFileName) {
|
|
|
21004
21004
|
forEachResolvedTypeReferenceDirective((resolution) => processResolution(this, resolution.resolvedTypeReferenceDirective));
|
|
21005
21005
|
typeReferenceDirectives.forEach((resolution) => processResolution(this, resolution.resolvedTypeReferenceDirective));
|
|
21006
21006
|
},
|
|
21007
|
-
hasProcessedResolutions: () => hasProcessedResolutions
|
|
21007
|
+
hasProcessedResolutions: () => hasProcessedResolutions,
|
|
21008
|
+
setSymlinksFromResolution(resolution) {
|
|
21009
|
+
processResolution(this, resolution);
|
|
21010
|
+
},
|
|
21011
|
+
hasAnySymlinks
|
|
21008
21012
|
};
|
|
21013
|
+
function hasAnySymlinks() {
|
|
21014
|
+
return !!(symlinkedFiles == null ? void 0 : symlinkedFiles.size) || !!symlinkedDirectories && !!forEachEntry(symlinkedDirectories, (value) => !!value);
|
|
21015
|
+
}
|
|
21009
21016
|
function processResolution(cache, resolution) {
|
|
21010
21017
|
if (!resolution || !resolution.originalPath || !resolution.resolvedFileName)
|
|
21011
21018
|
return;
|
|
@@ -31782,7 +31789,7 @@ var Parser;
|
|
|
31782
31789
|
function currentNode2(position) {
|
|
31783
31790
|
const node = baseSyntaxCursor.currentNode(position);
|
|
31784
31791
|
if (topLevel && node && containsPossibleTopLevelAwait(node)) {
|
|
31785
|
-
node
|
|
31792
|
+
markAsIntersectingIncrementalChange(node);
|
|
31786
31793
|
}
|
|
31787
31794
|
return node;
|
|
31788
31795
|
}
|
|
@@ -32652,7 +32659,7 @@ var Parser;
|
|
|
32652
32659
|
return void 0;
|
|
32653
32660
|
}
|
|
32654
32661
|
const node = syntaxCursor.currentNode(pos ?? scanner2.getTokenFullStart());
|
|
32655
|
-
if (nodeIsMissing(node) || node
|
|
32662
|
+
if (nodeIsMissing(node) || intersectsIncrementalChange(node) || containsParseError(node)) {
|
|
32656
32663
|
return void 0;
|
|
32657
32664
|
}
|
|
32658
32665
|
const nodeContextFlags = node.flags & 101441536 /* ContextFlags */;
|
|
@@ -38167,6 +38174,20 @@ var Parser;
|
|
|
38167
38174
|
}
|
|
38168
38175
|
})(JSDocParser = Parser2.JSDocParser || (Parser2.JSDocParser = {}));
|
|
38169
38176
|
})(Parser || (Parser = {}));
|
|
38177
|
+
var incrementallyParsedFiles = /* @__PURE__ */ new WeakSet();
|
|
38178
|
+
function markAsIncrementallyParsed(sourceFile) {
|
|
38179
|
+
if (incrementallyParsedFiles.has(sourceFile)) {
|
|
38180
|
+
Debug.fail("Source file has already been incrementally parsed");
|
|
38181
|
+
}
|
|
38182
|
+
incrementallyParsedFiles.add(sourceFile);
|
|
38183
|
+
}
|
|
38184
|
+
var intersectingChangeSet = /* @__PURE__ */ new WeakSet();
|
|
38185
|
+
function intersectsIncrementalChange(node) {
|
|
38186
|
+
return intersectingChangeSet.has(node);
|
|
38187
|
+
}
|
|
38188
|
+
function markAsIntersectingIncrementalChange(node) {
|
|
38189
|
+
intersectingChangeSet.add(node);
|
|
38190
|
+
}
|
|
38170
38191
|
var IncrementalParser;
|
|
38171
38192
|
((IncrementalParser2) => {
|
|
38172
38193
|
function updateSourceFile2(sourceFile, newText, textChangeRange, aggressiveChecks) {
|
|
@@ -38189,10 +38210,8 @@ var IncrementalParser;
|
|
|
38189
38210
|
sourceFile.jsDocParsingMode
|
|
38190
38211
|
);
|
|
38191
38212
|
}
|
|
38192
|
-
|
|
38193
|
-
|
|
38194
|
-
incrementalSourceFile.hasBeenIncrementallyParsed = true;
|
|
38195
|
-
Parser.fixupParentReferences(incrementalSourceFile);
|
|
38213
|
+
markAsIncrementallyParsed(sourceFile);
|
|
38214
|
+
Parser.fixupParentReferences(sourceFile);
|
|
38196
38215
|
const oldText = sourceFile.text;
|
|
38197
38216
|
const syntaxCursor = createSyntaxCursor(sourceFile);
|
|
38198
38217
|
const changeRange = extendToAffectedRange(sourceFile, textChangeRange);
|
|
@@ -38201,7 +38220,7 @@ var IncrementalParser;
|
|
|
38201
38220
|
Debug.assert(textSpanEnd(changeRange.span) === textSpanEnd(textChangeRange.span));
|
|
38202
38221
|
Debug.assert(textSpanEnd(textChangeRangeNewSpan(changeRange)) === textSpanEnd(textChangeRangeNewSpan(textChangeRange)));
|
|
38203
38222
|
const delta = textChangeRangeNewSpan(changeRange).length - changeRange.span.length;
|
|
38204
|
-
updateTokenPositionsAndMarkElements(
|
|
38223
|
+
updateTokenPositionsAndMarkElements(sourceFile, changeRange.span.start, textSpanEnd(changeRange.span), textSpanEnd(textChangeRangeNewSpan(changeRange)), delta, oldText, newText, aggressiveChecks);
|
|
38205
38224
|
const result = Parser.parseSourceFile(
|
|
38206
38225
|
sourceFile.fileName,
|
|
38207
38226
|
newText,
|
|
@@ -38317,8 +38336,9 @@ var IncrementalParser;
|
|
|
38317
38336
|
);
|
|
38318
38337
|
Debug.assert(pos <= end);
|
|
38319
38338
|
if (element.parent) {
|
|
38320
|
-
|
|
38321
|
-
Debug.
|
|
38339
|
+
const parent2 = element.parent;
|
|
38340
|
+
Debug.assertGreaterThanOrEqual(pos, parent2.pos);
|
|
38341
|
+
Debug.assertLessThanOrEqual(end, parent2.end);
|
|
38322
38342
|
}
|
|
38323
38343
|
setTextRangePosEnd(element, pos, end);
|
|
38324
38344
|
}
|
|
@@ -38357,7 +38377,7 @@ var IncrementalParser;
|
|
|
38357
38377
|
}
|
|
38358
38378
|
const fullEnd = child.end;
|
|
38359
38379
|
if (fullEnd >= changeStart) {
|
|
38360
|
-
child
|
|
38380
|
+
markAsIntersectingIncrementalChange(child);
|
|
38361
38381
|
unsetNodeChildren(child);
|
|
38362
38382
|
adjustIntersectingElement(child, changeStart, changeRangeOldEnd, changeRangeNewEnd, delta);
|
|
38363
38383
|
forEachChild(child, visitNode3, visitArray2);
|
|
@@ -38387,7 +38407,7 @@ var IncrementalParser;
|
|
|
38387
38407
|
}
|
|
38388
38408
|
const fullEnd = array.end;
|
|
38389
38409
|
if (fullEnd >= changeStart) {
|
|
38390
|
-
array
|
|
38410
|
+
markAsIntersectingIncrementalChange(array);
|
|
38391
38411
|
adjustIntersectingElement(array, changeStart, changeRangeOldEnd, changeRangeNewEnd, delta);
|
|
38392
38412
|
for (const node of array) {
|
|
38393
38413
|
visitNode3(node);
|
|
@@ -47977,7 +47997,7 @@ function getModuleSpecifier(compilerOptions, importingSourceFile, importingSourc
|
|
|
47977
47997
|
}
|
|
47978
47998
|
function getNodeModulesPackageName(compilerOptions, importingSourceFile, nodeModulesFileName, host, preferences, options = {}) {
|
|
47979
47999
|
const info = getInfo(importingSourceFile.fileName, host);
|
|
47980
|
-
const modulePaths = getAllModulePaths(info, nodeModulesFileName, host, preferences, options);
|
|
48000
|
+
const modulePaths = getAllModulePaths(info, nodeModulesFileName, host, preferences, compilerOptions, options);
|
|
47981
48001
|
return firstDefined(modulePaths, (modulePath) => tryGetModuleNameAsNodeModule(
|
|
47982
48002
|
modulePath,
|
|
47983
48003
|
info,
|
|
@@ -47992,7 +48012,7 @@ function getNodeModulesPackageName(compilerOptions, importingSourceFile, nodeMod
|
|
|
47992
48012
|
}
|
|
47993
48013
|
function getModuleSpecifierWorker(compilerOptions, importingSourceFile, importingSourceFileName, toFileName2, host, preferences, userPreferences, options = {}) {
|
|
47994
48014
|
const info = getInfo(importingSourceFileName, host);
|
|
47995
|
-
const modulePaths = getAllModulePaths(info, toFileName2, host, userPreferences, options);
|
|
48015
|
+
const modulePaths = getAllModulePaths(info, toFileName2, host, userPreferences, compilerOptions, options);
|
|
47996
48016
|
return firstDefined(modulePaths, (modulePath) => tryGetModuleNameAsNodeModule(
|
|
47997
48017
|
modulePath,
|
|
47998
48018
|
info,
|
|
@@ -48054,7 +48074,7 @@ function getModuleSpecifiersWithCacheInfo(moduleSymbol, checker, compilerOptions
|
|
|
48054
48074
|
if (!moduleSourceFile)
|
|
48055
48075
|
return { moduleSpecifiers: emptyArray, computedWithoutCache };
|
|
48056
48076
|
computedWithoutCache = true;
|
|
48057
|
-
modulePaths || (modulePaths = getAllModulePathsWorker(getInfo(importingSourceFile.fileName, host), moduleSourceFile.originalFileName, host));
|
|
48077
|
+
modulePaths || (modulePaths = getAllModulePathsWorker(getInfo(importingSourceFile.fileName, host), moduleSourceFile.originalFileName, host, compilerOptions, options));
|
|
48058
48078
|
const result = computeModuleSpecifiers(
|
|
48059
48079
|
modulePaths,
|
|
48060
48080
|
compilerOptions,
|
|
@@ -48273,7 +48293,7 @@ function forEachFileNameOfModule(importingFileName, importedFileName, host, pref
|
|
|
48273
48293
|
});
|
|
48274
48294
|
return result || (preferSymlinks ? forEach(targets, (p) => shouldFilterIgnoredPaths && containsIgnoredPath(p) ? void 0 : cb(p, p === referenceRedirect)) : void 0);
|
|
48275
48295
|
}
|
|
48276
|
-
function getAllModulePaths(info, importedFileName, host, preferences, options = {}) {
|
|
48296
|
+
function getAllModulePaths(info, importedFileName, host, preferences, compilerOptions, options = {}) {
|
|
48277
48297
|
var _a;
|
|
48278
48298
|
const importingFilePath = toPath(info.importingSourceFileName, host.getCurrentDirectory(), hostGetCanonicalFileName(host));
|
|
48279
48299
|
const importedFilePath = toPath(importedFileName, host.getCurrentDirectory(), hostGetCanonicalFileName(host));
|
|
@@ -48283,13 +48303,48 @@ function getAllModulePaths(info, importedFileName, host, preferences, options =
|
|
|
48283
48303
|
if (cached == null ? void 0 : cached.modulePaths)
|
|
48284
48304
|
return cached.modulePaths;
|
|
48285
48305
|
}
|
|
48286
|
-
const modulePaths = getAllModulePathsWorker(info, importedFileName, host);
|
|
48306
|
+
const modulePaths = getAllModulePathsWorker(info, importedFileName, host, compilerOptions, options);
|
|
48287
48307
|
if (cache) {
|
|
48288
48308
|
cache.setModulePaths(importingFilePath, importedFilePath, preferences, options, modulePaths);
|
|
48289
48309
|
}
|
|
48290
48310
|
return modulePaths;
|
|
48291
48311
|
}
|
|
48292
|
-
|
|
48312
|
+
var runtimeDependencyFields = ["dependencies", "peerDependencies", "optionalDependencies"];
|
|
48313
|
+
function getAllRuntimeDependencies(packageJson) {
|
|
48314
|
+
let result;
|
|
48315
|
+
for (const field of runtimeDependencyFields) {
|
|
48316
|
+
const deps = packageJson[field];
|
|
48317
|
+
if (deps && typeof deps === "object") {
|
|
48318
|
+
result = concatenate(result, getOwnKeys(deps));
|
|
48319
|
+
}
|
|
48320
|
+
}
|
|
48321
|
+
return result;
|
|
48322
|
+
}
|
|
48323
|
+
function getAllModulePathsWorker(info, importedFileName, host, compilerOptions, options) {
|
|
48324
|
+
var _a, _b;
|
|
48325
|
+
const cache = (_a = host.getModuleResolutionCache) == null ? void 0 : _a.call(host);
|
|
48326
|
+
const links = (_b = host.getSymlinkCache) == null ? void 0 : _b.call(host);
|
|
48327
|
+
if (cache && links && host.readFile && !pathContainsNodeModules(info.importingSourceFileName)) {
|
|
48328
|
+
Debug.type(host);
|
|
48329
|
+
const state = getTemporaryModuleResolutionState(cache.getPackageJsonInfoCache(), host, {});
|
|
48330
|
+
const packageJson = getPackageScopeForPath(info.importingSourceFileName, state);
|
|
48331
|
+
if (packageJson) {
|
|
48332
|
+
const toResolve = getAllRuntimeDependencies(packageJson.contents.packageJsonContent);
|
|
48333
|
+
for (const depName of toResolve || emptyArray) {
|
|
48334
|
+
const resolved = resolveModuleName(
|
|
48335
|
+
depName,
|
|
48336
|
+
combinePaths(packageJson.packageDirectory, "package.json"),
|
|
48337
|
+
compilerOptions,
|
|
48338
|
+
host,
|
|
48339
|
+
cache,
|
|
48340
|
+
/*redirectedReference*/
|
|
48341
|
+
void 0,
|
|
48342
|
+
options.overrideImportMode
|
|
48343
|
+
);
|
|
48344
|
+
links.setSymlinksFromResolution(resolved.resolvedModule);
|
|
48345
|
+
}
|
|
48346
|
+
}
|
|
48347
|
+
}
|
|
48293
48348
|
const allFileNames = /* @__PURE__ */ new Map();
|
|
48294
48349
|
let importedFileFromNodeModules = false;
|
|
48295
48350
|
forEachFileNameOfModule(
|
|
@@ -123338,6 +123393,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
123338
123393
|
return false;
|
|
123339
123394
|
return host.fileExists(f);
|
|
123340
123395
|
},
|
|
123396
|
+
realpath: maybeBind(host, host.realpath),
|
|
123341
123397
|
useCaseSensitiveFileNames: () => host.useCaseSensitiveFileNames(),
|
|
123342
123398
|
getBuildInfo: () => {
|
|
123343
123399
|
var _a2;
|
|
@@ -123346,7 +123402,9 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
123346
123402
|
getSourceFileFromReference: (file, ref) => program.getSourceFileFromReference(file, ref),
|
|
123347
123403
|
redirectTargetsMap,
|
|
123348
123404
|
getFileIncludeReasons: program.getFileIncludeReasons,
|
|
123349
|
-
createHash: maybeBind(host, host.createHash)
|
|
123405
|
+
createHash: maybeBind(host, host.createHash),
|
|
123406
|
+
getModuleResolutionCache: () => program.getModuleResolutionCache(),
|
|
123407
|
+
trace: maybeBind(host, host.trace)
|
|
123350
123408
|
};
|
|
123351
123409
|
}
|
|
123352
123410
|
function writeFile2(fileName, text, writeByteOrderMark, onError, sourceFiles, data) {
|
|
@@ -162665,6 +162723,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
|
|
|
162665
162723
|
}
|
|
162666
162724
|
}
|
|
162667
162725
|
function shouldOfferImportCompletions() {
|
|
162726
|
+
var _a;
|
|
162668
162727
|
if (importStatementCompletion)
|
|
162669
162728
|
return true;
|
|
162670
162729
|
if (!preferences.includeCompletionsForModuleExports)
|
|
@@ -162673,7 +162732,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
|
|
|
162673
162732
|
return true;
|
|
162674
162733
|
if (compilerOptionsIndicateEsModules(program.getCompilerOptions()))
|
|
162675
162734
|
return true;
|
|
162676
|
-
return programContainsModules(program);
|
|
162735
|
+
return ((_a = program.getSymlinkCache) == null ? void 0 : _a.call(program).hasAnySymlinks()) || !!program.getCompilerOptions().paths || programContainsModules(program);
|
|
162677
162736
|
}
|
|
162678
162737
|
function isSnippetScope(scopeNode) {
|
|
162679
162738
|
switch (scopeNode.kind) {
|
|
@@ -178289,37 +178348,6 @@ function buildOverload(name) {
|
|
|
178289
178348
|
};
|
|
178290
178349
|
}
|
|
178291
178350
|
|
|
178292
|
-
// src/deprecatedCompat/5.0/identifierProperties.ts
|
|
178293
|
-
addObjectAllocatorPatcher((objectAllocator2) => {
|
|
178294
|
-
const Identifier78 = objectAllocator2.getIdentifierConstructor();
|
|
178295
|
-
if (!hasProperty(Identifier78.prototype, "originalKeywordKind")) {
|
|
178296
|
-
Object.defineProperty(Identifier78.prototype, "originalKeywordKind", {
|
|
178297
|
-
get: deprecate(function() {
|
|
178298
|
-
return identifierToKeywordKind(this);
|
|
178299
|
-
}, {
|
|
178300
|
-
name: "originalKeywordKind",
|
|
178301
|
-
since: "5.0",
|
|
178302
|
-
warnAfter: "5.1",
|
|
178303
|
-
errorAfter: "5.2",
|
|
178304
|
-
message: "Use 'identifierToKeywordKind(identifier)' instead."
|
|
178305
|
-
})
|
|
178306
|
-
});
|
|
178307
|
-
}
|
|
178308
|
-
if (!hasProperty(Identifier78.prototype, "isInJSDocNamespace")) {
|
|
178309
|
-
Object.defineProperty(Identifier78.prototype, "isInJSDocNamespace", {
|
|
178310
|
-
get: deprecate(function() {
|
|
178311
|
-
return this.flags & 4096 /* IdentifierIsInJSDocNamespace */ ? true : void 0;
|
|
178312
|
-
}, {
|
|
178313
|
-
name: "isInJSDocNamespace",
|
|
178314
|
-
since: "5.0",
|
|
178315
|
-
warnAfter: "5.1",
|
|
178316
|
-
errorAfter: "5.2",
|
|
178317
|
-
message: "Use '.parent' or the surrounding context to determine this instead."
|
|
178318
|
-
})
|
|
178319
|
-
});
|
|
178320
|
-
}
|
|
178321
|
-
});
|
|
178322
|
-
|
|
178323
178351
|
// src/server/_namespaces/ts.server.ts
|
|
178324
178352
|
var ts_server_exports3 = {};
|
|
178325
178353
|
__export(ts_server_exports3, {
|
|
@@ -180696,6 +180724,13 @@ var Project3 = class _Project {
|
|
|
180696
180724
|
}
|
|
180697
180725
|
}
|
|
180698
180726
|
/** @internal */
|
|
180727
|
+
markAutoImportProviderAsDirty() {
|
|
180728
|
+
var _a;
|
|
180729
|
+
if (!this.autoImportProviderHost)
|
|
180730
|
+
this.autoImportProviderHost = void 0;
|
|
180731
|
+
(_a = this.autoImportProviderHost) == null ? void 0 : _a.markAsDirty();
|
|
180732
|
+
}
|
|
180733
|
+
/** @internal */
|
|
180699
180734
|
onAutoImportProviderSettingsChanged() {
|
|
180700
180735
|
var _a;
|
|
180701
180736
|
if (this.autoImportProviderHost === false) {
|
|
@@ -180731,7 +180766,7 @@ var Project3 = class _Project {
|
|
|
180731
180766
|
* @returns: true if set of files in the project stays the same and false - otherwise.
|
|
180732
180767
|
*/
|
|
180733
180768
|
updateGraph() {
|
|
180734
|
-
var _a, _b, _c, _d
|
|
180769
|
+
var _a, _b, _c, _d;
|
|
180735
180770
|
(_a = tracing) == null ? void 0 : _a.push(tracing.Phase.Session, "updateGraph", { name: this.projectName, kind: ProjectKind[this.projectKind] });
|
|
180736
180771
|
(_b = perfLogger) == null ? void 0 : _b.logStartUpdateGraph();
|
|
180737
180772
|
this.resolutionCache.startRecordingFilesWithChangedResolutions();
|
|
@@ -180756,15 +180791,13 @@ var Project3 = class _Project {
|
|
|
180756
180791
|
this.projectProgramVersion++;
|
|
180757
180792
|
}
|
|
180758
180793
|
if (hasAddedorRemovedFiles) {
|
|
180759
|
-
|
|
180760
|
-
this.autoImportProviderHost = void 0;
|
|
180761
|
-
(_c = this.autoImportProviderHost) == null ? void 0 : _c.markAsDirty();
|
|
180794
|
+
this.markAutoImportProviderAsDirty();
|
|
180762
180795
|
}
|
|
180763
180796
|
if (isFirstProgramLoad) {
|
|
180764
180797
|
this.getPackageJsonAutoImportProvider();
|
|
180765
180798
|
}
|
|
180766
|
-
(
|
|
180767
|
-
(
|
|
180799
|
+
(_c = perfLogger) == null ? void 0 : _c.logStopUpdateGraph();
|
|
180800
|
+
(_d = tracing) == null ? void 0 : _d.pop();
|
|
180768
180801
|
return !hasNewProgram;
|
|
180769
180802
|
}
|
|
180770
180803
|
/** @internal */
|
|
@@ -181732,8 +181765,7 @@ var _AutoImportProviderProject = class _AutoImportProviderProject extends Projec
|
|
|
181732
181765
|
if (packageJson) {
|
|
181733
181766
|
const entrypoints = getRootNamesFromPackageJson(packageJson, program, symlinkCache);
|
|
181734
181767
|
if (entrypoints) {
|
|
181735
|
-
|
|
181736
|
-
dependenciesAdded += entrypoints.length ? 1 : 0;
|
|
181768
|
+
dependenciesAdded += addRootNames(entrypoints);
|
|
181737
181769
|
continue;
|
|
181738
181770
|
}
|
|
181739
181771
|
}
|
|
@@ -181748,8 +181780,7 @@ var _AutoImportProviderProject = class _AutoImportProviderProject extends Projec
|
|
|
181748
181780
|
);
|
|
181749
181781
|
if (typesPackageJson) {
|
|
181750
181782
|
const entrypoints = getRootNamesFromPackageJson(typesPackageJson, program, symlinkCache);
|
|
181751
|
-
|
|
181752
|
-
dependenciesAdded += (entrypoints == null ? void 0 : entrypoints.length) ? 1 : 0;
|
|
181783
|
+
dependenciesAdded += addRootNames(entrypoints);
|
|
181753
181784
|
return true;
|
|
181754
181785
|
}
|
|
181755
181786
|
}
|
|
@@ -181764,15 +181795,48 @@ var _AutoImportProviderProject = class _AutoImportProviderProject extends Projec
|
|
|
181764
181795
|
/*resolveJs*/
|
|
181765
181796
|
true
|
|
181766
181797
|
);
|
|
181767
|
-
|
|
181768
|
-
|
|
181798
|
+
dependenciesAdded += addRootNames(entrypoints);
|
|
181799
|
+
}
|
|
181800
|
+
}
|
|
181801
|
+
}
|
|
181802
|
+
const references = program.getResolvedProjectReferences();
|
|
181803
|
+
let referencesAddded = 0;
|
|
181804
|
+
if ((references == null ? void 0 : references.length) && hostProject.projectService.getHostPreferences().includeCompletionsForModuleExports) {
|
|
181805
|
+
references.forEach((ref) => {
|
|
181806
|
+
if (ref == null ? void 0 : ref.commandLine.options.outFile) {
|
|
181807
|
+
referencesAddded += addRootNames(filterEntrypoints([
|
|
181808
|
+
changeExtension(ref.commandLine.options.outFile, ".d.ts")
|
|
181809
|
+
]));
|
|
181810
|
+
} else if (ref) {
|
|
181811
|
+
const getCommonSourceDirectory2 = memoize(
|
|
181812
|
+
() => getCommonSourceDirectoryOfConfig(
|
|
181813
|
+
ref.commandLine,
|
|
181814
|
+
!hostProject.useCaseSensitiveFileNames()
|
|
181815
|
+
)
|
|
181816
|
+
);
|
|
181817
|
+
referencesAddded += addRootNames(filterEntrypoints(mapDefined(
|
|
181818
|
+
ref.commandLine.fileNames,
|
|
181819
|
+
(fileName) => !isDeclarationFileName(fileName) && !fileExtensionIs(fileName, ".json" /* Json */) && !program.getSourceFile(fileName) ? getOutputDeclarationFileName(
|
|
181820
|
+
fileName,
|
|
181821
|
+
ref.commandLine,
|
|
181822
|
+
!hostProject.useCaseSensitiveFileNames(),
|
|
181823
|
+
getCommonSourceDirectory2
|
|
181824
|
+
) : void 0
|
|
181825
|
+
)));
|
|
181769
181826
|
}
|
|
181770
|
-
}
|
|
181827
|
+
});
|
|
181828
|
+
}
|
|
181829
|
+
if (rootNames == null ? void 0 : rootNames.size) {
|
|
181830
|
+
hostProject.log(`AutoImportProviderProject: found ${rootNames.size} root files in ${dependenciesAdded} dependencies ${referencesAddded} referenced projects in ${timestamp() - start} ms`);
|
|
181771
181831
|
}
|
|
181772
|
-
|
|
181773
|
-
|
|
181832
|
+
return rootNames ? arrayFrom(rootNames.values()) : emptyArray;
|
|
181833
|
+
function addRootNames(entrypoints) {
|
|
181834
|
+
if (!(entrypoints == null ? void 0 : entrypoints.length))
|
|
181835
|
+
return 0;
|
|
181836
|
+
rootNames ?? (rootNames = /* @__PURE__ */ new Set());
|
|
181837
|
+
entrypoints.forEach((entry) => rootNames.add(entry));
|
|
181838
|
+
return 1;
|
|
181774
181839
|
}
|
|
181775
|
-
return rootNames || emptyArray;
|
|
181776
181840
|
function addDependency(dependency) {
|
|
181777
181841
|
if (!startsWith(dependency, "@types/")) {
|
|
181778
181842
|
(dependencyNames || (dependencyNames = /* @__PURE__ */ new Set())).add(dependency);
|
|
@@ -181797,14 +181861,17 @@ var _AutoImportProviderProject = class _AutoImportProviderProject extends Projec
|
|
|
181797
181861
|
realPath: ensureTrailingDirectorySeparator(realPath2)
|
|
181798
181862
|
});
|
|
181799
181863
|
}
|
|
181800
|
-
return
|
|
181801
|
-
const resolvedFileName = isSymlink ? entrypoint.replace(packageJson.packageDirectory, real) : entrypoint;
|
|
181802
|
-
if (!program2.getSourceFile(resolvedFileName) && !(isSymlink && program2.getSourceFile(entrypoint))) {
|
|
181803
|
-
return resolvedFileName;
|
|
181804
|
-
}
|
|
181805
|
-
});
|
|
181864
|
+
return filterEntrypoints(entrypoints, isSymlink ? (entrypoint) => entrypoint.replace(packageJson.packageDirectory, real) : void 0);
|
|
181806
181865
|
}
|
|
181807
181866
|
}
|
|
181867
|
+
function filterEntrypoints(entrypoints, symlinkName) {
|
|
181868
|
+
return mapDefined(entrypoints, (entrypoint) => {
|
|
181869
|
+
const resolvedFileName = symlinkName ? symlinkName(entrypoint) : entrypoint;
|
|
181870
|
+
if (!program.getSourceFile(resolvedFileName) && !(symlinkName && program.getSourceFile(entrypoint))) {
|
|
181871
|
+
return resolvedFileName;
|
|
181872
|
+
}
|
|
181873
|
+
});
|
|
181874
|
+
}
|
|
181808
181875
|
}
|
|
181809
181876
|
/** @internal */
|
|
181810
181877
|
static create(dependencySelection, hostProject, host, documentRegistry) {
|
|
@@ -183147,11 +183214,18 @@ var _ProjectService = class _ProjectService {
|
|
|
183147
183214
|
if (config.updateLevel !== 2 /* Full */)
|
|
183148
183215
|
config.updateLevel = 1 /* RootNamesAndUpdate */;
|
|
183149
183216
|
config.projects.forEach((watchWildcardDirectories, projectCanonicalPath) => {
|
|
183217
|
+
var _a;
|
|
183150
183218
|
if (!watchWildcardDirectories)
|
|
183151
183219
|
return;
|
|
183152
183220
|
const project = this.getConfiguredProjectByCanonicalConfigFilePath(projectCanonicalPath);
|
|
183153
183221
|
if (!project)
|
|
183154
183222
|
return;
|
|
183223
|
+
if (configuredProjectForConfig !== project && this.getHostPreferences().includeCompletionsForModuleExports) {
|
|
183224
|
+
const path = this.toPath(configFileName);
|
|
183225
|
+
if (find((_a = project.getCurrentProgram()) == null ? void 0 : _a.getResolvedProjectReferences(), (ref) => (ref == null ? void 0 : ref.sourceFile.path) === path)) {
|
|
183226
|
+
project.markAutoImportProviderAsDirty();
|
|
183227
|
+
}
|
|
183228
|
+
}
|
|
183155
183229
|
const updateLevel = configuredProjectForConfig === project ? 1 /* RootNamesAndUpdate */ : 0 /* Update */;
|
|
183156
183230
|
if (project.pendingUpdateLevel !== void 0 && project.pendingUpdateLevel > updateLevel)
|
|
183157
183231
|
return;
|
|
@@ -183200,6 +183274,7 @@ var _ProjectService = class _ProjectService {
|
|
|
183200
183274
|
let scheduledAnyProjectUpdate = false;
|
|
183201
183275
|
configFileExistenceInfo.config.updateLevel = 2 /* Full */;
|
|
183202
183276
|
configFileExistenceInfo.config.projects.forEach((_watchWildcardDirectories, projectCanonicalPath) => {
|
|
183277
|
+
var _a;
|
|
183203
183278
|
const project = this.getConfiguredProjectByCanonicalConfigFilePath(projectCanonicalPath);
|
|
183204
183279
|
if (!project)
|
|
183205
183280
|
return;
|
|
@@ -183210,9 +183285,14 @@ var _ProjectService = class _ProjectService {
|
|
|
183210
183285
|
project.pendingUpdateLevel = 2 /* Full */;
|
|
183211
183286
|
project.pendingUpdateReason = loadReason;
|
|
183212
183287
|
this.delayUpdateProjectGraph(project);
|
|
183288
|
+
project.markAutoImportProviderAsDirty();
|
|
183213
183289
|
} else {
|
|
183214
|
-
|
|
183290
|
+
const path = this.toPath(canonicalConfigFilePath);
|
|
183291
|
+
project.resolutionCache.removeResolutionsFromProjectReferenceRedirects(path);
|
|
183215
183292
|
this.delayUpdateProjectGraph(project);
|
|
183293
|
+
if (this.getHostPreferences().includeCompletionsForModuleExports && find((_a = project.getCurrentProgram()) == null ? void 0 : _a.getResolvedProjectReferences(), (ref) => (ref == null ? void 0 : ref.sourceFile.path) === path)) {
|
|
183294
|
+
project.markAutoImportProviderAsDirty();
|
|
183295
|
+
}
|
|
183216
183296
|
}
|
|
183217
183297
|
});
|
|
183218
183298
|
return scheduledAnyProjectUpdate;
|
|
@@ -184677,7 +184757,8 @@ Dynamic files must always be opened with service's current directory or service
|
|
|
184677
184757
|
if (args.preferences) {
|
|
184678
184758
|
const {
|
|
184679
184759
|
lazyConfiguredProjectsFromExternalProject,
|
|
184680
|
-
includePackageJsonAutoImports
|
|
184760
|
+
includePackageJsonAutoImports,
|
|
184761
|
+
includeCompletionsForModuleExports
|
|
184681
184762
|
} = this.hostConfiguration.preferences;
|
|
184682
184763
|
this.hostConfiguration.preferences = { ...this.hostConfiguration.preferences, ...args.preferences };
|
|
184683
184764
|
if (lazyConfiguredProjectsFromExternalProject && !this.hostConfiguration.preferences.lazyConfiguredProjectsFromExternalProject) {
|
|
@@ -184689,7 +184770,7 @@ Dynamic files must always be opened with service's current directory or service
|
|
|
184689
184770
|
})
|
|
184690
184771
|
);
|
|
184691
184772
|
}
|
|
184692
|
-
if (includePackageJsonAutoImports !== args.preferences.includePackageJsonAutoImports) {
|
|
184773
|
+
if (includePackageJsonAutoImports !== args.preferences.includePackageJsonAutoImports || !!includeCompletionsForModuleExports !== !!args.preferences.includeCompletionsForModuleExports) {
|
|
184693
184774
|
this.forEachProject((project) => {
|
|
184694
184775
|
project.onAutoImportProviderSettingsChanged();
|
|
184695
184776
|
});
|
|
@@ -185100,7 +185181,12 @@ Dynamic files must always be opened with service's current directory or service
|
|
|
185100
185181
|
return result;
|
|
185101
185182
|
}
|
|
185102
185183
|
removeOrphanConfiguredProjects(toRetainConfiguredProjects) {
|
|
185103
|
-
const
|
|
185184
|
+
const orphanConfiguredProjects = this.getOrphanConfiguredProjects(toRetainConfiguredProjects);
|
|
185185
|
+
orphanConfiguredProjects.forEach((project) => this.removeProject(project));
|
|
185186
|
+
}
|
|
185187
|
+
/** @internal */
|
|
185188
|
+
getOrphanConfiguredProjects(toRetainConfiguredProjects) {
|
|
185189
|
+
const toRemoveConfiguredProjects = new Set(this.configuredProjects.values());
|
|
185104
185190
|
const markOriginalProjectsAsUsed = (project) => {
|
|
185105
185191
|
if (project.originalConfiguredProjects && (isConfiguredProject(project) || !project.isOrphan())) {
|
|
185106
185192
|
project.originalConfiguredProjects.forEach(
|
|
@@ -185121,7 +185207,7 @@ Dynamic files must always be opened with service's current directory or service
|
|
|
185121
185207
|
this.inferredProjects.forEach(markOriginalProjectsAsUsed);
|
|
185122
185208
|
this.externalProjects.forEach(markOriginalProjectsAsUsed);
|
|
185123
185209
|
this.configuredProjects.forEach((project) => {
|
|
185124
|
-
if (!toRemoveConfiguredProjects.has(project
|
|
185210
|
+
if (!toRemoveConfiguredProjects.has(project))
|
|
185125
185211
|
return;
|
|
185126
185212
|
if (project.hasOpenRef()) {
|
|
185127
185213
|
retainConfiguredProject(project);
|
|
@@ -185129,12 +185215,12 @@ Dynamic files must always be opened with service's current directory or service
|
|
|
185129
185215
|
retainConfiguredProject(project);
|
|
185130
185216
|
}
|
|
185131
185217
|
});
|
|
185132
|
-
toRemoveConfiguredProjects
|
|
185218
|
+
return toRemoveConfiguredProjects;
|
|
185133
185219
|
function isRetained(project) {
|
|
185134
|
-
return !toRemoveConfiguredProjects.has(project
|
|
185220
|
+
return !toRemoveConfiguredProjects.has(project) || project.hasOpenRef();
|
|
185135
185221
|
}
|
|
185136
185222
|
function retainConfiguredProject(project) {
|
|
185137
|
-
if (toRemoveConfiguredProjects.delete(project
|
|
185223
|
+
if (toRemoveConfiguredProjects.delete(project)) {
|
|
185138
185224
|
markOriginalProjectsAsUsed(project);
|
|
185139
185225
|
forEachReferencedProject(project, retainConfiguredProject);
|
|
185140
185226
|
}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "typescript",
|
|
3
3
|
"author": "Microsoft Corp.",
|
|
4
4
|
"homepage": "https://www.typescriptlang.org/",
|
|
5
|
-
"version": "5.5.0-dev.
|
|
5
|
+
"version": "5.5.0-dev.20240419",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"description": "TypeScript is a language for application scale JavaScript development",
|
|
8
8
|
"keywords": [
|
|
@@ -63,7 +63,6 @@
|
|
|
63
63
|
"eslint": "^8.57.0",
|
|
64
64
|
"eslint-formatter-autolinkable-stylish": "^1.3.0",
|
|
65
65
|
"eslint-plugin-local": "^4.2.1",
|
|
66
|
-
"eslint-plugin-no-null": "^1.0.2",
|
|
67
66
|
"fast-xml-parser": "^4.3.6",
|
|
68
67
|
"glob": "^10.3.10",
|
|
69
68
|
"hereby": "^1.8.9",
|
|
@@ -111,5 +110,5 @@
|
|
|
111
110
|
"node": "20.1.0",
|
|
112
111
|
"npm": "8.19.4"
|
|
113
112
|
},
|
|
114
|
-
"gitHead": "
|
|
113
|
+
"gitHead": "48870169dcc4b6626ddc9691cf72303e8a83e6f1"
|
|
115
114
|
}
|