@typescript-deploys/pr-build 5.4.0-pr-56313-12 → 5.4.0-pr-56680-2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/tsc.js +37 -42
- package/lib/tsserver.js +44 -46
- package/lib/typescript.js +43 -46
- package/lib/typingsInstaller.js +16 -8
- package/package.json +2 -2
package/lib/tsc.js
CHANGED
|
@@ -13866,12 +13866,12 @@ function canHaveJSDoc(node) {
|
|
|
13866
13866
|
function getJSDocCommentsAndTags(hostNode, noCache) {
|
|
13867
13867
|
let result;
|
|
13868
13868
|
if (isVariableLike(hostNode) && hasInitializer(hostNode) && hasJSDocNodes(hostNode.initializer)) {
|
|
13869
|
-
result = addRange(result, filterOwnedJSDocTags(hostNode,
|
|
13869
|
+
result = addRange(result, filterOwnedJSDocTags(hostNode, hostNode.initializer.jsDoc));
|
|
13870
13870
|
}
|
|
13871
13871
|
let node = hostNode;
|
|
13872
13872
|
while (node && node.parent) {
|
|
13873
13873
|
if (hasJSDocNodes(node)) {
|
|
13874
|
-
result = addRange(result, filterOwnedJSDocTags(hostNode,
|
|
13874
|
+
result = addRange(result, filterOwnedJSDocTags(hostNode, node.jsDoc));
|
|
13875
13875
|
}
|
|
13876
13876
|
if (node.kind === 169 /* Parameter */) {
|
|
13877
13877
|
result = addRange(result, (noCache ? getJSDocParameterTagsNoCache : getJSDocParameterTags)(node));
|
|
@@ -13885,12 +13885,16 @@ function getJSDocCommentsAndTags(hostNode, noCache) {
|
|
|
13885
13885
|
}
|
|
13886
13886
|
return result || emptyArray;
|
|
13887
13887
|
}
|
|
13888
|
-
function filterOwnedJSDocTags(hostNode,
|
|
13889
|
-
|
|
13890
|
-
|
|
13891
|
-
|
|
13892
|
-
|
|
13893
|
-
|
|
13888
|
+
function filterOwnedJSDocTags(hostNode, comments) {
|
|
13889
|
+
const lastJsDoc = last(comments);
|
|
13890
|
+
return flatMap(comments, (jsDoc) => {
|
|
13891
|
+
if (jsDoc === lastJsDoc) {
|
|
13892
|
+
const ownedTags = filter(jsDoc.tags, (tag) => ownsJSDocTag(hostNode, tag));
|
|
13893
|
+
return jsDoc.tags === ownedTags ? [jsDoc] : ownedTags;
|
|
13894
|
+
} else {
|
|
13895
|
+
return filter(jsDoc.tags, isJSDocOverloadTag);
|
|
13896
|
+
}
|
|
13897
|
+
});
|
|
13894
13898
|
}
|
|
13895
13899
|
function ownsJSDocTag(hostNode, tag) {
|
|
13896
13900
|
return !(isJSDocTypeTag(tag) || isJSDocSatisfiesTag(tag)) || !tag.parent || !isJSDoc(tag.parent) || !isParenthesizedExpression(tag.parent.parent) || tag.parent.parent === hostNode;
|
|
@@ -13929,6 +13933,9 @@ function getEffectiveContainerForJSDocTemplateTag(node) {
|
|
|
13929
13933
|
}
|
|
13930
13934
|
return getHostSignatureFromJSDoc(node);
|
|
13931
13935
|
}
|
|
13936
|
+
function getJSDocOverloadTags(node) {
|
|
13937
|
+
return getAllJSDocTags(node, isJSDocOverloadTag);
|
|
13938
|
+
}
|
|
13932
13939
|
function getHostSignatureFromJSDoc(node) {
|
|
13933
13940
|
const host = getEffectiveJSDocHost(node);
|
|
13934
13941
|
if (host) {
|
|
@@ -16061,6 +16068,7 @@ function Symbol4(flags, name) {
|
|
|
16061
16068
|
this.exportSymbol = void 0;
|
|
16062
16069
|
this.constEnumOnlyModule = void 0;
|
|
16063
16070
|
this.isReferenced = void 0;
|
|
16071
|
+
this.isAssigned = void 0;
|
|
16064
16072
|
this.links = void 0;
|
|
16065
16073
|
}
|
|
16066
16074
|
function Type3(checker, flags) {
|
|
@@ -55493,22 +55501,15 @@ function createTypeChecker(host) {
|
|
|
55493
55501
|
}
|
|
55494
55502
|
}
|
|
55495
55503
|
if (isInJSFile(decl) && decl.jsDoc) {
|
|
55496
|
-
|
|
55497
|
-
|
|
55498
|
-
|
|
55499
|
-
|
|
55500
|
-
|
|
55501
|
-
|
|
55502
|
-
if (jsDocSignature.type === void 0 && !isConstructorDeclaration(decl)) {
|
|
55503
|
-
reportImplicitAny(jsDocSignature, anyType);
|
|
55504
|
-
}
|
|
55505
|
-
result.push(getSignatureFromDeclaration(jsDocSignature));
|
|
55506
|
-
hasJSDocOverloads = true;
|
|
55507
|
-
}
|
|
55504
|
+
const tags = getJSDocOverloadTags(decl);
|
|
55505
|
+
if (length(tags)) {
|
|
55506
|
+
for (const tag of tags) {
|
|
55507
|
+
const jsDocSignature = tag.typeExpression;
|
|
55508
|
+
if (jsDocSignature.type === void 0 && !isConstructorDeclaration(decl)) {
|
|
55509
|
+
reportImplicitAny(jsDocSignature, anyType);
|
|
55508
55510
|
}
|
|
55511
|
+
result.push(getSignatureFromDeclaration(jsDocSignature));
|
|
55509
55512
|
}
|
|
55510
|
-
}
|
|
55511
|
-
if (hasJSDocOverloads) {
|
|
55512
55513
|
continue;
|
|
55513
55514
|
}
|
|
55514
55515
|
}
|
|
@@ -65833,7 +65834,7 @@ function createTypeChecker(host) {
|
|
|
65833
65834
|
case 80 /* Identifier */:
|
|
65834
65835
|
if (!isThisInTypeQuery(node)) {
|
|
65835
65836
|
const symbol = getResolvedSymbol(node);
|
|
65836
|
-
return isConstantVariable(symbol) || isParameterOrCatchClauseVariable(symbol) && !
|
|
65837
|
+
return isConstantVariable(symbol) || isParameterOrCatchClauseVariable(symbol) && !isSymbolAssigned(symbol);
|
|
65837
65838
|
}
|
|
65838
65839
|
break;
|
|
65839
65840
|
case 211 /* PropertyAccessExpression */:
|
|
@@ -66922,8 +66923,11 @@ function createTypeChecker(host) {
|
|
|
66922
66923
|
function getControlFlowContainer(node) {
|
|
66923
66924
|
return findAncestor(node.parent, (node2) => isFunctionLike(node2) && !getImmediatelyInvokedFunctionExpression(node2) || node2.kind === 268 /* ModuleBlock */ || node2.kind === 312 /* SourceFile */ || node2.kind === 172 /* PropertyDeclaration */);
|
|
66924
66925
|
}
|
|
66925
|
-
function
|
|
66926
|
-
|
|
66926
|
+
function isSymbolAssigned(symbol) {
|
|
66927
|
+
if (!symbol.valueDeclaration) {
|
|
66928
|
+
return false;
|
|
66929
|
+
}
|
|
66930
|
+
const parent = getRootDeclaration(symbol.valueDeclaration).parent;
|
|
66927
66931
|
const links = getNodeLinks(parent);
|
|
66928
66932
|
if (!(links.flags & 131072 /* AssignmentsMarked */)) {
|
|
66929
66933
|
links.flags |= 131072 /* AssignmentsMarked */;
|
|
@@ -66931,7 +66935,7 @@ function createTypeChecker(host) {
|
|
|
66931
66935
|
markNodeAssignments(parent);
|
|
66932
66936
|
}
|
|
66933
66937
|
}
|
|
66934
|
-
return
|
|
66938
|
+
return symbol.isAssigned || false;
|
|
66935
66939
|
}
|
|
66936
66940
|
function hasParentWithAssignmentsMarked(node) {
|
|
66937
66941
|
return !!findAncestor(node.parent, (node2) => (isFunctionLike(node2) || isCatchClause(node2)) && !!(getNodeLinks(node2).flags & 131072 /* AssignmentsMarked */));
|
|
@@ -66941,11 +66945,11 @@ function createTypeChecker(host) {
|
|
|
66941
66945
|
if (isAssignmentTarget(node)) {
|
|
66942
66946
|
const symbol = getResolvedSymbol(node);
|
|
66943
66947
|
if (isParameterOrCatchClauseVariable(symbol)) {
|
|
66944
|
-
|
|
66948
|
+
symbol.isAssigned = true;
|
|
66945
66949
|
}
|
|
66946
66950
|
}
|
|
66947
66951
|
} else {
|
|
66948
|
-
|
|
66952
|
+
forEachChild(node, markNodeAssignments);
|
|
66949
66953
|
}
|
|
66950
66954
|
}
|
|
66951
66955
|
function isConstantVariable(symbol) {
|
|
@@ -67046,7 +67050,7 @@ function createTypeChecker(host) {
|
|
|
67046
67050
|
const parentType = getTypeForBindingElementParent(parent, 0 /* Normal */);
|
|
67047
67051
|
const parentTypeConstraint = parentType && mapType(parentType, getBaseConstraintOrType);
|
|
67048
67052
|
links.flags &= ~4194304 /* InCheckIdentifier */;
|
|
67049
|
-
if (parentTypeConstraint && parentTypeConstraint.flags & 1048576 /* Union */ && !(rootDeclaration.kind === 169 /* Parameter */ &&
|
|
67053
|
+
if (parentTypeConstraint && parentTypeConstraint.flags & 1048576 /* Union */ && !(rootDeclaration.kind === 169 /* Parameter */ && isSymbolAssigned(symbol))) {
|
|
67050
67054
|
const pattern = declaration.parent;
|
|
67051
67055
|
const narrowedType = getFlowTypeOfReference(
|
|
67052
67056
|
pattern,
|
|
@@ -67075,7 +67079,7 @@ function createTypeChecker(host) {
|
|
|
67075
67079
|
const contextualSignature = getContextualSignature(func);
|
|
67076
67080
|
if (contextualSignature && contextualSignature.parameters.length === 1 && signatureHasRestParameter(contextualSignature)) {
|
|
67077
67081
|
const restType = getReducedApparentType(instantiateType(getTypeOfSymbol(contextualSignature.parameters[0]), (_a = getInferenceContext(func)) == null ? void 0 : _a.nonFixingMapper));
|
|
67078
|
-
if (restType.flags & 1048576 /* Union */ && everyType(restType, isTupleType) && !
|
|
67082
|
+
if (restType.flags & 1048576 /* Union */ && everyType(restType, isTupleType) && !isSymbolAssigned(symbol)) {
|
|
67079
67083
|
const narrowedType = getFlowTypeOfReference(
|
|
67080
67084
|
func,
|
|
67081
67085
|
restType,
|
|
@@ -67191,8 +67195,7 @@ function createTypeChecker(host) {
|
|
|
67191
67195
|
return type;
|
|
67192
67196
|
}
|
|
67193
67197
|
type = getNarrowableTypeForReference(type, node, checkMode);
|
|
67194
|
-
const
|
|
67195
|
-
const isParameter2 = rootDeclaration.kind === 169 /* Parameter */;
|
|
67198
|
+
const isParameter2 = getRootDeclaration(declaration).kind === 169 /* Parameter */;
|
|
67196
67199
|
const declarationContainer = getControlFlowContainer(declaration);
|
|
67197
67200
|
let flowContainer = getControlFlowContainer(node);
|
|
67198
67201
|
const isOuterVariable = flowContainer !== declarationContainer;
|
|
@@ -67200,7 +67203,7 @@ function createTypeChecker(host) {
|
|
|
67200
67203
|
const isModuleExports = symbol.flags & 134217728 /* ModuleExports */;
|
|
67201
67204
|
const typeIsAutomatic = type === autoType || type === autoArrayType;
|
|
67202
67205
|
const isAutomaticTypeInNonNull = typeIsAutomatic && node.parent.kind === 235 /* NonNullExpression */;
|
|
67203
|
-
while (flowContainer !== declarationContainer && (flowContainer.kind === 218 /* FunctionExpression */ || flowContainer.kind === 219 /* ArrowFunction */ || isObjectLiteralOrClassExpressionMethodOrAccessor(flowContainer)) && (isConstantVariable(localOrExportSymbol) && type !== autoArrayType || isParameter2 && !
|
|
67206
|
+
while (flowContainer !== declarationContainer && (flowContainer.kind === 218 /* FunctionExpression */ || flowContainer.kind === 219 /* ArrowFunction */ || isObjectLiteralOrClassExpressionMethodOrAccessor(flowContainer)) && (isConstantVariable(localOrExportSymbol) && type !== autoArrayType || isParameter2 && !isSymbolAssigned(localOrExportSymbol))) {
|
|
67204
67207
|
flowContainer = getControlFlowContainer(flowContainer);
|
|
67205
67208
|
}
|
|
67206
67209
|
const assumeInitialized = isParameter2 || isAlias || isOuterVariable || isSpreadDestructuringAssignmentTarget || isModuleExports || isSameScopedBindingElement(node, declaration) || type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & (3 /* AnyOrUnknown */ | 16384 /* Void */)) !== 0 || isInTypeQuery(node) || isInAmbientOrTypeNode(node) || node.parent.kind === 281 /* ExportSpecifier */) || node.parent.kind === 235 /* NonNullExpression */ || declaration.kind === 260 /* VariableDeclaration */ && declaration.exclamationToken || declaration.flags & 33554432 /* Ambient */;
|
|
@@ -76657,15 +76660,7 @@ function createTypeChecker(host) {
|
|
|
76657
76660
|
}
|
|
76658
76661
|
}
|
|
76659
76662
|
if (isInJSFile(current) && isFunctionLike(current) && current.jsDoc) {
|
|
76660
|
-
|
|
76661
|
-
if (node2.tags) {
|
|
76662
|
-
for (const tag of node2.tags) {
|
|
76663
|
-
if (isJSDocOverloadTag(tag)) {
|
|
76664
|
-
hasOverloads = true;
|
|
76665
|
-
}
|
|
76666
|
-
}
|
|
76667
|
-
}
|
|
76668
|
-
}
|
|
76663
|
+
hasOverloads = length(getJSDocOverloadTags(current)) > 0;
|
|
76669
76664
|
}
|
|
76670
76665
|
}
|
|
76671
76666
|
}
|
package/lib/tsserver.js
CHANGED
|
@@ -822,6 +822,7 @@ __export(server_exports, {
|
|
|
822
822
|
getJSDocEnumTag: () => getJSDocEnumTag,
|
|
823
823
|
getJSDocHost: () => getJSDocHost,
|
|
824
824
|
getJSDocImplementsTags: () => getJSDocImplementsTags,
|
|
825
|
+
getJSDocOverloadTags: () => getJSDocOverloadTags,
|
|
825
826
|
getJSDocOverrideTagNoCache: () => getJSDocOverrideTagNoCache,
|
|
826
827
|
getJSDocParameterTags: () => getJSDocParameterTags,
|
|
827
828
|
getJSDocParameterTagsNoCache: () => getJSDocParameterTagsNoCache,
|
|
@@ -17757,12 +17758,12 @@ function canHaveJSDoc(node) {
|
|
|
17757
17758
|
function getJSDocCommentsAndTags(hostNode, noCache) {
|
|
17758
17759
|
let result;
|
|
17759
17760
|
if (isVariableLike(hostNode) && hasInitializer(hostNode) && hasJSDocNodes(hostNode.initializer)) {
|
|
17760
|
-
result = addRange(result, filterOwnedJSDocTags(hostNode,
|
|
17761
|
+
result = addRange(result, filterOwnedJSDocTags(hostNode, hostNode.initializer.jsDoc));
|
|
17761
17762
|
}
|
|
17762
17763
|
let node = hostNode;
|
|
17763
17764
|
while (node && node.parent) {
|
|
17764
17765
|
if (hasJSDocNodes(node)) {
|
|
17765
|
-
result = addRange(result, filterOwnedJSDocTags(hostNode,
|
|
17766
|
+
result = addRange(result, filterOwnedJSDocTags(hostNode, node.jsDoc));
|
|
17766
17767
|
}
|
|
17767
17768
|
if (node.kind === 169 /* Parameter */) {
|
|
17768
17769
|
result = addRange(result, (noCache ? getJSDocParameterTagsNoCache : getJSDocParameterTags)(node));
|
|
@@ -17776,12 +17777,16 @@ function getJSDocCommentsAndTags(hostNode, noCache) {
|
|
|
17776
17777
|
}
|
|
17777
17778
|
return result || emptyArray;
|
|
17778
17779
|
}
|
|
17779
|
-
function filterOwnedJSDocTags(hostNode,
|
|
17780
|
-
|
|
17781
|
-
|
|
17782
|
-
|
|
17783
|
-
|
|
17784
|
-
|
|
17780
|
+
function filterOwnedJSDocTags(hostNode, comments) {
|
|
17781
|
+
const lastJsDoc = last(comments);
|
|
17782
|
+
return flatMap(comments, (jsDoc) => {
|
|
17783
|
+
if (jsDoc === lastJsDoc) {
|
|
17784
|
+
const ownedTags = filter(jsDoc.tags, (tag) => ownsJSDocTag(hostNode, tag));
|
|
17785
|
+
return jsDoc.tags === ownedTags ? [jsDoc] : ownedTags;
|
|
17786
|
+
} else {
|
|
17787
|
+
return filter(jsDoc.tags, isJSDocOverloadTag);
|
|
17788
|
+
}
|
|
17789
|
+
});
|
|
17785
17790
|
}
|
|
17786
17791
|
function ownsJSDocTag(hostNode, tag) {
|
|
17787
17792
|
return !(isJSDocTypeTag(tag) || isJSDocSatisfiesTag(tag)) || !tag.parent || !isJSDoc(tag.parent) || !isParenthesizedExpression(tag.parent.parent) || tag.parent.parent === hostNode;
|
|
@@ -17820,6 +17825,9 @@ function getEffectiveContainerForJSDocTemplateTag(node) {
|
|
|
17820
17825
|
}
|
|
17821
17826
|
return getHostSignatureFromJSDoc(node);
|
|
17822
17827
|
}
|
|
17828
|
+
function getJSDocOverloadTags(node) {
|
|
17829
|
+
return getAllJSDocTags(node, isJSDocOverloadTag);
|
|
17830
|
+
}
|
|
17823
17831
|
function getHostSignatureFromJSDoc(node) {
|
|
17824
17832
|
const host = getEffectiveJSDocHost(node);
|
|
17825
17833
|
if (host) {
|
|
@@ -20205,6 +20213,7 @@ function Symbol4(flags, name) {
|
|
|
20205
20213
|
this.exportSymbol = void 0;
|
|
20206
20214
|
this.constEnumOnlyModule = void 0;
|
|
20207
20215
|
this.isReferenced = void 0;
|
|
20216
|
+
this.isAssigned = void 0;
|
|
20208
20217
|
this.links = void 0;
|
|
20209
20218
|
}
|
|
20210
20219
|
function Type3(checker, flags) {
|
|
@@ -60221,22 +60230,15 @@ function createTypeChecker(host) {
|
|
|
60221
60230
|
}
|
|
60222
60231
|
}
|
|
60223
60232
|
if (isInJSFile(decl) && decl.jsDoc) {
|
|
60224
|
-
|
|
60225
|
-
|
|
60226
|
-
|
|
60227
|
-
|
|
60228
|
-
|
|
60229
|
-
|
|
60230
|
-
if (jsDocSignature.type === void 0 && !isConstructorDeclaration(decl)) {
|
|
60231
|
-
reportImplicitAny(jsDocSignature, anyType);
|
|
60232
|
-
}
|
|
60233
|
-
result.push(getSignatureFromDeclaration(jsDocSignature));
|
|
60234
|
-
hasJSDocOverloads = true;
|
|
60235
|
-
}
|
|
60233
|
+
const tags = getJSDocOverloadTags(decl);
|
|
60234
|
+
if (length(tags)) {
|
|
60235
|
+
for (const tag of tags) {
|
|
60236
|
+
const jsDocSignature = tag.typeExpression;
|
|
60237
|
+
if (jsDocSignature.type === void 0 && !isConstructorDeclaration(decl)) {
|
|
60238
|
+
reportImplicitAny(jsDocSignature, anyType);
|
|
60236
60239
|
}
|
|
60240
|
+
result.push(getSignatureFromDeclaration(jsDocSignature));
|
|
60237
60241
|
}
|
|
60238
|
-
}
|
|
60239
|
-
if (hasJSDocOverloads) {
|
|
60240
60242
|
continue;
|
|
60241
60243
|
}
|
|
60242
60244
|
}
|
|
@@ -70561,7 +70563,7 @@ function createTypeChecker(host) {
|
|
|
70561
70563
|
case 80 /* Identifier */:
|
|
70562
70564
|
if (!isThisInTypeQuery(node)) {
|
|
70563
70565
|
const symbol = getResolvedSymbol(node);
|
|
70564
|
-
return isConstantVariable(symbol) || isParameterOrCatchClauseVariable(symbol) && !
|
|
70566
|
+
return isConstantVariable(symbol) || isParameterOrCatchClauseVariable(symbol) && !isSymbolAssigned(symbol);
|
|
70565
70567
|
}
|
|
70566
70568
|
break;
|
|
70567
70569
|
case 211 /* PropertyAccessExpression */:
|
|
@@ -71650,8 +71652,11 @@ function createTypeChecker(host) {
|
|
|
71650
71652
|
function getControlFlowContainer(node) {
|
|
71651
71653
|
return findAncestor(node.parent, (node2) => isFunctionLike(node2) && !getImmediatelyInvokedFunctionExpression(node2) || node2.kind === 268 /* ModuleBlock */ || node2.kind === 312 /* SourceFile */ || node2.kind === 172 /* PropertyDeclaration */);
|
|
71652
71654
|
}
|
|
71653
|
-
function
|
|
71654
|
-
|
|
71655
|
+
function isSymbolAssigned(symbol) {
|
|
71656
|
+
if (!symbol.valueDeclaration) {
|
|
71657
|
+
return false;
|
|
71658
|
+
}
|
|
71659
|
+
const parent2 = getRootDeclaration(symbol.valueDeclaration).parent;
|
|
71655
71660
|
const links = getNodeLinks(parent2);
|
|
71656
71661
|
if (!(links.flags & 131072 /* AssignmentsMarked */)) {
|
|
71657
71662
|
links.flags |= 131072 /* AssignmentsMarked */;
|
|
@@ -71659,7 +71664,7 @@ function createTypeChecker(host) {
|
|
|
71659
71664
|
markNodeAssignments(parent2);
|
|
71660
71665
|
}
|
|
71661
71666
|
}
|
|
71662
|
-
return
|
|
71667
|
+
return symbol.isAssigned || false;
|
|
71663
71668
|
}
|
|
71664
71669
|
function hasParentWithAssignmentsMarked(node) {
|
|
71665
71670
|
return !!findAncestor(node.parent, (node2) => (isFunctionLike(node2) || isCatchClause(node2)) && !!(getNodeLinks(node2).flags & 131072 /* AssignmentsMarked */));
|
|
@@ -71669,11 +71674,11 @@ function createTypeChecker(host) {
|
|
|
71669
71674
|
if (isAssignmentTarget(node)) {
|
|
71670
71675
|
const symbol = getResolvedSymbol(node);
|
|
71671
71676
|
if (isParameterOrCatchClauseVariable(symbol)) {
|
|
71672
|
-
|
|
71677
|
+
symbol.isAssigned = true;
|
|
71673
71678
|
}
|
|
71674
71679
|
}
|
|
71675
71680
|
} else {
|
|
71676
|
-
|
|
71681
|
+
forEachChild(node, markNodeAssignments);
|
|
71677
71682
|
}
|
|
71678
71683
|
}
|
|
71679
71684
|
function isConstantVariable(symbol) {
|
|
@@ -71774,7 +71779,7 @@ function createTypeChecker(host) {
|
|
|
71774
71779
|
const parentType = getTypeForBindingElementParent(parent2, 0 /* Normal */);
|
|
71775
71780
|
const parentTypeConstraint = parentType && mapType(parentType, getBaseConstraintOrType);
|
|
71776
71781
|
links.flags &= ~4194304 /* InCheckIdentifier */;
|
|
71777
|
-
if (parentTypeConstraint && parentTypeConstraint.flags & 1048576 /* Union */ && !(rootDeclaration.kind === 169 /* Parameter */ &&
|
|
71782
|
+
if (parentTypeConstraint && parentTypeConstraint.flags & 1048576 /* Union */ && !(rootDeclaration.kind === 169 /* Parameter */ && isSymbolAssigned(symbol))) {
|
|
71778
71783
|
const pattern = declaration.parent;
|
|
71779
71784
|
const narrowedType = getFlowTypeOfReference(
|
|
71780
71785
|
pattern,
|
|
@@ -71803,7 +71808,7 @@ function createTypeChecker(host) {
|
|
|
71803
71808
|
const contextualSignature = getContextualSignature(func);
|
|
71804
71809
|
if (contextualSignature && contextualSignature.parameters.length === 1 && signatureHasRestParameter(contextualSignature)) {
|
|
71805
71810
|
const restType = getReducedApparentType(instantiateType(getTypeOfSymbol(contextualSignature.parameters[0]), (_a = getInferenceContext(func)) == null ? void 0 : _a.nonFixingMapper));
|
|
71806
|
-
if (restType.flags & 1048576 /* Union */ && everyType(restType, isTupleType) && !
|
|
71811
|
+
if (restType.flags & 1048576 /* Union */ && everyType(restType, isTupleType) && !isSymbolAssigned(symbol)) {
|
|
71807
71812
|
const narrowedType = getFlowTypeOfReference(
|
|
71808
71813
|
func,
|
|
71809
71814
|
restType,
|
|
@@ -71919,8 +71924,7 @@ function createTypeChecker(host) {
|
|
|
71919
71924
|
return type;
|
|
71920
71925
|
}
|
|
71921
71926
|
type = getNarrowableTypeForReference(type, node, checkMode);
|
|
71922
|
-
const
|
|
71923
|
-
const isParameter2 = rootDeclaration.kind === 169 /* Parameter */;
|
|
71927
|
+
const isParameter2 = getRootDeclaration(declaration).kind === 169 /* Parameter */;
|
|
71924
71928
|
const declarationContainer = getControlFlowContainer(declaration);
|
|
71925
71929
|
let flowContainer = getControlFlowContainer(node);
|
|
71926
71930
|
const isOuterVariable = flowContainer !== declarationContainer;
|
|
@@ -71928,7 +71932,7 @@ function createTypeChecker(host) {
|
|
|
71928
71932
|
const isModuleExports = symbol.flags & 134217728 /* ModuleExports */;
|
|
71929
71933
|
const typeIsAutomatic = type === autoType || type === autoArrayType;
|
|
71930
71934
|
const isAutomaticTypeInNonNull = typeIsAutomatic && node.parent.kind === 235 /* NonNullExpression */;
|
|
71931
|
-
while (flowContainer !== declarationContainer && (flowContainer.kind === 218 /* FunctionExpression */ || flowContainer.kind === 219 /* ArrowFunction */ || isObjectLiteralOrClassExpressionMethodOrAccessor(flowContainer)) && (isConstantVariable(localOrExportSymbol) && type !== autoArrayType || isParameter2 && !
|
|
71935
|
+
while (flowContainer !== declarationContainer && (flowContainer.kind === 218 /* FunctionExpression */ || flowContainer.kind === 219 /* ArrowFunction */ || isObjectLiteralOrClassExpressionMethodOrAccessor(flowContainer)) && (isConstantVariable(localOrExportSymbol) && type !== autoArrayType || isParameter2 && !isSymbolAssigned(localOrExportSymbol))) {
|
|
71932
71936
|
flowContainer = getControlFlowContainer(flowContainer);
|
|
71933
71937
|
}
|
|
71934
71938
|
const assumeInitialized = isParameter2 || isAlias || isOuterVariable || isSpreadDestructuringAssignmentTarget || isModuleExports || isSameScopedBindingElement(node, declaration) || type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & (3 /* AnyOrUnknown */ | 16384 /* Void */)) !== 0 || isInTypeQuery(node) || isInAmbientOrTypeNode(node) || node.parent.kind === 281 /* ExportSpecifier */) || node.parent.kind === 235 /* NonNullExpression */ || declaration.kind === 260 /* VariableDeclaration */ && declaration.exclamationToken || declaration.flags & 33554432 /* Ambient */;
|
|
@@ -81385,15 +81389,7 @@ function createTypeChecker(host) {
|
|
|
81385
81389
|
}
|
|
81386
81390
|
}
|
|
81387
81391
|
if (isInJSFile(current) && isFunctionLike(current) && current.jsDoc) {
|
|
81388
|
-
|
|
81389
|
-
if (node2.tags) {
|
|
81390
|
-
for (const tag of node2.tags) {
|
|
81391
|
-
if (isJSDocOverloadTag(tag)) {
|
|
81392
|
-
hasOverloads = true;
|
|
81393
|
-
}
|
|
81394
|
-
}
|
|
81395
|
-
}
|
|
81396
|
-
}
|
|
81392
|
+
hasOverloads = length(getJSDocOverloadTags(current)) > 0;
|
|
81397
81393
|
}
|
|
81398
81394
|
}
|
|
81399
81395
|
}
|
|
@@ -167628,16 +167624,16 @@ function getRenameInfoForModule(node, sourceFile, moduleSymbol) {
|
|
|
167628
167624
|
if (!moduleSourceFile)
|
|
167629
167625
|
return void 0;
|
|
167630
167626
|
const withoutIndex = endsWith(node.text, "/index") || endsWith(node.text, "/index.js") ? void 0 : tryRemoveSuffix(removeFileExtension(moduleSourceFile.fileName), "/index");
|
|
167631
|
-
const
|
|
167627
|
+
const fileName = withoutIndex === void 0 ? moduleSourceFile.fileName : withoutIndex;
|
|
167632
167628
|
const kind = withoutIndex === void 0 ? "module" /* moduleElement */ : "directory" /* directory */;
|
|
167633
167629
|
const indexAfterLastSlash = node.text.lastIndexOf("/") + 1;
|
|
167634
167630
|
const triggerSpan = createTextSpan(node.getStart(sourceFile) + 1 + indexAfterLastSlash, node.text.length - indexAfterLastSlash);
|
|
167635
167631
|
return {
|
|
167636
167632
|
canRename: true,
|
|
167637
|
-
fileToRename:
|
|
167633
|
+
fileToRename: fileName,
|
|
167638
167634
|
kind,
|
|
167639
|
-
displayName:
|
|
167640
|
-
fullDisplayName:
|
|
167635
|
+
displayName: fileName,
|
|
167636
|
+
fullDisplayName: node.text,
|
|
167641
167637
|
kindModifiers: "" /* none */,
|
|
167642
167638
|
triggerSpan
|
|
167643
167639
|
};
|
|
@@ -173948,6 +173944,7 @@ __export(ts_exports2, {
|
|
|
173948
173944
|
getJSDocEnumTag: () => getJSDocEnumTag,
|
|
173949
173945
|
getJSDocHost: () => getJSDocHost,
|
|
173950
173946
|
getJSDocImplementsTags: () => getJSDocImplementsTags,
|
|
173947
|
+
getJSDocOverloadTags: () => getJSDocOverloadTags,
|
|
173951
173948
|
getJSDocOverrideTagNoCache: () => getJSDocOverrideTagNoCache,
|
|
173952
173949
|
getJSDocParameterTags: () => getJSDocParameterTags,
|
|
173953
173950
|
getJSDocParameterTagsNoCache: () => getJSDocParameterTagsNoCache,
|
|
@@ -188741,6 +188738,7 @@ start(initializeNodeSystem(), require("os").platform());
|
|
|
188741
188738
|
getJSDocEnumTag,
|
|
188742
188739
|
getJSDocHost,
|
|
188743
188740
|
getJSDocImplementsTags,
|
|
188741
|
+
getJSDocOverloadTags,
|
|
188744
188742
|
getJSDocOverrideTagNoCache,
|
|
188745
188743
|
getJSDocParameterTags,
|
|
188746
188744
|
getJSDocParameterTagsNoCache,
|
package/lib/typescript.js
CHANGED
|
@@ -15135,12 +15135,12 @@ ${lanes.join("\n")}
|
|
|
15135
15135
|
function getJSDocCommentsAndTags(hostNode, noCache) {
|
|
15136
15136
|
let result;
|
|
15137
15137
|
if (isVariableLike(hostNode) && hasInitializer(hostNode) && hasJSDocNodes(hostNode.initializer)) {
|
|
15138
|
-
result = addRange(result, filterOwnedJSDocTags(hostNode,
|
|
15138
|
+
result = addRange(result, filterOwnedJSDocTags(hostNode, hostNode.initializer.jsDoc));
|
|
15139
15139
|
}
|
|
15140
15140
|
let node = hostNode;
|
|
15141
15141
|
while (node && node.parent) {
|
|
15142
15142
|
if (hasJSDocNodes(node)) {
|
|
15143
|
-
result = addRange(result, filterOwnedJSDocTags(hostNode,
|
|
15143
|
+
result = addRange(result, filterOwnedJSDocTags(hostNode, node.jsDoc));
|
|
15144
15144
|
}
|
|
15145
15145
|
if (node.kind === 169 /* Parameter */) {
|
|
15146
15146
|
result = addRange(result, (noCache ? getJSDocParameterTagsNoCache : getJSDocParameterTags)(node));
|
|
@@ -15154,12 +15154,16 @@ ${lanes.join("\n")}
|
|
|
15154
15154
|
}
|
|
15155
15155
|
return result || emptyArray;
|
|
15156
15156
|
}
|
|
15157
|
-
function filterOwnedJSDocTags(hostNode,
|
|
15158
|
-
|
|
15159
|
-
|
|
15160
|
-
|
|
15161
|
-
|
|
15162
|
-
|
|
15157
|
+
function filterOwnedJSDocTags(hostNode, comments) {
|
|
15158
|
+
const lastJsDoc = last(comments);
|
|
15159
|
+
return flatMap(comments, (jsDoc) => {
|
|
15160
|
+
if (jsDoc === lastJsDoc) {
|
|
15161
|
+
const ownedTags = filter(jsDoc.tags, (tag) => ownsJSDocTag(hostNode, tag));
|
|
15162
|
+
return jsDoc.tags === ownedTags ? [jsDoc] : ownedTags;
|
|
15163
|
+
} else {
|
|
15164
|
+
return filter(jsDoc.tags, isJSDocOverloadTag);
|
|
15165
|
+
}
|
|
15166
|
+
});
|
|
15163
15167
|
}
|
|
15164
15168
|
function ownsJSDocTag(hostNode, tag) {
|
|
15165
15169
|
return !(isJSDocTypeTag(tag) || isJSDocSatisfiesTag(tag)) || !tag.parent || !isJSDoc(tag.parent) || !isParenthesizedExpression(tag.parent.parent) || tag.parent.parent === hostNode;
|
|
@@ -15198,6 +15202,9 @@ ${lanes.join("\n")}
|
|
|
15198
15202
|
}
|
|
15199
15203
|
return getHostSignatureFromJSDoc(node);
|
|
15200
15204
|
}
|
|
15205
|
+
function getJSDocOverloadTags(node) {
|
|
15206
|
+
return getAllJSDocTags(node, isJSDocOverloadTag);
|
|
15207
|
+
}
|
|
15201
15208
|
function getHostSignatureFromJSDoc(node) {
|
|
15202
15209
|
const host = getEffectiveJSDocHost(node);
|
|
15203
15210
|
if (host) {
|
|
@@ -17501,6 +17508,7 @@ ${lanes.join("\n")}
|
|
|
17501
17508
|
this.exportSymbol = void 0;
|
|
17502
17509
|
this.constEnumOnlyModule = void 0;
|
|
17503
17510
|
this.isReferenced = void 0;
|
|
17511
|
+
this.isAssigned = void 0;
|
|
17504
17512
|
this.links = void 0;
|
|
17505
17513
|
}
|
|
17506
17514
|
function Type3(checker, flags) {
|
|
@@ -57983,22 +57991,15 @@ ${lanes.join("\n")}
|
|
|
57983
57991
|
}
|
|
57984
57992
|
}
|
|
57985
57993
|
if (isInJSFile(decl) && decl.jsDoc) {
|
|
57986
|
-
|
|
57987
|
-
|
|
57988
|
-
|
|
57989
|
-
|
|
57990
|
-
|
|
57991
|
-
|
|
57992
|
-
if (jsDocSignature.type === void 0 && !isConstructorDeclaration(decl)) {
|
|
57993
|
-
reportImplicitAny(jsDocSignature, anyType);
|
|
57994
|
-
}
|
|
57995
|
-
result.push(getSignatureFromDeclaration(jsDocSignature));
|
|
57996
|
-
hasJSDocOverloads = true;
|
|
57997
|
-
}
|
|
57994
|
+
const tags = getJSDocOverloadTags(decl);
|
|
57995
|
+
if (length(tags)) {
|
|
57996
|
+
for (const tag of tags) {
|
|
57997
|
+
const jsDocSignature = tag.typeExpression;
|
|
57998
|
+
if (jsDocSignature.type === void 0 && !isConstructorDeclaration(decl)) {
|
|
57999
|
+
reportImplicitAny(jsDocSignature, anyType);
|
|
57998
58000
|
}
|
|
58001
|
+
result.push(getSignatureFromDeclaration(jsDocSignature));
|
|
57999
58002
|
}
|
|
58000
|
-
}
|
|
58001
|
-
if (hasJSDocOverloads) {
|
|
58002
58003
|
continue;
|
|
58003
58004
|
}
|
|
58004
58005
|
}
|
|
@@ -68323,7 +68324,7 @@ ${lanes.join("\n")}
|
|
|
68323
68324
|
case 80 /* Identifier */:
|
|
68324
68325
|
if (!isThisInTypeQuery(node)) {
|
|
68325
68326
|
const symbol = getResolvedSymbol(node);
|
|
68326
|
-
return isConstantVariable(symbol) || isParameterOrCatchClauseVariable(symbol) && !
|
|
68327
|
+
return isConstantVariable(symbol) || isParameterOrCatchClauseVariable(symbol) && !isSymbolAssigned(symbol);
|
|
68327
68328
|
}
|
|
68328
68329
|
break;
|
|
68329
68330
|
case 211 /* PropertyAccessExpression */:
|
|
@@ -69412,8 +69413,11 @@ ${lanes.join("\n")}
|
|
|
69412
69413
|
function getControlFlowContainer(node) {
|
|
69413
69414
|
return findAncestor(node.parent, (node2) => isFunctionLike(node2) && !getImmediatelyInvokedFunctionExpression(node2) || node2.kind === 268 /* ModuleBlock */ || node2.kind === 312 /* SourceFile */ || node2.kind === 172 /* PropertyDeclaration */);
|
|
69414
69415
|
}
|
|
69415
|
-
function
|
|
69416
|
-
|
|
69416
|
+
function isSymbolAssigned(symbol) {
|
|
69417
|
+
if (!symbol.valueDeclaration) {
|
|
69418
|
+
return false;
|
|
69419
|
+
}
|
|
69420
|
+
const parent2 = getRootDeclaration(symbol.valueDeclaration).parent;
|
|
69417
69421
|
const links = getNodeLinks(parent2);
|
|
69418
69422
|
if (!(links.flags & 131072 /* AssignmentsMarked */)) {
|
|
69419
69423
|
links.flags |= 131072 /* AssignmentsMarked */;
|
|
@@ -69421,7 +69425,7 @@ ${lanes.join("\n")}
|
|
|
69421
69425
|
markNodeAssignments(parent2);
|
|
69422
69426
|
}
|
|
69423
69427
|
}
|
|
69424
|
-
return
|
|
69428
|
+
return symbol.isAssigned || false;
|
|
69425
69429
|
}
|
|
69426
69430
|
function hasParentWithAssignmentsMarked(node) {
|
|
69427
69431
|
return !!findAncestor(node.parent, (node2) => (isFunctionLike(node2) || isCatchClause(node2)) && !!(getNodeLinks(node2).flags & 131072 /* AssignmentsMarked */));
|
|
@@ -69431,11 +69435,11 @@ ${lanes.join("\n")}
|
|
|
69431
69435
|
if (isAssignmentTarget(node)) {
|
|
69432
69436
|
const symbol = getResolvedSymbol(node);
|
|
69433
69437
|
if (isParameterOrCatchClauseVariable(symbol)) {
|
|
69434
|
-
|
|
69438
|
+
symbol.isAssigned = true;
|
|
69435
69439
|
}
|
|
69436
69440
|
}
|
|
69437
69441
|
} else {
|
|
69438
|
-
|
|
69442
|
+
forEachChild(node, markNodeAssignments);
|
|
69439
69443
|
}
|
|
69440
69444
|
}
|
|
69441
69445
|
function isConstantVariable(symbol) {
|
|
@@ -69536,7 +69540,7 @@ ${lanes.join("\n")}
|
|
|
69536
69540
|
const parentType = getTypeForBindingElementParent(parent2, 0 /* Normal */);
|
|
69537
69541
|
const parentTypeConstraint = parentType && mapType(parentType, getBaseConstraintOrType);
|
|
69538
69542
|
links.flags &= ~4194304 /* InCheckIdentifier */;
|
|
69539
|
-
if (parentTypeConstraint && parentTypeConstraint.flags & 1048576 /* Union */ && !(rootDeclaration.kind === 169 /* Parameter */ &&
|
|
69543
|
+
if (parentTypeConstraint && parentTypeConstraint.flags & 1048576 /* Union */ && !(rootDeclaration.kind === 169 /* Parameter */ && isSymbolAssigned(symbol))) {
|
|
69540
69544
|
const pattern = declaration.parent;
|
|
69541
69545
|
const narrowedType = getFlowTypeOfReference(
|
|
69542
69546
|
pattern,
|
|
@@ -69565,7 +69569,7 @@ ${lanes.join("\n")}
|
|
|
69565
69569
|
const contextualSignature = getContextualSignature(func);
|
|
69566
69570
|
if (contextualSignature && contextualSignature.parameters.length === 1 && signatureHasRestParameter(contextualSignature)) {
|
|
69567
69571
|
const restType = getReducedApparentType(instantiateType(getTypeOfSymbol(contextualSignature.parameters[0]), (_a = getInferenceContext(func)) == null ? void 0 : _a.nonFixingMapper));
|
|
69568
|
-
if (restType.flags & 1048576 /* Union */ && everyType(restType, isTupleType) && !
|
|
69572
|
+
if (restType.flags & 1048576 /* Union */ && everyType(restType, isTupleType) && !isSymbolAssigned(symbol)) {
|
|
69569
69573
|
const narrowedType = getFlowTypeOfReference(
|
|
69570
69574
|
func,
|
|
69571
69575
|
restType,
|
|
@@ -69681,8 +69685,7 @@ ${lanes.join("\n")}
|
|
|
69681
69685
|
return type;
|
|
69682
69686
|
}
|
|
69683
69687
|
type = getNarrowableTypeForReference(type, node, checkMode);
|
|
69684
|
-
const
|
|
69685
|
-
const isParameter2 = rootDeclaration.kind === 169 /* Parameter */;
|
|
69688
|
+
const isParameter2 = getRootDeclaration(declaration).kind === 169 /* Parameter */;
|
|
69686
69689
|
const declarationContainer = getControlFlowContainer(declaration);
|
|
69687
69690
|
let flowContainer = getControlFlowContainer(node);
|
|
69688
69691
|
const isOuterVariable = flowContainer !== declarationContainer;
|
|
@@ -69690,7 +69693,7 @@ ${lanes.join("\n")}
|
|
|
69690
69693
|
const isModuleExports = symbol.flags & 134217728 /* ModuleExports */;
|
|
69691
69694
|
const typeIsAutomatic = type === autoType || type === autoArrayType;
|
|
69692
69695
|
const isAutomaticTypeInNonNull = typeIsAutomatic && node.parent.kind === 235 /* NonNullExpression */;
|
|
69693
|
-
while (flowContainer !== declarationContainer && (flowContainer.kind === 218 /* FunctionExpression */ || flowContainer.kind === 219 /* ArrowFunction */ || isObjectLiteralOrClassExpressionMethodOrAccessor(flowContainer)) && (isConstantVariable(localOrExportSymbol) && type !== autoArrayType || isParameter2 && !
|
|
69696
|
+
while (flowContainer !== declarationContainer && (flowContainer.kind === 218 /* FunctionExpression */ || flowContainer.kind === 219 /* ArrowFunction */ || isObjectLiteralOrClassExpressionMethodOrAccessor(flowContainer)) && (isConstantVariable(localOrExportSymbol) && type !== autoArrayType || isParameter2 && !isSymbolAssigned(localOrExportSymbol))) {
|
|
69694
69697
|
flowContainer = getControlFlowContainer(flowContainer);
|
|
69695
69698
|
}
|
|
69696
69699
|
const assumeInitialized = isParameter2 || isAlias || isOuterVariable || isSpreadDestructuringAssignmentTarget || isModuleExports || isSameScopedBindingElement(node, declaration) || type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & (3 /* AnyOrUnknown */ | 16384 /* Void */)) !== 0 || isInTypeQuery(node) || isInAmbientOrTypeNode(node) || node.parent.kind === 281 /* ExportSpecifier */) || node.parent.kind === 235 /* NonNullExpression */ || declaration.kind === 260 /* VariableDeclaration */ && declaration.exclamationToken || declaration.flags & 33554432 /* Ambient */;
|
|
@@ -79147,15 +79150,7 @@ ${lanes.join("\n")}
|
|
|
79147
79150
|
}
|
|
79148
79151
|
}
|
|
79149
79152
|
if (isInJSFile(current) && isFunctionLike(current) && current.jsDoc) {
|
|
79150
|
-
|
|
79151
|
-
if (node2.tags) {
|
|
79152
|
-
for (const tag of node2.tags) {
|
|
79153
|
-
if (isJSDocOverloadTag(tag)) {
|
|
79154
|
-
hasOverloads = true;
|
|
79155
|
-
}
|
|
79156
|
-
}
|
|
79157
|
-
}
|
|
79158
|
-
}
|
|
79153
|
+
hasOverloads = length(getJSDocOverloadTags(current)) > 0;
|
|
79159
79154
|
}
|
|
79160
79155
|
}
|
|
79161
79156
|
}
|
|
@@ -167021,16 +167016,16 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
167021
167016
|
if (!moduleSourceFile)
|
|
167022
167017
|
return void 0;
|
|
167023
167018
|
const withoutIndex = endsWith(node.text, "/index") || endsWith(node.text, "/index.js") ? void 0 : tryRemoveSuffix(removeFileExtension(moduleSourceFile.fileName), "/index");
|
|
167024
|
-
const
|
|
167019
|
+
const fileName = withoutIndex === void 0 ? moduleSourceFile.fileName : withoutIndex;
|
|
167025
167020
|
const kind = withoutIndex === void 0 ? "module" /* moduleElement */ : "directory" /* directory */;
|
|
167026
167021
|
const indexAfterLastSlash = node.text.lastIndexOf("/") + 1;
|
|
167027
167022
|
const triggerSpan = createTextSpan(node.getStart(sourceFile) + 1 + indexAfterLastSlash, node.text.length - indexAfterLastSlash);
|
|
167028
167023
|
return {
|
|
167029
167024
|
canRename: true,
|
|
167030
|
-
fileToRename:
|
|
167025
|
+
fileToRename: fileName,
|
|
167031
167026
|
kind,
|
|
167032
|
-
displayName:
|
|
167033
|
-
fullDisplayName:
|
|
167027
|
+
displayName: fileName,
|
|
167028
|
+
fullDisplayName: node.text,
|
|
167034
167029
|
kindModifiers: "" /* none */,
|
|
167035
167030
|
triggerSpan
|
|
167036
167031
|
};
|
|
@@ -185505,6 +185500,7 @@ ${e.message}`;
|
|
|
185505
185500
|
getJSDocEnumTag: () => getJSDocEnumTag,
|
|
185506
185501
|
getJSDocHost: () => getJSDocHost,
|
|
185507
185502
|
getJSDocImplementsTags: () => getJSDocImplementsTags,
|
|
185503
|
+
getJSDocOverloadTags: () => getJSDocOverloadTags,
|
|
185508
185504
|
getJSDocOverrideTagNoCache: () => getJSDocOverrideTagNoCache,
|
|
185509
185505
|
getJSDocParameterTags: () => getJSDocParameterTags,
|
|
185510
185506
|
getJSDocParameterTagsNoCache: () => getJSDocParameterTagsNoCache,
|
|
@@ -187919,6 +187915,7 @@ ${e.message}`;
|
|
|
187919
187915
|
getJSDocEnumTag: () => getJSDocEnumTag,
|
|
187920
187916
|
getJSDocHost: () => getJSDocHost,
|
|
187921
187917
|
getJSDocImplementsTags: () => getJSDocImplementsTags,
|
|
187918
|
+
getJSDocOverloadTags: () => getJSDocOverloadTags,
|
|
187922
187919
|
getJSDocOverrideTagNoCache: () => getJSDocOverrideTagNoCache,
|
|
187923
187920
|
getJSDocParameterTags: () => getJSDocParameterTags,
|
|
187924
187921
|
getJSDocParameterTagsNoCache: () => getJSDocParameterTagsNoCache,
|
package/lib/typingsInstaller.js
CHANGED
|
@@ -10581,12 +10581,12 @@ function canHaveJSDoc(node) {
|
|
|
10581
10581
|
function getJSDocCommentsAndTags(hostNode, noCache) {
|
|
10582
10582
|
let result;
|
|
10583
10583
|
if (isVariableLike(hostNode) && hasInitializer(hostNode) && hasJSDocNodes(hostNode.initializer)) {
|
|
10584
|
-
result = addRange(result, filterOwnedJSDocTags(hostNode,
|
|
10584
|
+
result = addRange(result, filterOwnedJSDocTags(hostNode, hostNode.initializer.jsDoc));
|
|
10585
10585
|
}
|
|
10586
10586
|
let node = hostNode;
|
|
10587
10587
|
while (node && node.parent) {
|
|
10588
10588
|
if (hasJSDocNodes(node)) {
|
|
10589
|
-
result = addRange(result, filterOwnedJSDocTags(hostNode,
|
|
10589
|
+
result = addRange(result, filterOwnedJSDocTags(hostNode, node.jsDoc));
|
|
10590
10590
|
}
|
|
10591
10591
|
if (node.kind === 169 /* Parameter */) {
|
|
10592
10592
|
result = addRange(result, (noCache ? getJSDocParameterTagsNoCache : getJSDocParameterTags)(node));
|
|
@@ -10600,12 +10600,16 @@ function getJSDocCommentsAndTags(hostNode, noCache) {
|
|
|
10600
10600
|
}
|
|
10601
10601
|
return result || emptyArray;
|
|
10602
10602
|
}
|
|
10603
|
-
function filterOwnedJSDocTags(hostNode,
|
|
10604
|
-
|
|
10605
|
-
|
|
10606
|
-
|
|
10607
|
-
|
|
10608
|
-
|
|
10603
|
+
function filterOwnedJSDocTags(hostNode, comments) {
|
|
10604
|
+
const lastJsDoc = last(comments);
|
|
10605
|
+
return flatMap(comments, (jsDoc) => {
|
|
10606
|
+
if (jsDoc === lastJsDoc) {
|
|
10607
|
+
const ownedTags = filter(jsDoc.tags, (tag) => ownsJSDocTag(hostNode, tag));
|
|
10608
|
+
return jsDoc.tags === ownedTags ? [jsDoc] : ownedTags;
|
|
10609
|
+
} else {
|
|
10610
|
+
return filter(jsDoc.tags, isJSDocOverloadTag);
|
|
10611
|
+
}
|
|
10612
|
+
});
|
|
10609
10613
|
}
|
|
10610
10614
|
function ownsJSDocTag(hostNode, tag) {
|
|
10611
10615
|
return !(isJSDocTypeTag(tag) || isJSDocSatisfiesTag(tag)) || !tag.parent || !isJSDoc(tag.parent) || !isParenthesizedExpression(tag.parent.parent) || tag.parent.parent === hostNode;
|
|
@@ -11119,6 +11123,7 @@ function Symbol4(flags, name) {
|
|
|
11119
11123
|
this.exportSymbol = void 0;
|
|
11120
11124
|
this.constEnumOnlyModule = void 0;
|
|
11121
11125
|
this.isReferenced = void 0;
|
|
11126
|
+
this.isAssigned = void 0;
|
|
11122
11127
|
this.links = void 0;
|
|
11123
11128
|
}
|
|
11124
11129
|
function Type3(checker, flags) {
|
|
@@ -17343,6 +17348,9 @@ function isJSDocReadonlyTag(node) {
|
|
|
17343
17348
|
function isJSDocOverrideTag(node) {
|
|
17344
17349
|
return node.kind === 344 /* JSDocOverrideTag */;
|
|
17345
17350
|
}
|
|
17351
|
+
function isJSDocOverloadTag(node) {
|
|
17352
|
+
return node.kind === 346 /* JSDocOverloadTag */;
|
|
17353
|
+
}
|
|
17346
17354
|
function isJSDocDeprecatedTag(node) {
|
|
17347
17355
|
return node.kind === 338 /* JSDocDeprecatedTag */;
|
|
17348
17356
|
}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@typescript-deploys/pr-build",
|
|
3
3
|
"author": "Microsoft Corp.",
|
|
4
4
|
"homepage": "https://www.typescriptlang.org/",
|
|
5
|
-
"version": "5.4.0-pr-
|
|
5
|
+
"version": "5.4.0-pr-56680-2",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"description": "TypeScript is a language for application scale JavaScript development",
|
|
8
8
|
"keywords": [
|
|
@@ -115,5 +115,5 @@
|
|
|
115
115
|
"node": "20.1.0",
|
|
116
116
|
"npm": "8.19.4"
|
|
117
117
|
},
|
|
118
|
-
"gitHead": "
|
|
118
|
+
"gitHead": "a0e51531c581089c41cd693e40a46b8fc45c42c4"
|
|
119
119
|
}
|