@typescript-deploys/pr-build 5.4.0-pr-48838-21 → 5.4.0-pr-57029-10
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.esnext.collection.d.ts +29 -0
- package/lib/lib.esnext.d.ts +2 -0
- package/lib/lib.esnext.object.d.ts +29 -0
- package/lib/tsc.js +235 -77
- package/lib/tsserver.js +321 -86
- package/lib/typescript.d.ts +7 -2
- package/lib/typescript.js +321 -86
- package/lib/typingsInstaller.js +64 -14
- package/package.json +2 -2
package/lib/tsserver.js
CHANGED
|
@@ -898,6 +898,7 @@ __export(server_exports, {
|
|
|
898
898
|
getModuleSpecifierEndingPreference: () => getModuleSpecifierEndingPreference,
|
|
899
899
|
getModuleSpecifierResolverHost: () => getModuleSpecifierResolverHost,
|
|
900
900
|
getNameForExportedSymbol: () => getNameForExportedSymbol,
|
|
901
|
+
getNameFromImportAttribute: () => getNameFromImportAttribute,
|
|
901
902
|
getNameFromIndexInfo: () => getNameFromIndexInfo,
|
|
902
903
|
getNameFromPropertyName: () => getNameFromPropertyName,
|
|
903
904
|
getNameOfAccessExpression: () => getNameOfAccessExpression,
|
|
@@ -2340,7 +2341,7 @@ module.exports = __toCommonJS(server_exports);
|
|
|
2340
2341
|
|
|
2341
2342
|
// src/compiler/corePublic.ts
|
|
2342
2343
|
var versionMajorMinor = "5.4";
|
|
2343
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
2344
|
+
var version = `${versionMajorMinor}.0-insiders.20240112`;
|
|
2344
2345
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
2345
2346
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
2346
2347
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -6599,6 +6600,7 @@ var InternalSymbolName = /* @__PURE__ */ ((InternalSymbolName2) => {
|
|
|
6599
6600
|
InternalSymbolName2["Default"] = "default";
|
|
6600
6601
|
InternalSymbolName2["This"] = "this";
|
|
6601
6602
|
InternalSymbolName2["InstantiationExpression"] = "__instantiationExpression";
|
|
6603
|
+
InternalSymbolName2["ImportAttributes"] = "__importAttributes";
|
|
6602
6604
|
return InternalSymbolName2;
|
|
6603
6605
|
})(InternalSymbolName || {});
|
|
6604
6606
|
var NodeCheckFlags = /* @__PURE__ */ ((NodeCheckFlags2) => {
|
|
@@ -8446,6 +8448,7 @@ var sys = (() => {
|
|
|
8446
8448
|
resolvePath: (path) => _path.resolve(path),
|
|
8447
8449
|
fileExists,
|
|
8448
8450
|
directoryExists,
|
|
8451
|
+
getAccessibleFileSystemEntries,
|
|
8449
8452
|
createDirectory(directoryName) {
|
|
8450
8453
|
if (!nodeSystem.directoryExists(directoryName)) {
|
|
8451
8454
|
try {
|
|
@@ -10708,6 +10711,10 @@ var Diagnostics = {
|
|
|
10708
10711
|
Export_specifier_0_does_not_exist_in_package_json_scope_at_path_1: diag(6276, 3 /* Message */, "Export_specifier_0_does_not_exist_in_package_json_scope_at_path_1_6276", "Export specifier '{0}' does not exist in package.json scope at path '{1}'."),
|
|
10709
10712
|
Resolution_of_non_relative_name_failed_trying_with_modern_Node_resolution_features_disabled_to_see_if_npm_library_needs_configuration_update: diag(6277, 3 /* Message */, "Resolution_of_non_relative_name_failed_trying_with_modern_Node_resolution_features_disabled_to_see_i_6277", "Resolution of non-relative name failed; trying with modern Node resolution features disabled to see if npm library needs configuration update."),
|
|
10710
10713
|
There_are_types_at_0_but_this_result_could_not_be_resolved_when_respecting_package_json_exports_The_1_library_may_need_to_update_its_package_json_or_typings: diag(6278, 3 /* Message */, "There_are_types_at_0_but_this_result_could_not_be_resolved_when_respecting_package_json_exports_The__6278", `There are types at '{0}', but this result could not be resolved when respecting package.json "exports". The '{1}' library may need to update its package.json or typings.`),
|
|
10714
|
+
package_json_has_a_peerDependencies_field: diag(6279, 3 /* Message */, "package_json_has_a_peerDependencies_field_6279", "'package.json' has a 'peerDependencies' field."),
|
|
10715
|
+
Package_is_not_installed_using_pnpm_skipping_peerDependencies_version_resolution: diag(6280, 3 /* Message */, "Package_is_not_installed_using_pnpm_skipping_peerDependencies_version_resolution_6280", "Package is not installed using pnpm, skipping peerDependencies version resolution."),
|
|
10716
|
+
Found_peerDependency_0_with_1_version: diag(6281, 3 /* Message */, "Found_peerDependency_0_with_1_version_6281", "Found peerDependency '{0}' with '{1}' version."),
|
|
10717
|
+
Failed_to_find_peerDependency_0: diag(6282, 3 /* Message */, "Failed_to_find_peerDependency_0_6282", "Failed to find peerDependency '{0}'."),
|
|
10711
10718
|
Enable_project_compilation: diag(6302, 3 /* Message */, "Enable_project_compilation_6302", "Enable project compilation"),
|
|
10712
10719
|
Composite_projects_may_not_disable_declaration_emit: diag(6304, 1 /* Error */, "Composite_projects_may_not_disable_declaration_emit_6304", "Composite projects may not disable declaration emit."),
|
|
10713
10720
|
Output_file_0_has_not_been_built_from_source_file_1: diag(6305, 1 /* Error */, "Output_file_0_has_not_been_built_from_source_file_1_6305", "Output file '{0}' has not been built from source file '{1}'."),
|
|
@@ -15130,6 +15137,45 @@ function isRestParameter(node) {
|
|
|
15130
15137
|
const type = isJSDocParameterTag(node) ? node.typeExpression && node.typeExpression.type : node.type;
|
|
15131
15138
|
return node.dotDotDotToken !== void 0 || !!type && type.kind === 325 /* JSDocVariadicType */;
|
|
15132
15139
|
}
|
|
15140
|
+
function hasInternalAnnotation(range, sourceFile) {
|
|
15141
|
+
const comment = sourceFile.text.substring(range.pos, range.end);
|
|
15142
|
+
return comment.includes("@internal");
|
|
15143
|
+
}
|
|
15144
|
+
function isInternalDeclaration(node, sourceFile) {
|
|
15145
|
+
sourceFile ?? (sourceFile = getSourceFileOfNode(node));
|
|
15146
|
+
const parseTreeNode = getParseTreeNode(node);
|
|
15147
|
+
if (parseTreeNode && parseTreeNode.kind === 169 /* Parameter */) {
|
|
15148
|
+
const paramIdx = parseTreeNode.parent.parameters.indexOf(parseTreeNode);
|
|
15149
|
+
const previousSibling = paramIdx > 0 ? parseTreeNode.parent.parameters[paramIdx - 1] : void 0;
|
|
15150
|
+
const text = sourceFile.text;
|
|
15151
|
+
const commentRanges = previousSibling ? concatenate(
|
|
15152
|
+
// to handle
|
|
15153
|
+
// ... parameters, /** @internal */
|
|
15154
|
+
// public param: string
|
|
15155
|
+
getTrailingCommentRanges(text, skipTrivia(
|
|
15156
|
+
text,
|
|
15157
|
+
previousSibling.end + 1,
|
|
15158
|
+
/*stopAfterLineBreak*/
|
|
15159
|
+
false,
|
|
15160
|
+
/*stopAtComments*/
|
|
15161
|
+
true
|
|
15162
|
+
)),
|
|
15163
|
+
getLeadingCommentRanges(text, node.pos)
|
|
15164
|
+
) : getTrailingCommentRanges(text, skipTrivia(
|
|
15165
|
+
text,
|
|
15166
|
+
node.pos,
|
|
15167
|
+
/*stopAfterLineBreak*/
|
|
15168
|
+
false,
|
|
15169
|
+
/*stopAtComments*/
|
|
15170
|
+
true
|
|
15171
|
+
));
|
|
15172
|
+
return some(commentRanges) && hasInternalAnnotation(last(commentRanges), sourceFile);
|
|
15173
|
+
}
|
|
15174
|
+
const leadingCommentRanges = parseTreeNode && getLeadingCommentRangesOfNode(parseTreeNode, sourceFile);
|
|
15175
|
+
return !!forEach(leadingCommentRanges, (range) => {
|
|
15176
|
+
return hasInternalAnnotation(range, sourceFile);
|
|
15177
|
+
});
|
|
15178
|
+
}
|
|
15133
15179
|
|
|
15134
15180
|
// src/compiler/utilities.ts
|
|
15135
15181
|
var resolvingEmptyArray = [];
|
|
@@ -15297,13 +15343,13 @@ function createModuleNotFoundChain(sourceFile, host, moduleReference, mode, pack
|
|
|
15297
15343
|
return result;
|
|
15298
15344
|
}
|
|
15299
15345
|
function packageIdIsEqual(a, b) {
|
|
15300
|
-
return a === b || !!a && !!b && a.name === b.name && a.subModuleName === b.subModuleName && a.version === b.version;
|
|
15346
|
+
return a === b || !!a && !!b && a.name === b.name && a.subModuleName === b.subModuleName && a.version === b.version && a.peerDependencies === b.peerDependencies;
|
|
15301
15347
|
}
|
|
15302
15348
|
function packageIdToPackageName({ name, subModuleName }) {
|
|
15303
15349
|
return subModuleName ? `${name}/${subModuleName}` : name;
|
|
15304
15350
|
}
|
|
15305
15351
|
function packageIdToString(packageId) {
|
|
15306
|
-
return `${packageIdToPackageName(packageId)}@${packageId.version}`;
|
|
15352
|
+
return `${packageIdToPackageName(packageId)}@${packageId.version}${packageId.peerDependencies ?? ""}`;
|
|
15307
15353
|
}
|
|
15308
15354
|
function typeDirectiveIsEqualTo(oldResolution, newResolution) {
|
|
15309
15355
|
return oldResolution === newResolution || oldResolution.resolvedTypeReferenceDirective === newResolution.resolvedTypeReferenceDirective || !!oldResolution.resolvedTypeReferenceDirective && !!newResolution.resolvedTypeReferenceDirective && oldResolution.resolvedTypeReferenceDirective.resolvedFileName === newResolution.resolvedTypeReferenceDirective.resolvedFileName && !!oldResolution.resolvedTypeReferenceDirective.primary === !!newResolution.resolvedTypeReferenceDirective.primary && oldResolution.resolvedTypeReferenceDirective.originalPath === newResolution.resolvedTypeReferenceDirective.originalPath;
|
|
@@ -21902,6 +21948,9 @@ var stringReplace = String.prototype.replace;
|
|
|
21902
21948
|
function replaceFirstStar(s, replacement) {
|
|
21903
21949
|
return stringReplace.call(s, "*", replacement);
|
|
21904
21950
|
}
|
|
21951
|
+
function getNameFromImportAttribute(node) {
|
|
21952
|
+
return isIdentifier(node.name) ? node.name.escapedText : escapeLeadingUnderscores(node.name.text);
|
|
21953
|
+
}
|
|
21905
21954
|
|
|
21906
21955
|
// src/compiler/factory/baseNodeFactory.ts
|
|
21907
21956
|
function createBaseNodeFactory() {
|
|
@@ -38503,7 +38552,7 @@ var libEntries = [
|
|
|
38503
38552
|
["es2023.array", "lib.es2023.array.d.ts"],
|
|
38504
38553
|
["es2023.collection", "lib.es2023.collection.d.ts"],
|
|
38505
38554
|
["esnext.array", "lib.es2023.array.d.ts"],
|
|
38506
|
-
["esnext.collection", "lib.
|
|
38555
|
+
["esnext.collection", "lib.esnext.collection.d.ts"],
|
|
38507
38556
|
["esnext.symbol", "lib.es2019.symbol.d.ts"],
|
|
38508
38557
|
["esnext.asynciterable", "lib.es2018.asynciterable.d.ts"],
|
|
38509
38558
|
["esnext.intl", "lib.esnext.intl.d.ts"],
|
|
@@ -38513,6 +38562,7 @@ var libEntries = [
|
|
|
38513
38562
|
["esnext.promise", "lib.esnext.promise.d.ts"],
|
|
38514
38563
|
["esnext.weakref", "lib.es2021.weakref.d.ts"],
|
|
38515
38564
|
["esnext.decorators", "lib.esnext.decorators.d.ts"],
|
|
38565
|
+
["esnext.object", "lib.esnext.object.d.ts"],
|
|
38516
38566
|
["decorators", "lib.decorators.d.ts"],
|
|
38517
38567
|
["decorators.legacy", "lib.decorators.legacy.d.ts"]
|
|
38518
38568
|
];
|
|
@@ -41620,7 +41670,7 @@ function trace(host, message, ...args) {
|
|
|
41620
41670
|
function isTraceEnabled(compilerOptions, host) {
|
|
41621
41671
|
return !!compilerOptions.traceResolution && host.trace !== void 0;
|
|
41622
41672
|
}
|
|
41623
|
-
function withPackageId(packageInfo, r) {
|
|
41673
|
+
function withPackageId(packageInfo, r, state) {
|
|
41624
41674
|
let packageId;
|
|
41625
41675
|
if (r && packageInfo) {
|
|
41626
41676
|
const packageJsonContent = packageInfo.contents.packageJsonContent;
|
|
@@ -41628,7 +41678,8 @@ function withPackageId(packageInfo, r) {
|
|
|
41628
41678
|
packageId = {
|
|
41629
41679
|
name: packageJsonContent.name,
|
|
41630
41680
|
subModuleName: r.path.slice(packageInfo.packageDirectory.length + directorySeparator.length),
|
|
41631
|
-
version: packageJsonContent.version
|
|
41681
|
+
version: packageJsonContent.version,
|
|
41682
|
+
peerDependencies: getPeerDependenciesOfPackageJsonInfo(packageInfo, state)
|
|
41632
41683
|
};
|
|
41633
41684
|
}
|
|
41634
41685
|
}
|
|
@@ -41638,7 +41689,9 @@ function noPackageId(r) {
|
|
|
41638
41689
|
return withPackageId(
|
|
41639
41690
|
/*packageInfo*/
|
|
41640
41691
|
void 0,
|
|
41641
|
-
r
|
|
41692
|
+
r,
|
|
41693
|
+
/*state*/
|
|
41694
|
+
void 0
|
|
41642
41695
|
);
|
|
41643
41696
|
}
|
|
41644
41697
|
function removeIgnoredPackageId(r) {
|
|
@@ -42015,7 +42068,7 @@ function resolveTypeReferenceDirective(typeReferenceDirectiveName, containingFil
|
|
|
42015
42068
|
false,
|
|
42016
42069
|
moduleResolutionState
|
|
42017
42070
|
) : void 0;
|
|
42018
|
-
return resolvedTypeScriptOnly(withPackageId(packageInfo, resolvedFromFile));
|
|
42071
|
+
return resolvedTypeScriptOnly(withPackageId(packageInfo, resolvedFromFile, moduleResolutionState));
|
|
42019
42072
|
}
|
|
42020
42073
|
}
|
|
42021
42074
|
return resolvedTypeScriptOnly(
|
|
@@ -42984,7 +43037,7 @@ function nodeLoadModuleByRelativeName(extensions, candidate, onlyRecordFailures,
|
|
|
42984
43037
|
false,
|
|
42985
43038
|
state
|
|
42986
43039
|
) : void 0;
|
|
42987
|
-
return withPackageId(packageInfo, resolvedFromFile);
|
|
43040
|
+
return withPackageId(packageInfo, resolvedFromFile, state);
|
|
42988
43041
|
}
|
|
42989
43042
|
}
|
|
42990
43043
|
if (!onlyRecordFailures) {
|
|
@@ -43127,7 +43180,7 @@ function loadNodeModuleFromDirectory(extensions, candidate, onlyRecordFailures,
|
|
|
43127
43180
|
const packageInfo = considerPackageJson ? getPackageJsonInfo(candidate, onlyRecordFailures, state) : void 0;
|
|
43128
43181
|
const packageJsonContent = packageInfo && packageInfo.contents.packageJsonContent;
|
|
43129
43182
|
const versionPaths = packageInfo && getVersionPathsOfPackageJsonInfo(packageInfo, state);
|
|
43130
|
-
return withPackageId(packageInfo, loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFailures, state, packageJsonContent, versionPaths));
|
|
43183
|
+
return withPackageId(packageInfo, loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFailures, state, packageJsonContent, versionPaths), state);
|
|
43131
43184
|
}
|
|
43132
43185
|
function getEntrypointsFromPackageJsonInfo(packageJsonInfo, options, host, cache, resolveJs) {
|
|
43133
43186
|
if (!resolveJs && packageJsonInfo.contents.resolvedEntrypoints !== void 0) {
|
|
@@ -43282,6 +43335,47 @@ function getVersionPathsOfPackageJsonInfo(packageJsonInfo, state) {
|
|
|
43282
43335
|
}
|
|
43283
43336
|
return packageJsonInfo.contents.versionPaths || void 0;
|
|
43284
43337
|
}
|
|
43338
|
+
function getPeerDependenciesOfPackageJsonInfo(packageJsonInfo, state) {
|
|
43339
|
+
if (packageJsonInfo.contents.peerDependencies === void 0) {
|
|
43340
|
+
packageJsonInfo.contents.peerDependencies = readPackageJsonPeerDependencies(packageJsonInfo, state) || false;
|
|
43341
|
+
}
|
|
43342
|
+
return packageJsonInfo.contents.peerDependencies || void 0;
|
|
43343
|
+
}
|
|
43344
|
+
function readPackageJsonPeerDependencies(packageJsonInfo, state) {
|
|
43345
|
+
const peerDependencies = readPackageJsonField(packageJsonInfo.contents.packageJsonContent, "peerDependencies", "object", state);
|
|
43346
|
+
if (peerDependencies === void 0)
|
|
43347
|
+
return void 0;
|
|
43348
|
+
if (state.traceEnabled)
|
|
43349
|
+
trace(state.host, Diagnostics.package_json_has_a_peerDependencies_field);
|
|
43350
|
+
const packageDirectory = realPath(packageJsonInfo.packageDirectory, state.host, state.traceEnabled);
|
|
43351
|
+
if (packageDirectory.indexOf(".pnpm") === -1) {
|
|
43352
|
+
if (state.traceEnabled)
|
|
43353
|
+
trace(state.host, Diagnostics.Package_is_not_installed_using_pnpm_skipping_peerDependencies_version_resolution);
|
|
43354
|
+
return void 0;
|
|
43355
|
+
}
|
|
43356
|
+
const nodeModules = packageDirectory.substring(0, packageDirectory.lastIndexOf("node_modules") + "node_modules".length) + directorySeparator;
|
|
43357
|
+
let result = "";
|
|
43358
|
+
for (const key in peerDependencies) {
|
|
43359
|
+
if (hasProperty(peerDependencies, key)) {
|
|
43360
|
+
const peerPackageJson = getPackageJsonInfo(
|
|
43361
|
+
nodeModules + key,
|
|
43362
|
+
/*onlyRecordFailures*/
|
|
43363
|
+
false,
|
|
43364
|
+
state
|
|
43365
|
+
);
|
|
43366
|
+
if (peerPackageJson) {
|
|
43367
|
+
const version2 = peerPackageJson.contents.packageJsonContent.version;
|
|
43368
|
+
result += `+${key}@${version2}`;
|
|
43369
|
+
if (state.traceEnabled)
|
|
43370
|
+
trace(state.host, Diagnostics.Found_peerDependency_0_with_1_version, key, version2);
|
|
43371
|
+
} else {
|
|
43372
|
+
if (state.traceEnabled)
|
|
43373
|
+
trace(state.host, Diagnostics.Failed_to_find_peerDependency_0, key);
|
|
43374
|
+
}
|
|
43375
|
+
}
|
|
43376
|
+
}
|
|
43377
|
+
return result;
|
|
43378
|
+
}
|
|
43285
43379
|
function getPackageJsonInfo(packageDirectory, onlyRecordFailures, state) {
|
|
43286
43380
|
var _a, _b, _c, _d, _e, _f;
|
|
43287
43381
|
const { host, traceEnabled } = state;
|
|
@@ -43310,7 +43404,7 @@ function getPackageJsonInfo(packageDirectory, onlyRecordFailures, state) {
|
|
|
43310
43404
|
if (traceEnabled) {
|
|
43311
43405
|
trace(host, Diagnostics.Found_package_json_at_0, packageJsonPath);
|
|
43312
43406
|
}
|
|
43313
|
-
const result = { packageDirectory, contents: { packageJsonContent, versionPaths: void 0, resolvedEntrypoints: void 0 } };
|
|
43407
|
+
const result = { packageDirectory, contents: { packageJsonContent, versionPaths: void 0, resolvedEntrypoints: void 0, peerDependencies: void 0 } };
|
|
43314
43408
|
if (state.packageJsonInfoCache && !state.packageJsonInfoCache.isReadonly)
|
|
43315
43409
|
state.packageJsonInfoCache.setPackageJsonInfo(packageJsonPath, result);
|
|
43316
43410
|
(_e = state.affectingLocations) == null ? void 0 : _e.push(packageJsonPath);
|
|
@@ -43718,7 +43812,7 @@ function getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirec
|
|
|
43718
43812
|
/*onlyRecordFailures*/
|
|
43719
43813
|
false,
|
|
43720
43814
|
state
|
|
43721
|
-
)));
|
|
43815
|
+
), state));
|
|
43722
43816
|
} else if (typeof target === "object" && target !== null) {
|
|
43723
43817
|
if (!Array.isArray(target)) {
|
|
43724
43818
|
traceIfEnabled(state, Diagnostics.Entering_conditional_exports);
|
|
@@ -43832,7 +43926,7 @@ function getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirec
|
|
|
43832
43926
|
/*onlyRecordFailures*/
|
|
43833
43927
|
false,
|
|
43834
43928
|
state
|
|
43835
|
-
)));
|
|
43929
|
+
), state));
|
|
43836
43930
|
}
|
|
43837
43931
|
}
|
|
43838
43932
|
}
|
|
@@ -43963,7 +44057,7 @@ function loadModuleFromSpecificNodeModulesDirectory(extensions, moduleName, node
|
|
|
43963
44057
|
packageInfo.contents.packageJsonContent,
|
|
43964
44058
|
getVersionPathsOfPackageJsonInfo(packageInfo, state)
|
|
43965
44059
|
);
|
|
43966
|
-
return withPackageId(packageInfo, fromDirectory);
|
|
44060
|
+
return withPackageId(packageInfo, fromDirectory, state);
|
|
43967
44061
|
}
|
|
43968
44062
|
const loader = (extensions2, candidate2, onlyRecordFailures, state2) => {
|
|
43969
44063
|
let pathAndExtension = (rest || !(state2.features & 32 /* EsmMode */)) && loadModuleFromFile(extensions2, candidate2, onlyRecordFailures, state2) || loadNodeModuleFromDirectoryWorker(
|
|
@@ -43977,7 +44071,7 @@ function loadModuleFromSpecificNodeModulesDirectory(extensions, moduleName, node
|
|
|
43977
44071
|
if (!pathAndExtension && packageInfo && (packageInfo.contents.packageJsonContent.exports === void 0 || packageInfo.contents.packageJsonContent.exports === null) && state2.features & 32 /* EsmMode */) {
|
|
43978
44072
|
pathAndExtension = loadModuleFromFile(extensions2, combinePaths(candidate2, "index.js"), onlyRecordFailures, state2);
|
|
43979
44073
|
}
|
|
43980
|
-
return withPackageId(packageInfo, pathAndExtension);
|
|
44074
|
+
return withPackageId(packageInfo, pathAndExtension, state2);
|
|
43981
44075
|
};
|
|
43982
44076
|
if (rest !== "") {
|
|
43983
44077
|
packageInfo = rootPackageInfo ?? getPackageJsonInfo(packageDirectory, !nodeModulesDirectoryExists, state);
|
|
@@ -44180,7 +44274,7 @@ function resolveFromTypeRoot(moduleName, state) {
|
|
|
44180
44274
|
false,
|
|
44181
44275
|
state
|
|
44182
44276
|
) : void 0;
|
|
44183
|
-
return toSearchResult(withPackageId(packageInfo, resolvedFromFile));
|
|
44277
|
+
return toSearchResult(withPackageId(packageInfo, resolvedFromFile, state));
|
|
44184
44278
|
}
|
|
44185
44279
|
const resolved = loadNodeModuleFromDirectory(4 /* Declaration */, candidate, !directoryExists, state);
|
|
44186
44280
|
if (resolved)
|
|
@@ -49184,6 +49278,7 @@ function createTypeChecker(host) {
|
|
|
49184
49278
|
var deferredGlobalImportMetaType;
|
|
49185
49279
|
var deferredGlobalImportMetaExpressionType;
|
|
49186
49280
|
var deferredGlobalImportCallOptionsType;
|
|
49281
|
+
var deferredGlobalImportAttributesType;
|
|
49187
49282
|
var deferredGlobalDisposableType;
|
|
49188
49283
|
var deferredGlobalAsyncDisposableType;
|
|
49189
49284
|
var deferredGlobalExtractSymbol;
|
|
@@ -49340,7 +49435,12 @@ function createTypeChecker(host) {
|
|
|
49340
49435
|
}
|
|
49341
49436
|
function markAsSynthetic(node) {
|
|
49342
49437
|
setTextRangePosEnd(node, -1, -1);
|
|
49343
|
-
return visitEachChild(
|
|
49438
|
+
return visitEachChild(
|
|
49439
|
+
node,
|
|
49440
|
+
markAsSynthetic,
|
|
49441
|
+
/*context*/
|
|
49442
|
+
void 0
|
|
49443
|
+
);
|
|
49344
49444
|
}
|
|
49345
49445
|
function getEmitResolver(sourceFile, cancellationToken2) {
|
|
49346
49446
|
getDiagnostics2(sourceFile, cancellationToken2);
|
|
@@ -53382,7 +53482,13 @@ function createTypeChecker(host) {
|
|
|
53382
53482
|
if (!nodeIsSynthesized(node) && getParseTreeNode(node) === node) {
|
|
53383
53483
|
return node;
|
|
53384
53484
|
}
|
|
53385
|
-
return setTextRange(factory.cloneNode(visitEachChild(
|
|
53485
|
+
return setTextRange(factory.cloneNode(visitEachChild(
|
|
53486
|
+
node,
|
|
53487
|
+
deepCloneOrReuseNode,
|
|
53488
|
+
/*context*/
|
|
53489
|
+
void 0,
|
|
53490
|
+
deepCloneOrReuseNodes
|
|
53491
|
+
)), node);
|
|
53386
53492
|
}
|
|
53387
53493
|
function deepCloneOrReuseNodes(nodes, visitor, test, start2, count) {
|
|
53388
53494
|
if (nodes && nodes.length === 0) {
|
|
@@ -54104,7 +54210,8 @@ function createTypeChecker(host) {
|
|
|
54104
54210
|
let visited = visitEachChild(
|
|
54105
54211
|
node2,
|
|
54106
54212
|
elideInitializerAndSetEmitFlags,
|
|
54107
|
-
|
|
54213
|
+
/*context*/
|
|
54214
|
+
void 0,
|
|
54108
54215
|
/*nodesVisitor*/
|
|
54109
54216
|
void 0,
|
|
54110
54217
|
elideInitializerAndSetEmitFlags
|
|
@@ -54882,7 +54989,12 @@ function createTypeChecker(host) {
|
|
|
54882
54989
|
if (file && isTupleTypeNode(node) && getLineAndCharacterOfPosition(file, node.pos).line === getLineAndCharacterOfPosition(file, node.end).line) {
|
|
54883
54990
|
setEmitFlags(node, 1 /* SingleLine */);
|
|
54884
54991
|
}
|
|
54885
|
-
return visitEachChild(
|
|
54992
|
+
return visitEachChild(
|
|
54993
|
+
node,
|
|
54994
|
+
visitExistingNodeTreeSymbols,
|
|
54995
|
+
/*context*/
|
|
54996
|
+
void 0
|
|
54997
|
+
);
|
|
54886
54998
|
function getEffectiveDotDotDotForParameter(p) {
|
|
54887
54999
|
return p.dotDotDotToken || (p.type && isJSDocVariadicType(p.type) ? factory.createToken(26 /* DotDotDotToken */) : void 0);
|
|
54888
55000
|
}
|
|
@@ -54982,7 +55094,7 @@ function createTypeChecker(host) {
|
|
|
54982
55094
|
});
|
|
54983
55095
|
let addingDeclare = !bundled;
|
|
54984
55096
|
const exportEquals = symbolTable.get("export=" /* ExportEquals */);
|
|
54985
|
-
if (exportEquals && symbolTable.size > 1 && exportEquals.flags & 2097152 /* Alias */) {
|
|
55097
|
+
if (exportEquals && symbolTable.size > 1 && exportEquals.flags & (2097152 /* Alias */ | 1536 /* Module */)) {
|
|
54986
55098
|
symbolTable = createSymbolTable();
|
|
54987
55099
|
symbolTable.set("export=" /* ExportEquals */, exportEquals);
|
|
54988
55100
|
}
|
|
@@ -55439,8 +55551,18 @@ function createTypeChecker(host) {
|
|
|
55439
55551
|
);
|
|
55440
55552
|
}
|
|
55441
55553
|
function getNamespaceMembersForSerialization(symbol) {
|
|
55442
|
-
|
|
55443
|
-
|
|
55554
|
+
let exports2 = arrayFrom(getExportsOfSymbol(symbol).values());
|
|
55555
|
+
const merged = getMergedSymbol(symbol);
|
|
55556
|
+
if (merged !== symbol) {
|
|
55557
|
+
const membersSet = new Set(exports2);
|
|
55558
|
+
for (const exported of getExportsOfSymbol(merged).values()) {
|
|
55559
|
+
if (!(getSymbolFlags(resolveSymbol(exported)) & 111551 /* Value */)) {
|
|
55560
|
+
membersSet.add(exported);
|
|
55561
|
+
}
|
|
55562
|
+
}
|
|
55563
|
+
exports2 = arrayFrom(membersSet);
|
|
55564
|
+
}
|
|
55565
|
+
return filter(exports2, (m) => isNamespaceMember(m) && isIdentifierText(m.escapedName, 99 /* ESNext */));
|
|
55444
55566
|
}
|
|
55445
55567
|
function isTypeOnlyNamespace(symbol) {
|
|
55446
55568
|
return every(getNamespaceMembersForSerialization(symbol), (m) => !(getSymbolFlags(resolveSymbol(m)) & 111551 /* Value */));
|
|
@@ -57421,7 +57543,7 @@ function createTypeChecker(host) {
|
|
|
57421
57543
|
/*reportErrors*/
|
|
57422
57544
|
false
|
|
57423
57545
|
) : unknownType;
|
|
57424
|
-
return addOptionality(widenTypeInferredFromInitializer(element, checkDeclarationInitializer(element, 0 /* Normal */, contextualType)));
|
|
57546
|
+
return addOptionality(widenTypeInferredFromInitializer(element, checkDeclarationInitializer(element, reportErrors2 ? 0 /* Normal */ : 1 /* Contextual */, contextualType)));
|
|
57425
57547
|
}
|
|
57426
57548
|
if (isBindingPattern(element.name)) {
|
|
57427
57549
|
return getTypeFromBindingPattern(element.name, includePatternInType, reportErrors2);
|
|
@@ -57502,6 +57624,24 @@ function createTypeChecker(host) {
|
|
|
57502
57624
|
0 /* Normal */
|
|
57503
57625
|
), declaration, reportErrors2);
|
|
57504
57626
|
}
|
|
57627
|
+
function getTypeFromImportAttributes(node) {
|
|
57628
|
+
const links = getNodeLinks(node);
|
|
57629
|
+
if (!links.resolvedType) {
|
|
57630
|
+
const symbol = createSymbol(4096 /* ObjectLiteral */, "__importAttributes" /* ImportAttributes */);
|
|
57631
|
+
const members = createSymbolTable();
|
|
57632
|
+
forEach(node.elements, (attr) => {
|
|
57633
|
+
const member = createSymbol(4 /* Property */, getNameFromImportAttribute(attr));
|
|
57634
|
+
member.parent = symbol;
|
|
57635
|
+
member.links.type = checkImportAttribute(attr);
|
|
57636
|
+
member.links.target = member;
|
|
57637
|
+
members.set(member.escapedName, member);
|
|
57638
|
+
});
|
|
57639
|
+
const type = createAnonymousType(symbol, members, emptyArray, emptyArray, emptyArray);
|
|
57640
|
+
type.objectFlags |= 128 /* ObjectLiteral */ | 262144 /* NonInferrableType */;
|
|
57641
|
+
links.resolvedType = type;
|
|
57642
|
+
}
|
|
57643
|
+
return links.resolvedType;
|
|
57644
|
+
}
|
|
57505
57645
|
function isGlobalSymbolConstructor(node) {
|
|
57506
57646
|
const symbol = getSymbolOfNode(node);
|
|
57507
57647
|
const globalSymbol = getGlobalESSymbolConstructorTypeSymbol(
|
|
@@ -57555,18 +57695,18 @@ function createTypeChecker(host) {
|
|
|
57555
57695
|
}
|
|
57556
57696
|
return false;
|
|
57557
57697
|
}
|
|
57558
|
-
function getTypeOfVariableOrParameterOrProperty(symbol) {
|
|
57698
|
+
function getTypeOfVariableOrParameterOrProperty(symbol, checkMode) {
|
|
57559
57699
|
const links = getSymbolLinks(symbol);
|
|
57560
57700
|
if (!links.type) {
|
|
57561
|
-
const type = getTypeOfVariableOrParameterOrPropertyWorker(symbol);
|
|
57562
|
-
if (!links.type && !isParameterOfContextSensitiveSignature(symbol)) {
|
|
57701
|
+
const type = getTypeOfVariableOrParameterOrPropertyWorker(symbol, checkMode);
|
|
57702
|
+
if (!links.type && !isParameterOfContextSensitiveSignature(symbol) && !checkMode) {
|
|
57563
57703
|
links.type = type;
|
|
57564
57704
|
}
|
|
57565
57705
|
return type;
|
|
57566
57706
|
}
|
|
57567
57707
|
return links.type;
|
|
57568
57708
|
}
|
|
57569
|
-
function getTypeOfVariableOrParameterOrPropertyWorker(symbol) {
|
|
57709
|
+
function getTypeOfVariableOrParameterOrPropertyWorker(symbol, checkMode) {
|
|
57570
57710
|
if (symbol.flags & 4194304 /* Prototype */) {
|
|
57571
57711
|
return getTypeOfPrototypeProperty(symbol);
|
|
57572
57712
|
}
|
|
@@ -57604,6 +57744,9 @@ function createTypeChecker(host) {
|
|
|
57604
57744
|
if (symbol.flags & 512 /* ValueModule */ && !(symbol.flags & 67108864 /* Assignment */)) {
|
|
57605
57745
|
return getTypeOfFuncClassEnumModule(symbol);
|
|
57606
57746
|
}
|
|
57747
|
+
if (isBindingElement(declaration) && checkMode === 1 /* Contextual */) {
|
|
57748
|
+
return errorType;
|
|
57749
|
+
}
|
|
57607
57750
|
return reportCircularityError(symbol);
|
|
57608
57751
|
}
|
|
57609
57752
|
let type;
|
|
@@ -57641,6 +57784,9 @@ function createTypeChecker(host) {
|
|
|
57641
57784
|
if (symbol.flags & 512 /* ValueModule */ && !(symbol.flags & 67108864 /* Assignment */)) {
|
|
57642
57785
|
return getTypeOfFuncClassEnumModule(symbol);
|
|
57643
57786
|
}
|
|
57787
|
+
if (isBindingElement(declaration) && checkMode === 1 /* Contextual */) {
|
|
57788
|
+
return type;
|
|
57789
|
+
}
|
|
57644
57790
|
return reportCircularityError(symbol);
|
|
57645
57791
|
}
|
|
57646
57792
|
return type;
|
|
@@ -57869,7 +58015,7 @@ function createTypeChecker(host) {
|
|
|
57869
58015
|
}
|
|
57870
58016
|
return getTypeOfSymbol(symbol);
|
|
57871
58017
|
}
|
|
57872
|
-
function getTypeOfSymbol(symbol) {
|
|
58018
|
+
function getTypeOfSymbol(symbol, checkMode) {
|
|
57873
58019
|
const checkFlags = getCheckFlags(symbol);
|
|
57874
58020
|
if (checkFlags & 65536 /* DeferredType */) {
|
|
57875
58021
|
return getTypeOfSymbolWithDeferredType(symbol);
|
|
@@ -57884,7 +58030,7 @@ function createTypeChecker(host) {
|
|
|
57884
58030
|
return getTypeOfReverseMappedSymbol(symbol);
|
|
57885
58031
|
}
|
|
57886
58032
|
if (symbol.flags & (3 /* Variable */ | 4 /* Property */)) {
|
|
57887
|
-
return getTypeOfVariableOrParameterOrProperty(symbol);
|
|
58033
|
+
return getTypeOfVariableOrParameterOrProperty(symbol, checkMode);
|
|
57888
58034
|
}
|
|
57889
58035
|
if (symbol.flags & (16 /* Function */ | 8192 /* Method */ | 32 /* Class */ | 384 /* Enum */ | 512 /* ValueModule */)) {
|
|
57890
58036
|
return getTypeOfFuncClassEnumModule(symbol);
|
|
@@ -61500,6 +61646,14 @@ function createTypeChecker(host) {
|
|
|
61500
61646
|
reportErrors2
|
|
61501
61647
|
)) || emptyObjectType;
|
|
61502
61648
|
}
|
|
61649
|
+
function getGlobalImportAttributesType(reportErrors2) {
|
|
61650
|
+
return deferredGlobalImportAttributesType || (deferredGlobalImportAttributesType = getGlobalType(
|
|
61651
|
+
"ImportAttributes",
|
|
61652
|
+
/*arity*/
|
|
61653
|
+
0,
|
|
61654
|
+
reportErrors2
|
|
61655
|
+
)) || emptyObjectType;
|
|
61656
|
+
}
|
|
61503
61657
|
function getGlobalESSymbolConstructorSymbol(reportErrors2) {
|
|
61504
61658
|
return deferredGlobalESSymbolConstructorSymbol || (deferredGlobalESSymbolConstructorSymbol = getGlobalValueSymbol("Symbol", reportErrors2));
|
|
61505
61659
|
}
|
|
@@ -72247,9 +72401,9 @@ function createTypeChecker(host) {
|
|
|
72247
72401
|
}
|
|
72248
72402
|
}
|
|
72249
72403
|
}
|
|
72250
|
-
function getNarrowedTypeOfSymbol(symbol, location) {
|
|
72404
|
+
function getNarrowedTypeOfSymbol(symbol, location, checkMode) {
|
|
72251
72405
|
var _a;
|
|
72252
|
-
const type = getTypeOfSymbol(symbol);
|
|
72406
|
+
const type = getTypeOfSymbol(symbol, checkMode);
|
|
72253
72407
|
const declaration = symbol.valueDeclaration;
|
|
72254
72408
|
if (declaration) {
|
|
72255
72409
|
if (isBindingElement(declaration) && !declaration.initializer && !declaration.dotDotDotToken && declaration.parent.elements.length >= 2) {
|
|
@@ -72376,7 +72530,7 @@ function createTypeChecker(host) {
|
|
|
72376
72530
|
}
|
|
72377
72531
|
}
|
|
72378
72532
|
checkNestedBlockScopedBinding(node, symbol);
|
|
72379
|
-
let type = getNarrowedTypeOfSymbol(localOrExportSymbol, node);
|
|
72533
|
+
let type = getNarrowedTypeOfSymbol(localOrExportSymbol, node, checkMode);
|
|
72380
72534
|
const assignmentKind = getAssignmentTargetKind(node);
|
|
72381
72535
|
if (assignmentKind) {
|
|
72382
72536
|
if (!(localOrExportSymbol.flags & 3 /* Variable */) && !(isInJSFile(node) && localOrExportSymbol.flags & 512 /* ValueModule */)) {
|
|
@@ -73583,7 +73737,7 @@ function createTypeChecker(host) {
|
|
|
73583
73737
|
function instantiateContextualType(contextualType, node, contextFlags) {
|
|
73584
73738
|
if (contextualType && maybeTypeOfKind(contextualType, 465829888 /* Instantiable */)) {
|
|
73585
73739
|
const inferenceContext = getInferenceContext(node);
|
|
73586
|
-
if (inferenceContext &&
|
|
73740
|
+
if (inferenceContext && contextFlags & 1 /* Signature */ && some(inferenceContext.inferences, hasInferenceCandidatesOrDefault)) {
|
|
73587
73741
|
return instantiateInstantiableTypes(contextualType, inferenceContext.nonFixingMapper);
|
|
73588
73742
|
}
|
|
73589
73743
|
if (inferenceContext == null ? void 0 : inferenceContext.returnMapper) {
|
|
@@ -73686,6 +73840,8 @@ function createTypeChecker(host) {
|
|
|
73686
73840
|
case 286 /* JsxOpeningElement */:
|
|
73687
73841
|
case 285 /* JsxSelfClosingElement */:
|
|
73688
73842
|
return getContextualJsxElementAttributesType(parent2, contextFlags);
|
|
73843
|
+
case 301 /* ImportAttribute */:
|
|
73844
|
+
return getContextualImportAttributeType(parent2);
|
|
73689
73845
|
}
|
|
73690
73846
|
return void 0;
|
|
73691
73847
|
}
|
|
@@ -73733,6 +73889,12 @@ function createTypeChecker(host) {
|
|
|
73733
73889
|
}
|
|
73734
73890
|
}
|
|
73735
73891
|
}
|
|
73892
|
+
function getContextualImportAttributeType(node) {
|
|
73893
|
+
return getTypeOfPropertyOfContextualType(getGlobalImportAttributesType(
|
|
73894
|
+
/*reportErrors*/
|
|
73895
|
+
false
|
|
73896
|
+
), getNameFromImportAttribute(node));
|
|
73897
|
+
}
|
|
73736
73898
|
function getContextualJsxElementAttributesType(node, contextFlags) {
|
|
73737
73899
|
if (isJsxOpeningElement(node) && contextFlags !== 4 /* Completions */) {
|
|
73738
73900
|
const index = findContextualNode(
|
|
@@ -85818,6 +85980,13 @@ function createTypeChecker(host) {
|
|
|
85818
85980
|
var _a;
|
|
85819
85981
|
const node = declaration.attributes;
|
|
85820
85982
|
if (node) {
|
|
85983
|
+
const importAttributesType = getGlobalImportAttributesType(
|
|
85984
|
+
/*reportErrors*/
|
|
85985
|
+
true
|
|
85986
|
+
);
|
|
85987
|
+
if (importAttributesType !== emptyObjectType) {
|
|
85988
|
+
checkTypeAssignableTo(getTypeFromImportAttributes(node), getNullableType(importAttributesType, 32768 /* Undefined */), node);
|
|
85989
|
+
}
|
|
85821
85990
|
const validForTypeAttributes = isExclusivelyTypeOnlyImportOrExport(declaration);
|
|
85822
85991
|
const override = getResolutionModeOverride(node, validForTypeAttributes ? grammarErrorOnNode : void 0);
|
|
85823
85992
|
const isImportAttributes2 = declaration.attributes.token === 118 /* WithKeyword */;
|
|
@@ -85837,6 +86006,9 @@ function createTypeChecker(host) {
|
|
|
85837
86006
|
}
|
|
85838
86007
|
}
|
|
85839
86008
|
}
|
|
86009
|
+
function checkImportAttribute(node) {
|
|
86010
|
+
return getRegularTypeOfLiteralType(checkExpressionCached(node.value));
|
|
86011
|
+
}
|
|
85840
86012
|
function checkImportDeclaration(node) {
|
|
85841
86013
|
if (checkGrammarModuleElementContext(node, isInJSFile(node) ? Diagnostics.An_import_declaration_can_only_be_used_at_the_top_level_of_a_module : Diagnostics.An_import_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module)) {
|
|
85842
86014
|
return;
|
|
@@ -87252,6 +87424,12 @@ function createTypeChecker(host) {
|
|
|
87252
87424
|
if (isMetaProperty(node.parent) && node.parent.keywordToken === node.kind) {
|
|
87253
87425
|
return checkMetaPropertyKeyword(node.parent);
|
|
87254
87426
|
}
|
|
87427
|
+
if (isImportAttributes(node)) {
|
|
87428
|
+
return getGlobalImportAttributesType(
|
|
87429
|
+
/*reportErrors*/
|
|
87430
|
+
false
|
|
87431
|
+
);
|
|
87432
|
+
}
|
|
87255
87433
|
return errorType;
|
|
87256
87434
|
}
|
|
87257
87435
|
function getTypeOfAssignmentPattern(expr) {
|
|
@@ -90323,7 +90501,7 @@ function visitCommaListElements(elements, visitor, discardVisitor = visitor) {
|
|
|
90323
90501
|
return discarded ? discardVisitor(node) : visitor(node);
|
|
90324
90502
|
}, isExpression);
|
|
90325
90503
|
}
|
|
90326
|
-
function visitEachChild(node, visitor, context, nodesVisitor = visitNodes2, tokenVisitor, nodeVisitor = visitNode) {
|
|
90504
|
+
function visitEachChild(node, visitor, context = nullTransformationContext, nodesVisitor = visitNodes2, tokenVisitor, nodeVisitor = visitNode) {
|
|
90327
90505
|
if (node === void 0) {
|
|
90328
90506
|
return void 0;
|
|
90329
90507
|
}
|
|
@@ -104797,12 +104975,22 @@ function transformES2015(context) {
|
|
|
104797
104975
|
case 172 /* PropertyDeclaration */: {
|
|
104798
104976
|
const named = node;
|
|
104799
104977
|
if (isComputedPropertyName(named.name)) {
|
|
104800
|
-
return factory2.replacePropertyName(named, visitEachChild(
|
|
104978
|
+
return factory2.replacePropertyName(named, visitEachChild(
|
|
104979
|
+
named.name,
|
|
104980
|
+
elideUnusedThisCaptureWorker,
|
|
104981
|
+
/*context*/
|
|
104982
|
+
void 0
|
|
104983
|
+
));
|
|
104801
104984
|
}
|
|
104802
104985
|
return node;
|
|
104803
104986
|
}
|
|
104804
104987
|
}
|
|
104805
|
-
return visitEachChild(
|
|
104988
|
+
return visitEachChild(
|
|
104989
|
+
node,
|
|
104990
|
+
elideUnusedThisCaptureWorker,
|
|
104991
|
+
/*context*/
|
|
104992
|
+
void 0
|
|
104993
|
+
);
|
|
104806
104994
|
}
|
|
104807
104995
|
function simplifyConstructorElideUnusedThisCapture(body, original) {
|
|
104808
104996
|
if (original.transformFlags & 16384 /* ContainsLexicalThis */ || hierarchyFacts & 65536 /* LexicalThis */ || hierarchyFacts & 131072 /* CapturedLexicalThis */) {
|
|
@@ -104838,12 +105026,22 @@ function transformES2015(context) {
|
|
|
104838
105026
|
case 172 /* PropertyDeclaration */: {
|
|
104839
105027
|
const named = node;
|
|
104840
105028
|
if (isComputedPropertyName(named.name)) {
|
|
104841
|
-
return factory2.replacePropertyName(named, visitEachChild(
|
|
105029
|
+
return factory2.replacePropertyName(named, visitEachChild(
|
|
105030
|
+
named.name,
|
|
105031
|
+
injectSuperPresenceCheckWorker,
|
|
105032
|
+
/*context*/
|
|
105033
|
+
void 0
|
|
105034
|
+
));
|
|
104842
105035
|
}
|
|
104843
105036
|
return node;
|
|
104844
105037
|
}
|
|
104845
105038
|
}
|
|
104846
|
-
return visitEachChild(
|
|
105039
|
+
return visitEachChild(
|
|
105040
|
+
node,
|
|
105041
|
+
injectSuperPresenceCheckWorker,
|
|
105042
|
+
/*context*/
|
|
105043
|
+
void 0
|
|
105044
|
+
);
|
|
104847
105045
|
}
|
|
104848
105046
|
function complicateConstructorInjectSuperPresenceCheck(body) {
|
|
104849
105047
|
return factory2.updateBlock(body, visitNodes2(body.statements, injectSuperPresenceCheckWorker, isStatement));
|
|
@@ -113241,44 +113439,6 @@ function getDeclarationDiagnostics(host, resolver, file) {
|
|
|
113241
113439
|
);
|
|
113242
113440
|
return result.diagnostics;
|
|
113243
113441
|
}
|
|
113244
|
-
function hasInternalAnnotation(range, currentSourceFile) {
|
|
113245
|
-
const comment = currentSourceFile.text.substring(range.pos, range.end);
|
|
113246
|
-
return comment.includes("@internal");
|
|
113247
|
-
}
|
|
113248
|
-
function isInternalDeclaration(node, currentSourceFile) {
|
|
113249
|
-
const parseTreeNode = getParseTreeNode(node);
|
|
113250
|
-
if (parseTreeNode && parseTreeNode.kind === 169 /* Parameter */) {
|
|
113251
|
-
const paramIdx = parseTreeNode.parent.parameters.indexOf(parseTreeNode);
|
|
113252
|
-
const previousSibling = paramIdx > 0 ? parseTreeNode.parent.parameters[paramIdx - 1] : void 0;
|
|
113253
|
-
const text = currentSourceFile.text;
|
|
113254
|
-
const commentRanges = previousSibling ? concatenate(
|
|
113255
|
-
// to handle
|
|
113256
|
-
// ... parameters, /** @internal */
|
|
113257
|
-
// public param: string
|
|
113258
|
-
getTrailingCommentRanges(text, skipTrivia(
|
|
113259
|
-
text,
|
|
113260
|
-
previousSibling.end + 1,
|
|
113261
|
-
/*stopAfterLineBreak*/
|
|
113262
|
-
false,
|
|
113263
|
-
/*stopAtComments*/
|
|
113264
|
-
true
|
|
113265
|
-
)),
|
|
113266
|
-
getLeadingCommentRanges(text, node.pos)
|
|
113267
|
-
) : getTrailingCommentRanges(text, skipTrivia(
|
|
113268
|
-
text,
|
|
113269
|
-
node.pos,
|
|
113270
|
-
/*stopAfterLineBreak*/
|
|
113271
|
-
false,
|
|
113272
|
-
/*stopAtComments*/
|
|
113273
|
-
true
|
|
113274
|
-
));
|
|
113275
|
-
return commentRanges && commentRanges.length && hasInternalAnnotation(last(commentRanges), currentSourceFile);
|
|
113276
|
-
}
|
|
113277
|
-
const leadingCommentRanges = parseTreeNode && getLeadingCommentRangesOfNode(parseTreeNode, currentSourceFile);
|
|
113278
|
-
return !!forEach(leadingCommentRanges, (range) => {
|
|
113279
|
-
return hasInternalAnnotation(range, currentSourceFile);
|
|
113280
|
-
});
|
|
113281
|
-
}
|
|
113282
113442
|
var declarationEmitNodeBuilderFlags = 1024 /* MultilineObjectLiterals */ | 2048 /* WriteClassExpressionAsTypeLiteral */ | 4096 /* UseTypeOfFunction */ | 8 /* UseStructuralFallback */ | 524288 /* AllowEmptyTuple */ | 4 /* GenerateNamesForShadowedTypeParams */ | 1 /* NoTruncation */;
|
|
113283
113443
|
function transformDeclarations(context) {
|
|
113284
113444
|
const throwDiagnostic = () => Debug.fail("Diagnostic emitted without context");
|
|
@@ -134650,7 +134810,14 @@ function getSynthesizedDeepCloneWorker(node, replaceNode) {
|
|
|
134650
134810
|
true,
|
|
134651
134811
|
replaceNode
|
|
134652
134812
|
) : (ns) => ns && getSynthesizedDeepClones(ns);
|
|
134653
|
-
const visited = visitEachChild(
|
|
134813
|
+
const visited = visitEachChild(
|
|
134814
|
+
node,
|
|
134815
|
+
nodeClone,
|
|
134816
|
+
/*context*/
|
|
134817
|
+
void 0,
|
|
134818
|
+
nodesClone,
|
|
134819
|
+
nodeClone
|
|
134820
|
+
);
|
|
134654
134821
|
if (visited === node) {
|
|
134655
134822
|
const clone2 = isStringLiteral(node) ? setOriginalNode(factory.createStringLiteralFromNode(node), node) : isNumericLiteral(node) ? setOriginalNode(factory.createNumericLiteral(node.text, node.numericLiteralFlags), node) : factory.cloneNode(node);
|
|
134656
134823
|
return setTextRange(clone2, node);
|
|
@@ -144435,7 +144602,12 @@ function transformFunctionBody(body, exposedVariableDeclarations, writes, substi
|
|
|
144435
144602
|
const oldIgnoreReturns = ignoreReturns;
|
|
144436
144603
|
ignoreReturns = ignoreReturns || isFunctionLikeDeclaration(node) || isClassLike(node);
|
|
144437
144604
|
const substitution = substitutions.get(getNodeId(node).toString());
|
|
144438
|
-
const result = substitution ? getSynthesizedDeepClone(substitution) : visitEachChild(
|
|
144605
|
+
const result = substitution ? getSynthesizedDeepClone(substitution) : visitEachChild(
|
|
144606
|
+
node,
|
|
144607
|
+
visitor,
|
|
144608
|
+
/*context*/
|
|
144609
|
+
void 0
|
|
144610
|
+
);
|
|
144439
144611
|
ignoreReturns = oldIgnoreReturns;
|
|
144440
144612
|
return result;
|
|
144441
144613
|
}
|
|
@@ -144445,7 +144617,12 @@ function transformConstantInitializer(initializer, substitutions) {
|
|
|
144445
144617
|
return substitutions.size ? visitor(initializer) : initializer;
|
|
144446
144618
|
function visitor(node) {
|
|
144447
144619
|
const substitution = substitutions.get(getNodeId(node).toString());
|
|
144448
|
-
return substitution ? getSynthesizedDeepClone(substitution) : visitEachChild(
|
|
144620
|
+
return substitution ? getSynthesizedDeepClone(substitution) : visitEachChild(
|
|
144621
|
+
node,
|
|
144622
|
+
visitor,
|
|
144623
|
+
/*context*/
|
|
144624
|
+
void 0
|
|
144625
|
+
);
|
|
144449
144626
|
}
|
|
144450
144627
|
}
|
|
144451
144628
|
function getStatementsOrClassElements(scope) {
|
|
@@ -149214,7 +149391,12 @@ function transformJSDocType(node) {
|
|
|
149214
149391
|
case 329 /* JSDocTypeLiteral */:
|
|
149215
149392
|
return transformJSDocTypeLiteral(node);
|
|
149216
149393
|
default:
|
|
149217
|
-
const visited = visitEachChild(
|
|
149394
|
+
const visited = visitEachChild(
|
|
149395
|
+
node,
|
|
149396
|
+
transformJSDocType,
|
|
149397
|
+
/*context*/
|
|
149398
|
+
void 0
|
|
149399
|
+
);
|
|
149218
149400
|
setEmitFlags(visited, 1 /* SingleLine */);
|
|
149219
149401
|
return visited;
|
|
149220
149402
|
}
|
|
@@ -157343,7 +157525,12 @@ function tryGetAutoImportableReferenceFromTypeNode(importTypeNode, scriptTarget)
|
|
|
157343
157525
|
const typeArguments = visitNodes2(node.typeArguments, visit, isTypeNode);
|
|
157344
157526
|
return factory.createTypeReferenceNode(qualifier, typeArguments);
|
|
157345
157527
|
}
|
|
157346
|
-
return visitEachChild(
|
|
157528
|
+
return visitEachChild(
|
|
157529
|
+
node,
|
|
157530
|
+
visit,
|
|
157531
|
+
/*context*/
|
|
157532
|
+
void 0
|
|
157533
|
+
);
|
|
157347
157534
|
}
|
|
157348
157535
|
}
|
|
157349
157536
|
function replaceFirstIdentifierOfEntityName(name, newIdentifier) {
|
|
@@ -160879,7 +161066,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
|
|
|
160879
161066
|
return isIdentifier(e) ? e : isPropertyAccessExpression(e) ? getLeftMostName(e.expression) : void 0;
|
|
160880
161067
|
}
|
|
160881
161068
|
function tryGetGlobalSymbols() {
|
|
160882
|
-
const result = tryGetObjectTypeLiteralInTypeArgumentCompletionSymbols() || tryGetObjectLikeCompletionSymbols() || tryGetImportCompletionSymbols() || tryGetImportOrExportClauseCompletionSymbols() || tryGetLocalNamedExportCompletionSymbols() || tryGetConstructorCompletion() || tryGetClassLikeCompletionSymbols() || tryGetJsxCompletionSymbols() || (getGlobalCompletions(), 1 /* Success */);
|
|
161069
|
+
const result = tryGetObjectTypeLiteralInTypeArgumentCompletionSymbols() || tryGetObjectLikeCompletionSymbols() || tryGetImportCompletionSymbols() || tryGetImportOrExportClauseCompletionSymbols() || tryGetImportAttributesCompletionSymbols() || tryGetLocalNamedExportCompletionSymbols() || tryGetConstructorCompletion() || tryGetClassLikeCompletionSymbols() || tryGetJsxCompletionSymbols() || (getGlobalCompletions(), 1 /* Success */);
|
|
160883
161070
|
return result === 1 /* Success */;
|
|
160884
161071
|
}
|
|
160885
161072
|
function tryGetConstructorCompletion() {
|
|
@@ -161347,6 +161534,16 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
|
|
|
161347
161534
|
}
|
|
161348
161535
|
return 1 /* Success */;
|
|
161349
161536
|
}
|
|
161537
|
+
function tryGetImportAttributesCompletionSymbols() {
|
|
161538
|
+
if (contextToken === void 0)
|
|
161539
|
+
return 0 /* Continue */;
|
|
161540
|
+
const importAttributes = contextToken.kind === 19 /* OpenBraceToken */ || contextToken.kind === 28 /* CommaToken */ ? tryCast(contextToken.parent, isImportAttributes) : contextToken.kind === 59 /* ColonToken */ ? tryCast(contextToken.parent.parent, isImportAttributes) : void 0;
|
|
161541
|
+
if (importAttributes === void 0)
|
|
161542
|
+
return 0 /* Continue */;
|
|
161543
|
+
const existing = new Set(importAttributes.elements.map(getNameFromImportAttribute));
|
|
161544
|
+
symbols = filter(typeChecker.getTypeAtLocation(importAttributes).getApparentProperties(), (attr) => !existing.has(attr.escapedName));
|
|
161545
|
+
return 1 /* Success */;
|
|
161546
|
+
}
|
|
161350
161547
|
function tryGetLocalNamedExportCompletionSymbols() {
|
|
161351
161548
|
var _a;
|
|
161352
161549
|
const namedExports = contextToken && (contextToken.kind === 19 /* OpenBraceToken */ || contextToken.kind === 28 /* CommaToken */) ? tryCast(contextToken.parent, isNamedExports) : void 0;
|
|
@@ -163851,6 +164048,11 @@ function getContextNode(node) {
|
|
|
163851
164048
|
return isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent) ? getContextNode(
|
|
163852
164049
|
findAncestor(node.parent, (node2) => isBinaryExpression(node2) || isForInOrOfStatement(node2))
|
|
163853
164050
|
) : node;
|
|
164051
|
+
case 255 /* SwitchStatement */:
|
|
164052
|
+
return {
|
|
164053
|
+
start: find(node.getChildren(node.getSourceFile()), (node2) => node2.kind === 109 /* SwitchKeyword */),
|
|
164054
|
+
end: node.caseBlock
|
|
164055
|
+
};
|
|
163854
164056
|
default:
|
|
163855
164057
|
return node;
|
|
163856
164058
|
}
|
|
@@ -164151,6 +164353,9 @@ function getTextSpan(node, sourceFile, endNode2) {
|
|
|
164151
164353
|
start2 += 1;
|
|
164152
164354
|
end -= 1;
|
|
164153
164355
|
}
|
|
164356
|
+
if ((endNode2 == null ? void 0 : endNode2.kind) === 269 /* CaseBlock */) {
|
|
164357
|
+
end = endNode2.getFullStart();
|
|
164358
|
+
}
|
|
164154
164359
|
return createTextSpanFromBounds(start2, end);
|
|
164155
164360
|
}
|
|
164156
164361
|
function getTextSpanOfEntry(entry) {
|
|
@@ -165706,9 +165911,20 @@ function getDefinitionAtPosition(program, sourceFile, position, searchOtherFiles
|
|
|
165706
165911
|
void 0
|
|
165707
165912
|
)] : void 0;
|
|
165708
165913
|
}
|
|
165709
|
-
|
|
165710
|
-
|
|
165711
|
-
|
|
165914
|
+
switch (node.kind) {
|
|
165915
|
+
case 107 /* ReturnKeyword */:
|
|
165916
|
+
const functionDeclaration = findAncestor(node.parent, (n) => isClassStaticBlockDeclaration(n) ? "quit" : isFunctionLikeDeclaration(n));
|
|
165917
|
+
return functionDeclaration ? [createDefinitionFromSignatureDeclaration(typeChecker, functionDeclaration)] : void 0;
|
|
165918
|
+
case 90 /* DefaultKeyword */:
|
|
165919
|
+
if (!isDefaultClause(node.parent)) {
|
|
165920
|
+
break;
|
|
165921
|
+
}
|
|
165922
|
+
case 84 /* CaseKeyword */:
|
|
165923
|
+
const switchStatement = findAncestor(node.parent, isSwitchStatement);
|
|
165924
|
+
if (switchStatement) {
|
|
165925
|
+
return [createDefinitionInfoFromSwitch(switchStatement, sourceFile)];
|
|
165926
|
+
}
|
|
165927
|
+
break;
|
|
165712
165928
|
}
|
|
165713
165929
|
if (node.kind === 135 /* AwaitKeyword */) {
|
|
165714
165930
|
const functionDeclaration = findAncestor(node, (n) => isFunctionLikeDeclaration(n));
|
|
@@ -166126,6 +166342,23 @@ function createDefinitionInfoFromName(checker, declaration, symbolKind, symbolNa
|
|
|
166126
166342
|
failedAliasResolution
|
|
166127
166343
|
};
|
|
166128
166344
|
}
|
|
166345
|
+
function createDefinitionInfoFromSwitch(statement, sourceFile) {
|
|
166346
|
+
const keyword = ts_FindAllReferences_exports.getContextNode(statement);
|
|
166347
|
+
const textSpan = createTextSpanFromNode(isContextWithStartAndEndNode(keyword) ? keyword.start : keyword, sourceFile);
|
|
166348
|
+
return {
|
|
166349
|
+
fileName: sourceFile.fileName,
|
|
166350
|
+
textSpan,
|
|
166351
|
+
kind: "keyword" /* keyword */,
|
|
166352
|
+
name: "switch",
|
|
166353
|
+
containerKind: void 0,
|
|
166354
|
+
containerName: "",
|
|
166355
|
+
...ts_FindAllReferences_exports.toContextSpan(textSpan, sourceFile, keyword),
|
|
166356
|
+
isLocal: true,
|
|
166357
|
+
isAmbient: false,
|
|
166358
|
+
unverified: false,
|
|
166359
|
+
failedAliasResolution: void 0
|
|
166360
|
+
};
|
|
166361
|
+
}
|
|
166129
166362
|
function isDefinitionVisible(checker, declaration) {
|
|
166130
166363
|
if (checker.isDeclarationVisible(declaration))
|
|
166131
166364
|
return true;
|
|
@@ -174893,6 +175126,7 @@ __export(ts_exports2, {
|
|
|
174893
175126
|
getModuleSpecifierEndingPreference: () => getModuleSpecifierEndingPreference,
|
|
174894
175127
|
getModuleSpecifierResolverHost: () => getModuleSpecifierResolverHost,
|
|
174895
175128
|
getNameForExportedSymbol: () => getNameForExportedSymbol,
|
|
175129
|
+
getNameFromImportAttribute: () => getNameFromImportAttribute,
|
|
174896
175130
|
getNameFromIndexInfo: () => getNameFromIndexInfo,
|
|
174897
175131
|
getNameFromPropertyName: () => getNameFromPropertyName,
|
|
174898
175132
|
getNameOfAccessExpression: () => getNameOfAccessExpression,
|
|
@@ -189693,6 +189927,7 @@ start(initializeNodeSystem(), require("os").platform());
|
|
|
189693
189927
|
getModuleSpecifierEndingPreference,
|
|
189694
189928
|
getModuleSpecifierResolverHost,
|
|
189695
189929
|
getNameForExportedSymbol,
|
|
189930
|
+
getNameFromImportAttribute,
|
|
189696
189931
|
getNameFromIndexInfo,
|
|
189697
189932
|
getNameFromPropertyName,
|
|
189698
189933
|
getNameOfAccessExpression,
|