@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/typescript.js
CHANGED
|
@@ -35,7 +35,7 @@ var ts = (() => {
|
|
|
35
35
|
"src/compiler/corePublic.ts"() {
|
|
36
36
|
"use strict";
|
|
37
37
|
versionMajorMinor = "5.4";
|
|
38
|
-
version = `${versionMajorMinor}.0-insiders.
|
|
38
|
+
version = `${versionMajorMinor}.0-insiders.20240112`;
|
|
39
39
|
Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
40
40
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
41
41
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -4352,6 +4352,7 @@ ${lanes.join("\n")}
|
|
|
4352
4352
|
InternalSymbolName2["Default"] = "default";
|
|
4353
4353
|
InternalSymbolName2["This"] = "this";
|
|
4354
4354
|
InternalSymbolName2["InstantiationExpression"] = "__instantiationExpression";
|
|
4355
|
+
InternalSymbolName2["ImportAttributes"] = "__importAttributes";
|
|
4355
4356
|
return InternalSymbolName2;
|
|
4356
4357
|
})(InternalSymbolName || {});
|
|
4357
4358
|
NodeCheckFlags = /* @__PURE__ */ ((NodeCheckFlags2) => {
|
|
@@ -6205,6 +6206,7 @@ ${lanes.join("\n")}
|
|
|
6205
6206
|
resolvePath: (path) => _path.resolve(path),
|
|
6206
6207
|
fileExists,
|
|
6207
6208
|
directoryExists,
|
|
6209
|
+
getAccessibleFileSystemEntries,
|
|
6208
6210
|
createDirectory(directoryName) {
|
|
6209
6211
|
if (!nodeSystem.directoryExists(directoryName)) {
|
|
6210
6212
|
try {
|
|
@@ -8478,6 +8480,10 @@ ${lanes.join("\n")}
|
|
|
8478
8480
|
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}'."),
|
|
8479
8481
|
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."),
|
|
8480
8482
|
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.`),
|
|
8483
|
+
package_json_has_a_peerDependencies_field: diag(6279, 3 /* Message */, "package_json_has_a_peerDependencies_field_6279", "'package.json' has a 'peerDependencies' field."),
|
|
8484
|
+
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."),
|
|
8485
|
+
Found_peerDependency_0_with_1_version: diag(6281, 3 /* Message */, "Found_peerDependency_0_with_1_version_6281", "Found peerDependency '{0}' with '{1}' version."),
|
|
8486
|
+
Failed_to_find_peerDependency_0: diag(6282, 3 /* Message */, "Failed_to_find_peerDependency_0_6282", "Failed to find peerDependency '{0}'."),
|
|
8481
8487
|
Enable_project_compilation: diag(6302, 3 /* Message */, "Enable_project_compilation_6302", "Enable project compilation"),
|
|
8482
8488
|
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."),
|
|
8483
8489
|
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}'."),
|
|
@@ -12906,6 +12912,45 @@ ${lanes.join("\n")}
|
|
|
12906
12912
|
const type = isJSDocParameterTag(node) ? node.typeExpression && node.typeExpression.type : node.type;
|
|
12907
12913
|
return node.dotDotDotToken !== void 0 || !!type && type.kind === 325 /* JSDocVariadicType */;
|
|
12908
12914
|
}
|
|
12915
|
+
function hasInternalAnnotation(range, sourceFile) {
|
|
12916
|
+
const comment = sourceFile.text.substring(range.pos, range.end);
|
|
12917
|
+
return comment.includes("@internal");
|
|
12918
|
+
}
|
|
12919
|
+
function isInternalDeclaration(node, sourceFile) {
|
|
12920
|
+
sourceFile ?? (sourceFile = getSourceFileOfNode(node));
|
|
12921
|
+
const parseTreeNode = getParseTreeNode(node);
|
|
12922
|
+
if (parseTreeNode && parseTreeNode.kind === 169 /* Parameter */) {
|
|
12923
|
+
const paramIdx = parseTreeNode.parent.parameters.indexOf(parseTreeNode);
|
|
12924
|
+
const previousSibling = paramIdx > 0 ? parseTreeNode.parent.parameters[paramIdx - 1] : void 0;
|
|
12925
|
+
const text = sourceFile.text;
|
|
12926
|
+
const commentRanges = previousSibling ? concatenate(
|
|
12927
|
+
// to handle
|
|
12928
|
+
// ... parameters, /** @internal */
|
|
12929
|
+
// public param: string
|
|
12930
|
+
getTrailingCommentRanges(text, skipTrivia(
|
|
12931
|
+
text,
|
|
12932
|
+
previousSibling.end + 1,
|
|
12933
|
+
/*stopAfterLineBreak*/
|
|
12934
|
+
false,
|
|
12935
|
+
/*stopAtComments*/
|
|
12936
|
+
true
|
|
12937
|
+
)),
|
|
12938
|
+
getLeadingCommentRanges(text, node.pos)
|
|
12939
|
+
) : getTrailingCommentRanges(text, skipTrivia(
|
|
12940
|
+
text,
|
|
12941
|
+
node.pos,
|
|
12942
|
+
/*stopAfterLineBreak*/
|
|
12943
|
+
false,
|
|
12944
|
+
/*stopAtComments*/
|
|
12945
|
+
true
|
|
12946
|
+
));
|
|
12947
|
+
return some(commentRanges) && hasInternalAnnotation(last(commentRanges), sourceFile);
|
|
12948
|
+
}
|
|
12949
|
+
const leadingCommentRanges = parseTreeNode && getLeadingCommentRangesOfNode(parseTreeNode, sourceFile);
|
|
12950
|
+
return !!forEach(leadingCommentRanges, (range) => {
|
|
12951
|
+
return hasInternalAnnotation(range, sourceFile);
|
|
12952
|
+
});
|
|
12953
|
+
}
|
|
12909
12954
|
var unchangedTextChangeRange, supportedLocaleDirectories, MAX_SMI_X86;
|
|
12910
12955
|
var init_utilitiesPublic = __esm({
|
|
12911
12956
|
"src/compiler/utilitiesPublic.ts"() {
|
|
@@ -13078,13 +13123,13 @@ ${lanes.join("\n")}
|
|
|
13078
13123
|
return result;
|
|
13079
13124
|
}
|
|
13080
13125
|
function packageIdIsEqual(a, b) {
|
|
13081
|
-
return a === b || !!a && !!b && a.name === b.name && a.subModuleName === b.subModuleName && a.version === b.version;
|
|
13126
|
+
return a === b || !!a && !!b && a.name === b.name && a.subModuleName === b.subModuleName && a.version === b.version && a.peerDependencies === b.peerDependencies;
|
|
13082
13127
|
}
|
|
13083
13128
|
function packageIdToPackageName({ name, subModuleName }) {
|
|
13084
13129
|
return subModuleName ? `${name}/${subModuleName}` : name;
|
|
13085
13130
|
}
|
|
13086
13131
|
function packageIdToString(packageId) {
|
|
13087
|
-
return `${packageIdToPackageName(packageId)}@${packageId.version}`;
|
|
13132
|
+
return `${packageIdToPackageName(packageId)}@${packageId.version}${packageId.peerDependencies ?? ""}`;
|
|
13088
13133
|
}
|
|
13089
13134
|
function typeDirectiveIsEqualTo(oldResolution, newResolution) {
|
|
13090
13135
|
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;
|
|
@@ -18897,6 +18942,9 @@ ${lanes.join("\n")}
|
|
|
18897
18942
|
function replaceFirstStar(s, replacement) {
|
|
18898
18943
|
return stringReplace.call(s, "*", replacement);
|
|
18899
18944
|
}
|
|
18945
|
+
function getNameFromImportAttribute(node) {
|
|
18946
|
+
return isIdentifier(node.name) ? node.name.escapedText : escapeLeadingUnderscores(node.name.text);
|
|
18947
|
+
}
|
|
18900
18948
|
var resolvingEmptyArray, externalHelpersModuleNameText, defaultMaximumTruncationLength, noTruncationMaximumTruncationLength, stringWriter, getScriptTargetFeatures, GetLiteralTextFlags, fullTripleSlashReferencePathRegEx, fullTripleSlashReferenceTypeReferenceDirectiveRegEx, fullTripleSlashLibReferenceRegEx, fullTripleSlashAMDReferencePathRegEx, fullTripleSlashAMDModuleRegEx, defaultLibReferenceRegEx, AssignmentKind, FunctionFlags, Associativity, OperatorPrecedence, templateSubstitutionRegExp, doubleQuoteEscapedCharsRegExp, singleQuoteEscapedCharsRegExp, backtickQuoteEscapedCharsRegExp, escapedCharsMap, nonAsciiCharacters, jsxDoubleQuoteEscapedCharsRegExp, jsxSingleQuoteEscapedCharsRegExp, jsxEscapedCharsMap, indentStrings, base64Digits, carriageReturnLineFeed, lineFeed, objectAllocator, objectAllocatorPatchers, localizedDiagnosticMessages, computedOptions, getEmitScriptTarget, getEmitModuleKind, getEmitModuleResolutionKind, getEmitModuleDetectionKind, getIsolatedModules, getESModuleInterop, getAllowSyntheticDefaultImports, getResolvePackageJsonExports, getResolvePackageJsonImports, getResolveJsonModule, getEmitDeclarations, shouldPreserveConstEnums, isIncrementalCompilation, getAreDeclarationMapsEnabled, getAllowJSCompilerOption, getUseDefineForClassFields, reservedCharacterPattern, wildcardCharCodes, commonPackageFolders, implicitExcludePathRegexPattern, filesMatcher, directoriesMatcher, excludeMatcher, wildcardMatchers, supportedTSExtensions, supportedTSExtensionsFlat, supportedTSExtensionsWithJson, supportedTSExtensionsForExtractExtension, supportedJSExtensions, supportedJSExtensionsFlat, allSupportedExtensions, allSupportedExtensionsWithJson, supportedDeclarationExtensions, supportedTSImplementationExtensions, extensionsNotSupportingExtensionlessResolution, ModuleSpecifierEnding, extensionsToRemove, emptyFileSystemEntries, stringReplace;
|
|
18901
18949
|
var init_utilities = __esm({
|
|
18902
18950
|
"src/compiler/utilities.ts"() {
|
|
@@ -37998,7 +38046,7 @@ ${lanes.join("\n")}
|
|
|
37998
38046
|
["es2023.array", "lib.es2023.array.d.ts"],
|
|
37999
38047
|
["es2023.collection", "lib.es2023.collection.d.ts"],
|
|
38000
38048
|
["esnext.array", "lib.es2023.array.d.ts"],
|
|
38001
|
-
["esnext.collection", "lib.
|
|
38049
|
+
["esnext.collection", "lib.esnext.collection.d.ts"],
|
|
38002
38050
|
["esnext.symbol", "lib.es2019.symbol.d.ts"],
|
|
38003
38051
|
["esnext.asynciterable", "lib.es2018.asynciterable.d.ts"],
|
|
38004
38052
|
["esnext.intl", "lib.esnext.intl.d.ts"],
|
|
@@ -38008,6 +38056,7 @@ ${lanes.join("\n")}
|
|
|
38008
38056
|
["esnext.promise", "lib.esnext.promise.d.ts"],
|
|
38009
38057
|
["esnext.weakref", "lib.es2021.weakref.d.ts"],
|
|
38010
38058
|
["esnext.decorators", "lib.esnext.decorators.d.ts"],
|
|
38059
|
+
["esnext.object", "lib.esnext.object.d.ts"],
|
|
38011
38060
|
["decorators", "lib.decorators.d.ts"],
|
|
38012
38061
|
["decorators.legacy", "lib.decorators.legacy.d.ts"]
|
|
38013
38062
|
];
|
|
@@ -39468,7 +39517,7 @@ ${lanes.join("\n")}
|
|
|
39468
39517
|
function isTraceEnabled(compilerOptions, host) {
|
|
39469
39518
|
return !!compilerOptions.traceResolution && host.trace !== void 0;
|
|
39470
39519
|
}
|
|
39471
|
-
function withPackageId(packageInfo, r) {
|
|
39520
|
+
function withPackageId(packageInfo, r, state) {
|
|
39472
39521
|
let packageId;
|
|
39473
39522
|
if (r && packageInfo) {
|
|
39474
39523
|
const packageJsonContent = packageInfo.contents.packageJsonContent;
|
|
@@ -39476,7 +39525,8 @@ ${lanes.join("\n")}
|
|
|
39476
39525
|
packageId = {
|
|
39477
39526
|
name: packageJsonContent.name,
|
|
39478
39527
|
subModuleName: r.path.slice(packageInfo.packageDirectory.length + directorySeparator.length),
|
|
39479
|
-
version: packageJsonContent.version
|
|
39528
|
+
version: packageJsonContent.version,
|
|
39529
|
+
peerDependencies: getPeerDependenciesOfPackageJsonInfo(packageInfo, state)
|
|
39480
39530
|
};
|
|
39481
39531
|
}
|
|
39482
39532
|
}
|
|
@@ -39486,7 +39536,9 @@ ${lanes.join("\n")}
|
|
|
39486
39536
|
return withPackageId(
|
|
39487
39537
|
/*packageInfo*/
|
|
39488
39538
|
void 0,
|
|
39489
|
-
r
|
|
39539
|
+
r,
|
|
39540
|
+
/*state*/
|
|
39541
|
+
void 0
|
|
39490
39542
|
);
|
|
39491
39543
|
}
|
|
39492
39544
|
function removeIgnoredPackageId(r) {
|
|
@@ -39861,7 +39913,7 @@ ${lanes.join("\n")}
|
|
|
39861
39913
|
false,
|
|
39862
39914
|
moduleResolutionState
|
|
39863
39915
|
) : void 0;
|
|
39864
|
-
return resolvedTypeScriptOnly(withPackageId(packageInfo, resolvedFromFile));
|
|
39916
|
+
return resolvedTypeScriptOnly(withPackageId(packageInfo, resolvedFromFile, moduleResolutionState));
|
|
39865
39917
|
}
|
|
39866
39918
|
}
|
|
39867
39919
|
return resolvedTypeScriptOnly(
|
|
@@ -40817,7 +40869,7 @@ ${lanes.join("\n")}
|
|
|
40817
40869
|
false,
|
|
40818
40870
|
state
|
|
40819
40871
|
) : void 0;
|
|
40820
|
-
return withPackageId(packageInfo, resolvedFromFile);
|
|
40872
|
+
return withPackageId(packageInfo, resolvedFromFile, state);
|
|
40821
40873
|
}
|
|
40822
40874
|
}
|
|
40823
40875
|
if (!onlyRecordFailures) {
|
|
@@ -40959,7 +41011,7 @@ ${lanes.join("\n")}
|
|
|
40959
41011
|
const packageInfo = considerPackageJson ? getPackageJsonInfo(candidate, onlyRecordFailures, state) : void 0;
|
|
40960
41012
|
const packageJsonContent = packageInfo && packageInfo.contents.packageJsonContent;
|
|
40961
41013
|
const versionPaths = packageInfo && getVersionPathsOfPackageJsonInfo(packageInfo, state);
|
|
40962
|
-
return withPackageId(packageInfo, loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFailures, state, packageJsonContent, versionPaths));
|
|
41014
|
+
return withPackageId(packageInfo, loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFailures, state, packageJsonContent, versionPaths), state);
|
|
40963
41015
|
}
|
|
40964
41016
|
function getEntrypointsFromPackageJsonInfo(packageJsonInfo, options, host, cache, resolveJs) {
|
|
40965
41017
|
if (!resolveJs && packageJsonInfo.contents.resolvedEntrypoints !== void 0) {
|
|
@@ -41114,6 +41166,47 @@ ${lanes.join("\n")}
|
|
|
41114
41166
|
}
|
|
41115
41167
|
return packageJsonInfo.contents.versionPaths || void 0;
|
|
41116
41168
|
}
|
|
41169
|
+
function getPeerDependenciesOfPackageJsonInfo(packageJsonInfo, state) {
|
|
41170
|
+
if (packageJsonInfo.contents.peerDependencies === void 0) {
|
|
41171
|
+
packageJsonInfo.contents.peerDependencies = readPackageJsonPeerDependencies(packageJsonInfo, state) || false;
|
|
41172
|
+
}
|
|
41173
|
+
return packageJsonInfo.contents.peerDependencies || void 0;
|
|
41174
|
+
}
|
|
41175
|
+
function readPackageJsonPeerDependencies(packageJsonInfo, state) {
|
|
41176
|
+
const peerDependencies = readPackageJsonField(packageJsonInfo.contents.packageJsonContent, "peerDependencies", "object", state);
|
|
41177
|
+
if (peerDependencies === void 0)
|
|
41178
|
+
return void 0;
|
|
41179
|
+
if (state.traceEnabled)
|
|
41180
|
+
trace(state.host, Diagnostics.package_json_has_a_peerDependencies_field);
|
|
41181
|
+
const packageDirectory = realPath(packageJsonInfo.packageDirectory, state.host, state.traceEnabled);
|
|
41182
|
+
if (packageDirectory.indexOf(".pnpm") === -1) {
|
|
41183
|
+
if (state.traceEnabled)
|
|
41184
|
+
trace(state.host, Diagnostics.Package_is_not_installed_using_pnpm_skipping_peerDependencies_version_resolution);
|
|
41185
|
+
return void 0;
|
|
41186
|
+
}
|
|
41187
|
+
const nodeModules = packageDirectory.substring(0, packageDirectory.lastIndexOf("node_modules") + "node_modules".length) + directorySeparator;
|
|
41188
|
+
let result = "";
|
|
41189
|
+
for (const key in peerDependencies) {
|
|
41190
|
+
if (hasProperty(peerDependencies, key)) {
|
|
41191
|
+
const peerPackageJson = getPackageJsonInfo(
|
|
41192
|
+
nodeModules + key,
|
|
41193
|
+
/*onlyRecordFailures*/
|
|
41194
|
+
false,
|
|
41195
|
+
state
|
|
41196
|
+
);
|
|
41197
|
+
if (peerPackageJson) {
|
|
41198
|
+
const version2 = peerPackageJson.contents.packageJsonContent.version;
|
|
41199
|
+
result += `+${key}@${version2}`;
|
|
41200
|
+
if (state.traceEnabled)
|
|
41201
|
+
trace(state.host, Diagnostics.Found_peerDependency_0_with_1_version, key, version2);
|
|
41202
|
+
} else {
|
|
41203
|
+
if (state.traceEnabled)
|
|
41204
|
+
trace(state.host, Diagnostics.Failed_to_find_peerDependency_0, key);
|
|
41205
|
+
}
|
|
41206
|
+
}
|
|
41207
|
+
}
|
|
41208
|
+
return result;
|
|
41209
|
+
}
|
|
41117
41210
|
function getPackageJsonInfo(packageDirectory, onlyRecordFailures, state) {
|
|
41118
41211
|
var _a, _b, _c, _d, _e, _f;
|
|
41119
41212
|
const { host, traceEnabled } = state;
|
|
@@ -41142,7 +41235,7 @@ ${lanes.join("\n")}
|
|
|
41142
41235
|
if (traceEnabled) {
|
|
41143
41236
|
trace(host, Diagnostics.Found_package_json_at_0, packageJsonPath);
|
|
41144
41237
|
}
|
|
41145
|
-
const result = { packageDirectory, contents: { packageJsonContent, versionPaths: void 0, resolvedEntrypoints: void 0 } };
|
|
41238
|
+
const result = { packageDirectory, contents: { packageJsonContent, versionPaths: void 0, resolvedEntrypoints: void 0, peerDependencies: void 0 } };
|
|
41146
41239
|
if (state.packageJsonInfoCache && !state.packageJsonInfoCache.isReadonly)
|
|
41147
41240
|
state.packageJsonInfoCache.setPackageJsonInfo(packageJsonPath, result);
|
|
41148
41241
|
(_e = state.affectingLocations) == null ? void 0 : _e.push(packageJsonPath);
|
|
@@ -41550,7 +41643,7 @@ ${lanes.join("\n")}
|
|
|
41550
41643
|
/*onlyRecordFailures*/
|
|
41551
41644
|
false,
|
|
41552
41645
|
state
|
|
41553
|
-
)));
|
|
41646
|
+
), state));
|
|
41554
41647
|
} else if (typeof target === "object" && target !== null) {
|
|
41555
41648
|
if (!Array.isArray(target)) {
|
|
41556
41649
|
traceIfEnabled(state, Diagnostics.Entering_conditional_exports);
|
|
@@ -41664,7 +41757,7 @@ ${lanes.join("\n")}
|
|
|
41664
41757
|
/*onlyRecordFailures*/
|
|
41665
41758
|
false,
|
|
41666
41759
|
state
|
|
41667
|
-
)));
|
|
41760
|
+
), state));
|
|
41668
41761
|
}
|
|
41669
41762
|
}
|
|
41670
41763
|
}
|
|
@@ -41795,7 +41888,7 @@ ${lanes.join("\n")}
|
|
|
41795
41888
|
packageInfo.contents.packageJsonContent,
|
|
41796
41889
|
getVersionPathsOfPackageJsonInfo(packageInfo, state)
|
|
41797
41890
|
);
|
|
41798
|
-
return withPackageId(packageInfo, fromDirectory);
|
|
41891
|
+
return withPackageId(packageInfo, fromDirectory, state);
|
|
41799
41892
|
}
|
|
41800
41893
|
const loader = (extensions2, candidate2, onlyRecordFailures, state2) => {
|
|
41801
41894
|
let pathAndExtension = (rest || !(state2.features & 32 /* EsmMode */)) && loadModuleFromFile(extensions2, candidate2, onlyRecordFailures, state2) || loadNodeModuleFromDirectoryWorker(
|
|
@@ -41809,7 +41902,7 @@ ${lanes.join("\n")}
|
|
|
41809
41902
|
if (!pathAndExtension && packageInfo && (packageInfo.contents.packageJsonContent.exports === void 0 || packageInfo.contents.packageJsonContent.exports === null) && state2.features & 32 /* EsmMode */) {
|
|
41810
41903
|
pathAndExtension = loadModuleFromFile(extensions2, combinePaths(candidate2, "index.js"), onlyRecordFailures, state2);
|
|
41811
41904
|
}
|
|
41812
|
-
return withPackageId(packageInfo, pathAndExtension);
|
|
41905
|
+
return withPackageId(packageInfo, pathAndExtension, state2);
|
|
41813
41906
|
};
|
|
41814
41907
|
if (rest !== "") {
|
|
41815
41908
|
packageInfo = rootPackageInfo ?? getPackageJsonInfo(packageDirectory, !nodeModulesDirectoryExists, state);
|
|
@@ -42011,7 +42104,7 @@ ${lanes.join("\n")}
|
|
|
42011
42104
|
false,
|
|
42012
42105
|
state
|
|
42013
42106
|
) : void 0;
|
|
42014
|
-
return toSearchResult(withPackageId(packageInfo, resolvedFromFile));
|
|
42107
|
+
return toSearchResult(withPackageId(packageInfo, resolvedFromFile, state));
|
|
42015
42108
|
}
|
|
42016
42109
|
const resolved = loadNodeModuleFromDirectory(4 /* Declaration */, candidate, !directoryExists, state);
|
|
42017
42110
|
if (resolved)
|
|
@@ -46939,6 +47032,7 @@ ${lanes.join("\n")}
|
|
|
46939
47032
|
var deferredGlobalImportMetaType;
|
|
46940
47033
|
var deferredGlobalImportMetaExpressionType;
|
|
46941
47034
|
var deferredGlobalImportCallOptionsType;
|
|
47035
|
+
var deferredGlobalImportAttributesType;
|
|
46942
47036
|
var deferredGlobalDisposableType;
|
|
46943
47037
|
var deferredGlobalAsyncDisposableType;
|
|
46944
47038
|
var deferredGlobalExtractSymbol;
|
|
@@ -47095,7 +47189,12 @@ ${lanes.join("\n")}
|
|
|
47095
47189
|
}
|
|
47096
47190
|
function markAsSynthetic(node) {
|
|
47097
47191
|
setTextRangePosEnd(node, -1, -1);
|
|
47098
|
-
return visitEachChild(
|
|
47192
|
+
return visitEachChild(
|
|
47193
|
+
node,
|
|
47194
|
+
markAsSynthetic,
|
|
47195
|
+
/*context*/
|
|
47196
|
+
void 0
|
|
47197
|
+
);
|
|
47099
47198
|
}
|
|
47100
47199
|
function getEmitResolver(sourceFile, cancellationToken2) {
|
|
47101
47200
|
getDiagnostics2(sourceFile, cancellationToken2);
|
|
@@ -51137,7 +51236,13 @@ ${lanes.join("\n")}
|
|
|
51137
51236
|
if (!nodeIsSynthesized(node) && getParseTreeNode(node) === node) {
|
|
51138
51237
|
return node;
|
|
51139
51238
|
}
|
|
51140
|
-
return setTextRange(factory.cloneNode(visitEachChild(
|
|
51239
|
+
return setTextRange(factory.cloneNode(visitEachChild(
|
|
51240
|
+
node,
|
|
51241
|
+
deepCloneOrReuseNode,
|
|
51242
|
+
/*context*/
|
|
51243
|
+
void 0,
|
|
51244
|
+
deepCloneOrReuseNodes
|
|
51245
|
+
)), node);
|
|
51141
51246
|
}
|
|
51142
51247
|
function deepCloneOrReuseNodes(nodes, visitor, test, start, count) {
|
|
51143
51248
|
if (nodes && nodes.length === 0) {
|
|
@@ -51859,7 +51964,8 @@ ${lanes.join("\n")}
|
|
|
51859
51964
|
let visited = visitEachChild(
|
|
51860
51965
|
node2,
|
|
51861
51966
|
elideInitializerAndSetEmitFlags,
|
|
51862
|
-
|
|
51967
|
+
/*context*/
|
|
51968
|
+
void 0,
|
|
51863
51969
|
/*nodesVisitor*/
|
|
51864
51970
|
void 0,
|
|
51865
51971
|
elideInitializerAndSetEmitFlags
|
|
@@ -52637,7 +52743,12 @@ ${lanes.join("\n")}
|
|
|
52637
52743
|
if (file && isTupleTypeNode(node) && getLineAndCharacterOfPosition(file, node.pos).line === getLineAndCharacterOfPosition(file, node.end).line) {
|
|
52638
52744
|
setEmitFlags(node, 1 /* SingleLine */);
|
|
52639
52745
|
}
|
|
52640
|
-
return visitEachChild(
|
|
52746
|
+
return visitEachChild(
|
|
52747
|
+
node,
|
|
52748
|
+
visitExistingNodeTreeSymbols,
|
|
52749
|
+
/*context*/
|
|
52750
|
+
void 0
|
|
52751
|
+
);
|
|
52641
52752
|
function getEffectiveDotDotDotForParameter(p) {
|
|
52642
52753
|
return p.dotDotDotToken || (p.type && isJSDocVariadicType(p.type) ? factory.createToken(26 /* DotDotDotToken */) : void 0);
|
|
52643
52754
|
}
|
|
@@ -52737,7 +52848,7 @@ ${lanes.join("\n")}
|
|
|
52737
52848
|
});
|
|
52738
52849
|
let addingDeclare = !bundled;
|
|
52739
52850
|
const exportEquals = symbolTable.get("export=" /* ExportEquals */);
|
|
52740
|
-
if (exportEquals && symbolTable.size > 1 && exportEquals.flags & 2097152 /* Alias */) {
|
|
52851
|
+
if (exportEquals && symbolTable.size > 1 && exportEquals.flags & (2097152 /* Alias */ | 1536 /* Module */)) {
|
|
52741
52852
|
symbolTable = createSymbolTable();
|
|
52742
52853
|
symbolTable.set("export=" /* ExportEquals */, exportEquals);
|
|
52743
52854
|
}
|
|
@@ -53194,8 +53305,18 @@ ${lanes.join("\n")}
|
|
|
53194
53305
|
);
|
|
53195
53306
|
}
|
|
53196
53307
|
function getNamespaceMembersForSerialization(symbol) {
|
|
53197
|
-
|
|
53198
|
-
|
|
53308
|
+
let exports = arrayFrom(getExportsOfSymbol(symbol).values());
|
|
53309
|
+
const merged = getMergedSymbol(symbol);
|
|
53310
|
+
if (merged !== symbol) {
|
|
53311
|
+
const membersSet = new Set(exports);
|
|
53312
|
+
for (const exported of getExportsOfSymbol(merged).values()) {
|
|
53313
|
+
if (!(getSymbolFlags(resolveSymbol(exported)) & 111551 /* Value */)) {
|
|
53314
|
+
membersSet.add(exported);
|
|
53315
|
+
}
|
|
53316
|
+
}
|
|
53317
|
+
exports = arrayFrom(membersSet);
|
|
53318
|
+
}
|
|
53319
|
+
return filter(exports, (m) => isNamespaceMember(m) && isIdentifierText(m.escapedName, 99 /* ESNext */));
|
|
53199
53320
|
}
|
|
53200
53321
|
function isTypeOnlyNamespace(symbol) {
|
|
53201
53322
|
return every(getNamespaceMembersForSerialization(symbol), (m) => !(getSymbolFlags(resolveSymbol(m)) & 111551 /* Value */));
|
|
@@ -55176,7 +55297,7 @@ ${lanes.join("\n")}
|
|
|
55176
55297
|
/*reportErrors*/
|
|
55177
55298
|
false
|
|
55178
55299
|
) : unknownType;
|
|
55179
|
-
return addOptionality(widenTypeInferredFromInitializer(element, checkDeclarationInitializer(element, 0 /* Normal */, contextualType)));
|
|
55300
|
+
return addOptionality(widenTypeInferredFromInitializer(element, checkDeclarationInitializer(element, reportErrors2 ? 0 /* Normal */ : 1 /* Contextual */, contextualType)));
|
|
55180
55301
|
}
|
|
55181
55302
|
if (isBindingPattern(element.name)) {
|
|
55182
55303
|
return getTypeFromBindingPattern(element.name, includePatternInType, reportErrors2);
|
|
@@ -55257,6 +55378,24 @@ ${lanes.join("\n")}
|
|
|
55257
55378
|
0 /* Normal */
|
|
55258
55379
|
), declaration, reportErrors2);
|
|
55259
55380
|
}
|
|
55381
|
+
function getTypeFromImportAttributes(node) {
|
|
55382
|
+
const links = getNodeLinks(node);
|
|
55383
|
+
if (!links.resolvedType) {
|
|
55384
|
+
const symbol = createSymbol(4096 /* ObjectLiteral */, "__importAttributes" /* ImportAttributes */);
|
|
55385
|
+
const members = createSymbolTable();
|
|
55386
|
+
forEach(node.elements, (attr) => {
|
|
55387
|
+
const member = createSymbol(4 /* Property */, getNameFromImportAttribute(attr));
|
|
55388
|
+
member.parent = symbol;
|
|
55389
|
+
member.links.type = checkImportAttribute(attr);
|
|
55390
|
+
member.links.target = member;
|
|
55391
|
+
members.set(member.escapedName, member);
|
|
55392
|
+
});
|
|
55393
|
+
const type = createAnonymousType(symbol, members, emptyArray, emptyArray, emptyArray);
|
|
55394
|
+
type.objectFlags |= 128 /* ObjectLiteral */ | 262144 /* NonInferrableType */;
|
|
55395
|
+
links.resolvedType = type;
|
|
55396
|
+
}
|
|
55397
|
+
return links.resolvedType;
|
|
55398
|
+
}
|
|
55260
55399
|
function isGlobalSymbolConstructor(node) {
|
|
55261
55400
|
const symbol = getSymbolOfNode(node);
|
|
55262
55401
|
const globalSymbol = getGlobalESSymbolConstructorTypeSymbol(
|
|
@@ -55310,18 +55449,18 @@ ${lanes.join("\n")}
|
|
|
55310
55449
|
}
|
|
55311
55450
|
return false;
|
|
55312
55451
|
}
|
|
55313
|
-
function getTypeOfVariableOrParameterOrProperty(symbol) {
|
|
55452
|
+
function getTypeOfVariableOrParameterOrProperty(symbol, checkMode) {
|
|
55314
55453
|
const links = getSymbolLinks(symbol);
|
|
55315
55454
|
if (!links.type) {
|
|
55316
|
-
const type = getTypeOfVariableOrParameterOrPropertyWorker(symbol);
|
|
55317
|
-
if (!links.type && !isParameterOfContextSensitiveSignature(symbol)) {
|
|
55455
|
+
const type = getTypeOfVariableOrParameterOrPropertyWorker(symbol, checkMode);
|
|
55456
|
+
if (!links.type && !isParameterOfContextSensitiveSignature(symbol) && !checkMode) {
|
|
55318
55457
|
links.type = type;
|
|
55319
55458
|
}
|
|
55320
55459
|
return type;
|
|
55321
55460
|
}
|
|
55322
55461
|
return links.type;
|
|
55323
55462
|
}
|
|
55324
|
-
function getTypeOfVariableOrParameterOrPropertyWorker(symbol) {
|
|
55463
|
+
function getTypeOfVariableOrParameterOrPropertyWorker(symbol, checkMode) {
|
|
55325
55464
|
if (symbol.flags & 4194304 /* Prototype */) {
|
|
55326
55465
|
return getTypeOfPrototypeProperty(symbol);
|
|
55327
55466
|
}
|
|
@@ -55359,6 +55498,9 @@ ${lanes.join("\n")}
|
|
|
55359
55498
|
if (symbol.flags & 512 /* ValueModule */ && !(symbol.flags & 67108864 /* Assignment */)) {
|
|
55360
55499
|
return getTypeOfFuncClassEnumModule(symbol);
|
|
55361
55500
|
}
|
|
55501
|
+
if (isBindingElement(declaration) && checkMode === 1 /* Contextual */) {
|
|
55502
|
+
return errorType;
|
|
55503
|
+
}
|
|
55362
55504
|
return reportCircularityError(symbol);
|
|
55363
55505
|
}
|
|
55364
55506
|
let type;
|
|
@@ -55396,6 +55538,9 @@ ${lanes.join("\n")}
|
|
|
55396
55538
|
if (symbol.flags & 512 /* ValueModule */ && !(symbol.flags & 67108864 /* Assignment */)) {
|
|
55397
55539
|
return getTypeOfFuncClassEnumModule(symbol);
|
|
55398
55540
|
}
|
|
55541
|
+
if (isBindingElement(declaration) && checkMode === 1 /* Contextual */) {
|
|
55542
|
+
return type;
|
|
55543
|
+
}
|
|
55399
55544
|
return reportCircularityError(symbol);
|
|
55400
55545
|
}
|
|
55401
55546
|
return type;
|
|
@@ -55624,7 +55769,7 @@ ${lanes.join("\n")}
|
|
|
55624
55769
|
}
|
|
55625
55770
|
return getTypeOfSymbol(symbol);
|
|
55626
55771
|
}
|
|
55627
|
-
function getTypeOfSymbol(symbol) {
|
|
55772
|
+
function getTypeOfSymbol(symbol, checkMode) {
|
|
55628
55773
|
const checkFlags = getCheckFlags(symbol);
|
|
55629
55774
|
if (checkFlags & 65536 /* DeferredType */) {
|
|
55630
55775
|
return getTypeOfSymbolWithDeferredType(symbol);
|
|
@@ -55639,7 +55784,7 @@ ${lanes.join("\n")}
|
|
|
55639
55784
|
return getTypeOfReverseMappedSymbol(symbol);
|
|
55640
55785
|
}
|
|
55641
55786
|
if (symbol.flags & (3 /* Variable */ | 4 /* Property */)) {
|
|
55642
|
-
return getTypeOfVariableOrParameterOrProperty(symbol);
|
|
55787
|
+
return getTypeOfVariableOrParameterOrProperty(symbol, checkMode);
|
|
55643
55788
|
}
|
|
55644
55789
|
if (symbol.flags & (16 /* Function */ | 8192 /* Method */ | 32 /* Class */ | 384 /* Enum */ | 512 /* ValueModule */)) {
|
|
55645
55790
|
return getTypeOfFuncClassEnumModule(symbol);
|
|
@@ -59255,6 +59400,14 @@ ${lanes.join("\n")}
|
|
|
59255
59400
|
reportErrors2
|
|
59256
59401
|
)) || emptyObjectType;
|
|
59257
59402
|
}
|
|
59403
|
+
function getGlobalImportAttributesType(reportErrors2) {
|
|
59404
|
+
return deferredGlobalImportAttributesType || (deferredGlobalImportAttributesType = getGlobalType(
|
|
59405
|
+
"ImportAttributes",
|
|
59406
|
+
/*arity*/
|
|
59407
|
+
0,
|
|
59408
|
+
reportErrors2
|
|
59409
|
+
)) || emptyObjectType;
|
|
59410
|
+
}
|
|
59258
59411
|
function getGlobalESSymbolConstructorSymbol(reportErrors2) {
|
|
59259
59412
|
return deferredGlobalESSymbolConstructorSymbol || (deferredGlobalESSymbolConstructorSymbol = getGlobalValueSymbol("Symbol", reportErrors2));
|
|
59260
59413
|
}
|
|
@@ -70002,9 +70155,9 @@ ${lanes.join("\n")}
|
|
|
70002
70155
|
}
|
|
70003
70156
|
}
|
|
70004
70157
|
}
|
|
70005
|
-
function getNarrowedTypeOfSymbol(symbol, location) {
|
|
70158
|
+
function getNarrowedTypeOfSymbol(symbol, location, checkMode) {
|
|
70006
70159
|
var _a;
|
|
70007
|
-
const type = getTypeOfSymbol(symbol);
|
|
70160
|
+
const type = getTypeOfSymbol(symbol, checkMode);
|
|
70008
70161
|
const declaration = symbol.valueDeclaration;
|
|
70009
70162
|
if (declaration) {
|
|
70010
70163
|
if (isBindingElement(declaration) && !declaration.initializer && !declaration.dotDotDotToken && declaration.parent.elements.length >= 2) {
|
|
@@ -70131,7 +70284,7 @@ ${lanes.join("\n")}
|
|
|
70131
70284
|
}
|
|
70132
70285
|
}
|
|
70133
70286
|
checkNestedBlockScopedBinding(node, symbol);
|
|
70134
|
-
let type = getNarrowedTypeOfSymbol(localOrExportSymbol, node);
|
|
70287
|
+
let type = getNarrowedTypeOfSymbol(localOrExportSymbol, node, checkMode);
|
|
70135
70288
|
const assignmentKind = getAssignmentTargetKind(node);
|
|
70136
70289
|
if (assignmentKind) {
|
|
70137
70290
|
if (!(localOrExportSymbol.flags & 3 /* Variable */) && !(isInJSFile(node) && localOrExportSymbol.flags & 512 /* ValueModule */)) {
|
|
@@ -71338,7 +71491,7 @@ ${lanes.join("\n")}
|
|
|
71338
71491
|
function instantiateContextualType(contextualType, node, contextFlags) {
|
|
71339
71492
|
if (contextualType && maybeTypeOfKind(contextualType, 465829888 /* Instantiable */)) {
|
|
71340
71493
|
const inferenceContext = getInferenceContext(node);
|
|
71341
|
-
if (inferenceContext &&
|
|
71494
|
+
if (inferenceContext && contextFlags & 1 /* Signature */ && some(inferenceContext.inferences, hasInferenceCandidatesOrDefault)) {
|
|
71342
71495
|
return instantiateInstantiableTypes(contextualType, inferenceContext.nonFixingMapper);
|
|
71343
71496
|
}
|
|
71344
71497
|
if (inferenceContext == null ? void 0 : inferenceContext.returnMapper) {
|
|
@@ -71441,6 +71594,8 @@ ${lanes.join("\n")}
|
|
|
71441
71594
|
case 286 /* JsxOpeningElement */:
|
|
71442
71595
|
case 285 /* JsxSelfClosingElement */:
|
|
71443
71596
|
return getContextualJsxElementAttributesType(parent2, contextFlags);
|
|
71597
|
+
case 301 /* ImportAttribute */:
|
|
71598
|
+
return getContextualImportAttributeType(parent2);
|
|
71444
71599
|
}
|
|
71445
71600
|
return void 0;
|
|
71446
71601
|
}
|
|
@@ -71488,6 +71643,12 @@ ${lanes.join("\n")}
|
|
|
71488
71643
|
}
|
|
71489
71644
|
}
|
|
71490
71645
|
}
|
|
71646
|
+
function getContextualImportAttributeType(node) {
|
|
71647
|
+
return getTypeOfPropertyOfContextualType(getGlobalImportAttributesType(
|
|
71648
|
+
/*reportErrors*/
|
|
71649
|
+
false
|
|
71650
|
+
), getNameFromImportAttribute(node));
|
|
71651
|
+
}
|
|
71491
71652
|
function getContextualJsxElementAttributesType(node, contextFlags) {
|
|
71492
71653
|
if (isJsxOpeningElement(node) && contextFlags !== 4 /* Completions */) {
|
|
71493
71654
|
const index = findContextualNode(
|
|
@@ -83573,6 +83734,13 @@ ${lanes.join("\n")}
|
|
|
83573
83734
|
var _a;
|
|
83574
83735
|
const node = declaration.attributes;
|
|
83575
83736
|
if (node) {
|
|
83737
|
+
const importAttributesType = getGlobalImportAttributesType(
|
|
83738
|
+
/*reportErrors*/
|
|
83739
|
+
true
|
|
83740
|
+
);
|
|
83741
|
+
if (importAttributesType !== emptyObjectType) {
|
|
83742
|
+
checkTypeAssignableTo(getTypeFromImportAttributes(node), getNullableType(importAttributesType, 32768 /* Undefined */), node);
|
|
83743
|
+
}
|
|
83576
83744
|
const validForTypeAttributes = isExclusivelyTypeOnlyImportOrExport(declaration);
|
|
83577
83745
|
const override = getResolutionModeOverride(node, validForTypeAttributes ? grammarErrorOnNode : void 0);
|
|
83578
83746
|
const isImportAttributes2 = declaration.attributes.token === 118 /* WithKeyword */;
|
|
@@ -83592,6 +83760,9 @@ ${lanes.join("\n")}
|
|
|
83592
83760
|
}
|
|
83593
83761
|
}
|
|
83594
83762
|
}
|
|
83763
|
+
function checkImportAttribute(node) {
|
|
83764
|
+
return getRegularTypeOfLiteralType(checkExpressionCached(node.value));
|
|
83765
|
+
}
|
|
83595
83766
|
function checkImportDeclaration(node) {
|
|
83596
83767
|
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)) {
|
|
83597
83768
|
return;
|
|
@@ -85007,6 +85178,12 @@ ${lanes.join("\n")}
|
|
|
85007
85178
|
if (isMetaProperty(node.parent) && node.parent.keywordToken === node.kind) {
|
|
85008
85179
|
return checkMetaPropertyKeyword(node.parent);
|
|
85009
85180
|
}
|
|
85181
|
+
if (isImportAttributes(node)) {
|
|
85182
|
+
return getGlobalImportAttributesType(
|
|
85183
|
+
/*reportErrors*/
|
|
85184
|
+
false
|
|
85185
|
+
);
|
|
85186
|
+
}
|
|
85010
85187
|
return errorType;
|
|
85011
85188
|
}
|
|
85012
85189
|
function getTypeOfAssignmentPattern(expr) {
|
|
@@ -88211,7 +88388,7 @@ ${lanes.join("\n")}
|
|
|
88211
88388
|
return discarded ? discardVisitor(node) : visitor(node);
|
|
88212
88389
|
}, isExpression);
|
|
88213
88390
|
}
|
|
88214
|
-
function visitEachChild(node, visitor, context, nodesVisitor = visitNodes2, tokenVisitor, nodeVisitor = visitNode) {
|
|
88391
|
+
function visitEachChild(node, visitor, context = nullTransformationContext, nodesVisitor = visitNodes2, tokenVisitor, nodeVisitor = visitNode) {
|
|
88215
88392
|
if (node === void 0) {
|
|
88216
88393
|
return void 0;
|
|
88217
88394
|
}
|
|
@@ -102813,12 +102990,22 @@ ${lanes.join("\n")}
|
|
|
102813
102990
|
case 172 /* PropertyDeclaration */: {
|
|
102814
102991
|
const named = node;
|
|
102815
102992
|
if (isComputedPropertyName(named.name)) {
|
|
102816
|
-
return factory2.replacePropertyName(named, visitEachChild(
|
|
102993
|
+
return factory2.replacePropertyName(named, visitEachChild(
|
|
102994
|
+
named.name,
|
|
102995
|
+
elideUnusedThisCaptureWorker,
|
|
102996
|
+
/*context*/
|
|
102997
|
+
void 0
|
|
102998
|
+
));
|
|
102817
102999
|
}
|
|
102818
103000
|
return node;
|
|
102819
103001
|
}
|
|
102820
103002
|
}
|
|
102821
|
-
return visitEachChild(
|
|
103003
|
+
return visitEachChild(
|
|
103004
|
+
node,
|
|
103005
|
+
elideUnusedThisCaptureWorker,
|
|
103006
|
+
/*context*/
|
|
103007
|
+
void 0
|
|
103008
|
+
);
|
|
102822
103009
|
}
|
|
102823
103010
|
function simplifyConstructorElideUnusedThisCapture(body, original) {
|
|
102824
103011
|
if (original.transformFlags & 16384 /* ContainsLexicalThis */ || hierarchyFacts & 65536 /* LexicalThis */ || hierarchyFacts & 131072 /* CapturedLexicalThis */) {
|
|
@@ -102854,12 +103041,22 @@ ${lanes.join("\n")}
|
|
|
102854
103041
|
case 172 /* PropertyDeclaration */: {
|
|
102855
103042
|
const named = node;
|
|
102856
103043
|
if (isComputedPropertyName(named.name)) {
|
|
102857
|
-
return factory2.replacePropertyName(named, visitEachChild(
|
|
103044
|
+
return factory2.replacePropertyName(named, visitEachChild(
|
|
103045
|
+
named.name,
|
|
103046
|
+
injectSuperPresenceCheckWorker,
|
|
103047
|
+
/*context*/
|
|
103048
|
+
void 0
|
|
103049
|
+
));
|
|
102858
103050
|
}
|
|
102859
103051
|
return node;
|
|
102860
103052
|
}
|
|
102861
103053
|
}
|
|
102862
|
-
return visitEachChild(
|
|
103054
|
+
return visitEachChild(
|
|
103055
|
+
node,
|
|
103056
|
+
injectSuperPresenceCheckWorker,
|
|
103057
|
+
/*context*/
|
|
103058
|
+
void 0
|
|
103059
|
+
);
|
|
102863
103060
|
}
|
|
102864
103061
|
function complicateConstructorInjectSuperPresenceCheck(body) {
|
|
102865
103062
|
return factory2.updateBlock(body, visitNodes2(body.statements, injectSuperPresenceCheckWorker, isStatement));
|
|
@@ -111306,44 +111503,6 @@ ${lanes.join("\n")}
|
|
|
111306
111503
|
);
|
|
111307
111504
|
return result.diagnostics;
|
|
111308
111505
|
}
|
|
111309
|
-
function hasInternalAnnotation(range, currentSourceFile) {
|
|
111310
|
-
const comment = currentSourceFile.text.substring(range.pos, range.end);
|
|
111311
|
-
return comment.includes("@internal");
|
|
111312
|
-
}
|
|
111313
|
-
function isInternalDeclaration(node, currentSourceFile) {
|
|
111314
|
-
const parseTreeNode = getParseTreeNode(node);
|
|
111315
|
-
if (parseTreeNode && parseTreeNode.kind === 169 /* Parameter */) {
|
|
111316
|
-
const paramIdx = parseTreeNode.parent.parameters.indexOf(parseTreeNode);
|
|
111317
|
-
const previousSibling = paramIdx > 0 ? parseTreeNode.parent.parameters[paramIdx - 1] : void 0;
|
|
111318
|
-
const text = currentSourceFile.text;
|
|
111319
|
-
const commentRanges = previousSibling ? concatenate(
|
|
111320
|
-
// to handle
|
|
111321
|
-
// ... parameters, /** @internal */
|
|
111322
|
-
// public param: string
|
|
111323
|
-
getTrailingCommentRanges(text, skipTrivia(
|
|
111324
|
-
text,
|
|
111325
|
-
previousSibling.end + 1,
|
|
111326
|
-
/*stopAfterLineBreak*/
|
|
111327
|
-
false,
|
|
111328
|
-
/*stopAtComments*/
|
|
111329
|
-
true
|
|
111330
|
-
)),
|
|
111331
|
-
getLeadingCommentRanges(text, node.pos)
|
|
111332
|
-
) : getTrailingCommentRanges(text, skipTrivia(
|
|
111333
|
-
text,
|
|
111334
|
-
node.pos,
|
|
111335
|
-
/*stopAfterLineBreak*/
|
|
111336
|
-
false,
|
|
111337
|
-
/*stopAtComments*/
|
|
111338
|
-
true
|
|
111339
|
-
));
|
|
111340
|
-
return commentRanges && commentRanges.length && hasInternalAnnotation(last(commentRanges), currentSourceFile);
|
|
111341
|
-
}
|
|
111342
|
-
const leadingCommentRanges = parseTreeNode && getLeadingCommentRangesOfNode(parseTreeNode, currentSourceFile);
|
|
111343
|
-
return !!forEach(leadingCommentRanges, (range) => {
|
|
111344
|
-
return hasInternalAnnotation(range, currentSourceFile);
|
|
111345
|
-
});
|
|
111346
|
-
}
|
|
111347
111506
|
function transformDeclarations(context) {
|
|
111348
111507
|
const throwDiagnostic = () => Debug.fail("Diagnostic emitted without context");
|
|
111349
111508
|
let getSymbolAccessibilityDiagnostic = throwDiagnostic;
|
|
@@ -132903,7 +133062,14 @@ ${lanes.join("\n")}
|
|
|
132903
133062
|
true,
|
|
132904
133063
|
replaceNode
|
|
132905
133064
|
) : (ns) => ns && getSynthesizedDeepClones(ns);
|
|
132906
|
-
const visited = visitEachChild(
|
|
133065
|
+
const visited = visitEachChild(
|
|
133066
|
+
node,
|
|
133067
|
+
nodeClone,
|
|
133068
|
+
/*context*/
|
|
133069
|
+
void 0,
|
|
133070
|
+
nodesClone,
|
|
133071
|
+
nodeClone
|
|
133072
|
+
);
|
|
132907
133073
|
if (visited === node) {
|
|
132908
133074
|
const clone2 = isStringLiteral(node) ? setOriginalNode(factory.createStringLiteralFromNode(node), node) : isNumericLiteral(node) ? setOriginalNode(factory.createNumericLiteral(node.text, node.numericLiteralFlags), node) : factory.cloneNode(node);
|
|
132909
133075
|
return setTextRange(clone2, node);
|
|
@@ -142860,7 +143026,12 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
142860
143026
|
const oldIgnoreReturns = ignoreReturns;
|
|
142861
143027
|
ignoreReturns = ignoreReturns || isFunctionLikeDeclaration(node) || isClassLike(node);
|
|
142862
143028
|
const substitution = substitutions.get(getNodeId(node).toString());
|
|
142863
|
-
const result = substitution ? getSynthesizedDeepClone(substitution) : visitEachChild(
|
|
143029
|
+
const result = substitution ? getSynthesizedDeepClone(substitution) : visitEachChild(
|
|
143030
|
+
node,
|
|
143031
|
+
visitor,
|
|
143032
|
+
/*context*/
|
|
143033
|
+
void 0
|
|
143034
|
+
);
|
|
142864
143035
|
ignoreReturns = oldIgnoreReturns;
|
|
142865
143036
|
return result;
|
|
142866
143037
|
}
|
|
@@ -142870,7 +143041,12 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
142870
143041
|
return substitutions.size ? visitor(initializer) : initializer;
|
|
142871
143042
|
function visitor(node) {
|
|
142872
143043
|
const substitution = substitutions.get(getNodeId(node).toString());
|
|
142873
|
-
return substitution ? getSynthesizedDeepClone(substitution) : visitEachChild(
|
|
143044
|
+
return substitution ? getSynthesizedDeepClone(substitution) : visitEachChild(
|
|
143045
|
+
node,
|
|
143046
|
+
visitor,
|
|
143047
|
+
/*context*/
|
|
143048
|
+
void 0
|
|
143049
|
+
);
|
|
142874
143050
|
}
|
|
142875
143051
|
}
|
|
142876
143052
|
function getStatementsOrClassElements(scope) {
|
|
@@ -147881,7 +148057,12 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
147881
148057
|
case 329 /* JSDocTypeLiteral */:
|
|
147882
148058
|
return transformJSDocTypeLiteral(node);
|
|
147883
148059
|
default:
|
|
147884
|
-
const visited = visitEachChild(
|
|
148060
|
+
const visited = visitEachChild(
|
|
148061
|
+
node,
|
|
148062
|
+
transformJSDocType,
|
|
148063
|
+
/*context*/
|
|
148064
|
+
void 0
|
|
148065
|
+
);
|
|
147885
148066
|
setEmitFlags(visited, 1 /* SingleLine */);
|
|
147886
148067
|
return visited;
|
|
147887
148068
|
}
|
|
@@ -156372,7 +156553,12 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
156372
156553
|
const typeArguments = visitNodes2(node.typeArguments, visit, isTypeNode);
|
|
156373
156554
|
return factory.createTypeReferenceNode(qualifier, typeArguments);
|
|
156374
156555
|
}
|
|
156375
|
-
return visitEachChild(
|
|
156556
|
+
return visitEachChild(
|
|
156557
|
+
node,
|
|
156558
|
+
visit,
|
|
156559
|
+
/*context*/
|
|
156560
|
+
void 0
|
|
156561
|
+
);
|
|
156376
156562
|
}
|
|
156377
156563
|
}
|
|
156378
156564
|
function replaceFirstIdentifierOfEntityName(name, newIdentifier) {
|
|
@@ -160083,7 +160269,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
160083
160269
|
return isIdentifier(e) ? e : isPropertyAccessExpression(e) ? getLeftMostName(e.expression) : void 0;
|
|
160084
160270
|
}
|
|
160085
160271
|
function tryGetGlobalSymbols() {
|
|
160086
|
-
const result = tryGetObjectTypeLiteralInTypeArgumentCompletionSymbols() || tryGetObjectLikeCompletionSymbols() || tryGetImportCompletionSymbols() || tryGetImportOrExportClauseCompletionSymbols() || tryGetLocalNamedExportCompletionSymbols() || tryGetConstructorCompletion() || tryGetClassLikeCompletionSymbols() || tryGetJsxCompletionSymbols() || (getGlobalCompletions(), 1 /* Success */);
|
|
160272
|
+
const result = tryGetObjectTypeLiteralInTypeArgumentCompletionSymbols() || tryGetObjectLikeCompletionSymbols() || tryGetImportCompletionSymbols() || tryGetImportOrExportClauseCompletionSymbols() || tryGetImportAttributesCompletionSymbols() || tryGetLocalNamedExportCompletionSymbols() || tryGetConstructorCompletion() || tryGetClassLikeCompletionSymbols() || tryGetJsxCompletionSymbols() || (getGlobalCompletions(), 1 /* Success */);
|
|
160087
160273
|
return result === 1 /* Success */;
|
|
160088
160274
|
}
|
|
160089
160275
|
function tryGetConstructorCompletion() {
|
|
@@ -160551,6 +160737,16 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
160551
160737
|
}
|
|
160552
160738
|
return 1 /* Success */;
|
|
160553
160739
|
}
|
|
160740
|
+
function tryGetImportAttributesCompletionSymbols() {
|
|
160741
|
+
if (contextToken === void 0)
|
|
160742
|
+
return 0 /* Continue */;
|
|
160743
|
+
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;
|
|
160744
|
+
if (importAttributes === void 0)
|
|
160745
|
+
return 0 /* Continue */;
|
|
160746
|
+
const existing = new Set(importAttributes.elements.map(getNameFromImportAttribute));
|
|
160747
|
+
symbols = filter(typeChecker.getTypeAtLocation(importAttributes).getApparentProperties(), (attr) => !existing.has(attr.escapedName));
|
|
160748
|
+
return 1 /* Success */;
|
|
160749
|
+
}
|
|
160554
160750
|
function tryGetLocalNamedExportCompletionSymbols() {
|
|
160555
160751
|
var _a;
|
|
160556
160752
|
const namedExports = contextToken && (contextToken.kind === 19 /* OpenBraceToken */ || contextToken.kind === 28 /* CommaToken */) ? tryCast(contextToken.parent, isNamedExports) : void 0;
|
|
@@ -163121,6 +163317,11 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
163121
163317
|
return isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent) ? getContextNode(
|
|
163122
163318
|
findAncestor(node.parent, (node2) => isBinaryExpression(node2) || isForInOrOfStatement(node2))
|
|
163123
163319
|
) : node;
|
|
163320
|
+
case 255 /* SwitchStatement */:
|
|
163321
|
+
return {
|
|
163322
|
+
start: find(node.getChildren(node.getSourceFile()), (node2) => node2.kind === 109 /* SwitchKeyword */),
|
|
163323
|
+
end: node.caseBlock
|
|
163324
|
+
};
|
|
163124
163325
|
default:
|
|
163125
163326
|
return node;
|
|
163126
163327
|
}
|
|
@@ -163415,6 +163616,9 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
163415
163616
|
start += 1;
|
|
163416
163617
|
end -= 1;
|
|
163417
163618
|
}
|
|
163619
|
+
if ((endNode2 == null ? void 0 : endNode2.kind) === 269 /* CaseBlock */) {
|
|
163620
|
+
end = endNode2.getFullStart();
|
|
163621
|
+
}
|
|
163418
163622
|
return createTextSpanFromBounds(start, end);
|
|
163419
163623
|
}
|
|
163420
163624
|
function getTextSpanOfEntry(entry) {
|
|
@@ -165025,9 +165229,20 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
165025
165229
|
void 0
|
|
165026
165230
|
)] : void 0;
|
|
165027
165231
|
}
|
|
165028
|
-
|
|
165029
|
-
|
|
165030
|
-
|
|
165232
|
+
switch (node.kind) {
|
|
165233
|
+
case 107 /* ReturnKeyword */:
|
|
165234
|
+
const functionDeclaration = findAncestor(node.parent, (n) => isClassStaticBlockDeclaration(n) ? "quit" : isFunctionLikeDeclaration(n));
|
|
165235
|
+
return functionDeclaration ? [createDefinitionFromSignatureDeclaration(typeChecker, functionDeclaration)] : void 0;
|
|
165236
|
+
case 90 /* DefaultKeyword */:
|
|
165237
|
+
if (!isDefaultClause(node.parent)) {
|
|
165238
|
+
break;
|
|
165239
|
+
}
|
|
165240
|
+
case 84 /* CaseKeyword */:
|
|
165241
|
+
const switchStatement = findAncestor(node.parent, isSwitchStatement);
|
|
165242
|
+
if (switchStatement) {
|
|
165243
|
+
return [createDefinitionInfoFromSwitch(switchStatement, sourceFile)];
|
|
165244
|
+
}
|
|
165245
|
+
break;
|
|
165031
165246
|
}
|
|
165032
165247
|
if (node.kind === 135 /* AwaitKeyword */) {
|
|
165033
165248
|
const functionDeclaration = findAncestor(node, (n) => isFunctionLikeDeclaration(n));
|
|
@@ -165424,6 +165639,23 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
165424
165639
|
failedAliasResolution
|
|
165425
165640
|
};
|
|
165426
165641
|
}
|
|
165642
|
+
function createDefinitionInfoFromSwitch(statement, sourceFile) {
|
|
165643
|
+
const keyword = ts_FindAllReferences_exports.getContextNode(statement);
|
|
165644
|
+
const textSpan = createTextSpanFromNode(isContextWithStartAndEndNode(keyword) ? keyword.start : keyword, sourceFile);
|
|
165645
|
+
return {
|
|
165646
|
+
fileName: sourceFile.fileName,
|
|
165647
|
+
textSpan,
|
|
165648
|
+
kind: "keyword" /* keyword */,
|
|
165649
|
+
name: "switch",
|
|
165650
|
+
containerKind: void 0,
|
|
165651
|
+
containerName: "",
|
|
165652
|
+
...ts_FindAllReferences_exports.toContextSpan(textSpan, sourceFile, keyword),
|
|
165653
|
+
isLocal: true,
|
|
165654
|
+
isAmbient: false,
|
|
165655
|
+
unverified: false,
|
|
165656
|
+
failedAliasResolution: void 0
|
|
165657
|
+
};
|
|
165658
|
+
}
|
|
165427
165659
|
function isDefinitionVisible(checker, declaration) {
|
|
165428
165660
|
if (checker.isDeclarationVisible(declaration))
|
|
165429
165661
|
return true;
|
|
@@ -165501,6 +165733,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
165501
165733
|
"src/services/goToDefinition.ts"() {
|
|
165502
165734
|
"use strict";
|
|
165503
165735
|
init_ts4();
|
|
165736
|
+
init_ts_FindAllReferences();
|
|
165504
165737
|
typesWithUnwrappedTypeArguments = /* @__PURE__ */ new Set([
|
|
165505
165738
|
"Array",
|
|
165506
165739
|
"ArrayLike",
|
|
@@ -186443,6 +186676,7 @@ ${e.message}`;
|
|
|
186443
186676
|
getModuleSpecifierEndingPreference: () => getModuleSpecifierEndingPreference,
|
|
186444
186677
|
getModuleSpecifierResolverHost: () => getModuleSpecifierResolverHost,
|
|
186445
186678
|
getNameForExportedSymbol: () => getNameForExportedSymbol,
|
|
186679
|
+
getNameFromImportAttribute: () => getNameFromImportAttribute,
|
|
186446
186680
|
getNameFromIndexInfo: () => getNameFromIndexInfo,
|
|
186447
186681
|
getNameFromPropertyName: () => getNameFromPropertyName,
|
|
186448
186682
|
getNameOfAccessExpression: () => getNameOfAccessExpression,
|
|
@@ -188864,6 +189098,7 @@ ${e.message}`;
|
|
|
188864
189098
|
getModuleSpecifierEndingPreference: () => getModuleSpecifierEndingPreference,
|
|
188865
189099
|
getModuleSpecifierResolverHost: () => getModuleSpecifierResolverHost,
|
|
188866
189100
|
getNameForExportedSymbol: () => getNameForExportedSymbol,
|
|
189101
|
+
getNameFromImportAttribute: () => getNameFromImportAttribute,
|
|
188867
189102
|
getNameFromIndexInfo: () => getNameFromIndexInfo,
|
|
188868
189103
|
getNameFromPropertyName: () => getNameFromPropertyName,
|
|
188869
189104
|
getNameOfAccessExpression: () => getNameOfAccessExpression,
|