typescript 4.6.0-dev.20220125 → 4.6.0-dev.20220126
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 +61 -19
- package/lib/tsserver.js +136 -40
- package/lib/tsserverlibrary.d.ts +2 -2
- package/lib/tsserverlibrary.js +136 -40
- package/lib/typescript.d.ts +2 -2
- package/lib/typescript.js +136 -40
- package/lib/typescriptServices.d.ts +2 -2
- package/lib/typescriptServices.js +136 -40
- package/lib/typingsInstaller.js +61 -19
- package/package.json +1 -1
package/lib/tsserverlibrary.js
CHANGED
|
@@ -294,7 +294,7 @@ var ts;
|
|
|
294
294
|
// The following is baselined as a literal template type without intervention
|
|
295
295
|
/** The version of the TypeScript compiler release */
|
|
296
296
|
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
297
|
-
ts.version = ts.versionMajorMinor + ".0-dev.
|
|
297
|
+
ts.version = ts.versionMajorMinor + ".0-dev.20220126";
|
|
298
298
|
/* @internal */
|
|
299
299
|
var Comparison;
|
|
300
300
|
(function (Comparison) {
|
|
@@ -14257,10 +14257,13 @@ var ts;
|
|
|
14257
14257
|
function packageIdIsEqual(a, b) {
|
|
14258
14258
|
return a === b || !!a && !!b && a.name === b.name && a.subModuleName === b.subModuleName && a.version === b.version;
|
|
14259
14259
|
}
|
|
14260
|
-
function
|
|
14261
|
-
var name = _a.name, subModuleName = _a.subModuleName
|
|
14262
|
-
|
|
14263
|
-
|
|
14260
|
+
function packageIdToPackageName(_a) {
|
|
14261
|
+
var name = _a.name, subModuleName = _a.subModuleName;
|
|
14262
|
+
return subModuleName ? name + "/" + subModuleName : name;
|
|
14263
|
+
}
|
|
14264
|
+
ts.packageIdToPackageName = packageIdToPackageName;
|
|
14265
|
+
function packageIdToString(packageId) {
|
|
14266
|
+
return packageIdToPackageName(packageId) + "@" + packageId.version;
|
|
14264
14267
|
}
|
|
14265
14268
|
ts.packageIdToString = packageIdToString;
|
|
14266
14269
|
function typeDirectiveIsEqualTo(oldResolution, newResolution) {
|
|
@@ -15261,7 +15264,8 @@ var ts;
|
|
|
15261
15264
|
node.kind === 212 /* FunctionExpression */ ||
|
|
15262
15265
|
node.kind === 213 /* ArrowFunction */ ||
|
|
15263
15266
|
node.kind === 211 /* ParenthesizedExpression */ ||
|
|
15264
|
-
node.kind === 253 /* VariableDeclaration */
|
|
15267
|
+
node.kind === 253 /* VariableDeclaration */ ||
|
|
15268
|
+
node.kind === 274 /* ExportSpecifier */) ?
|
|
15265
15269
|
ts.concatenate(ts.getTrailingCommentRanges(text, node.pos), ts.getLeadingCommentRanges(text, node.pos)) :
|
|
15266
15270
|
ts.getLeadingCommentRanges(text, node.pos);
|
|
15267
15271
|
// True if the comment starts with '/**' but not if it is '/**/'
|
|
@@ -36412,7 +36416,8 @@ var ts;
|
|
|
36412
36416
|
return finishNode(node, pos);
|
|
36413
36417
|
}
|
|
36414
36418
|
function parseExportSpecifier() {
|
|
36415
|
-
|
|
36419
|
+
var hasJSDoc = hasPrecedingJSDocComment();
|
|
36420
|
+
return withJSDoc(parseImportOrExportSpecifier(274 /* ExportSpecifier */), hasJSDoc);
|
|
36416
36421
|
}
|
|
36417
36422
|
function parseImportSpecifier() {
|
|
36418
36423
|
return parseImportOrExportSpecifier(269 /* ImportSpecifier */);
|
|
@@ -43617,14 +43622,12 @@ var ts;
|
|
|
43617
43622
|
}
|
|
43618
43623
|
var binder = createBinder();
|
|
43619
43624
|
function bindSourceFile(file, options) {
|
|
43620
|
-
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("bind" /* Bind */, "bindSourceFile", { path: file.path }, /*separateBeginAndEnd*/ true);
|
|
43621
43625
|
ts.performance.mark("beforeBind");
|
|
43622
43626
|
ts.perfLogger.logStartBindFile("" + file.fileName);
|
|
43623
43627
|
binder(file, options);
|
|
43624
43628
|
ts.perfLogger.logStopBindFile();
|
|
43625
43629
|
ts.performance.mark("afterBind");
|
|
43626
43630
|
ts.performance.measure("Bind", "beforeBind", "afterBind");
|
|
43627
|
-
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();
|
|
43628
43631
|
}
|
|
43629
43632
|
ts.bindSourceFile = bindSourceFile;
|
|
43630
43633
|
function createBinder() {
|
|
@@ -43684,7 +43687,9 @@ var ts;
|
|
|
43684
43687
|
ts.Debug.attachFlowNodeDebugInfo(unreachableFlow);
|
|
43685
43688
|
ts.Debug.attachFlowNodeDebugInfo(reportedUnreachableFlow);
|
|
43686
43689
|
if (!file.locals) {
|
|
43690
|
+
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("bind" /* Bind */, "bindSourceFile", { path: file.path }, /*separateBeginAndEnd*/ true);
|
|
43687
43691
|
bind(file);
|
|
43692
|
+
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();
|
|
43688
43693
|
file.symbolCount = symbolCount;
|
|
43689
43694
|
file.classifiableNames = classifiableNames;
|
|
43690
43695
|
delayedBindJSDocTypedefTag();
|
|
@@ -47951,6 +47956,9 @@ var ts;
|
|
|
47951
47956
|
suggestionDiagnostics.add(diagnostic);
|
|
47952
47957
|
return diagnostic;
|
|
47953
47958
|
}
|
|
47959
|
+
function isDeprecatedSymbol(symbol) {
|
|
47960
|
+
return !!(getDeclarationNodeFlagsFromSymbol(symbol) & 134217728 /* Deprecated */);
|
|
47961
|
+
}
|
|
47954
47962
|
function addDeprecatedSuggestion(location, declarations, deprecatedEntity) {
|
|
47955
47963
|
var diagnostic = ts.createDiagnosticForNode(location, ts.Diagnostics._0_is_deprecated, deprecatedEntity);
|
|
47956
47964
|
return addDeprecatedSuggestionWorker(declarations, diagnostic);
|
|
@@ -60737,7 +60745,7 @@ var ts;
|
|
|
60737
60745
|
}
|
|
60738
60746
|
var prop = getPropertyOfType(objectType, propName);
|
|
60739
60747
|
if (prop) {
|
|
60740
|
-
if (accessFlags & 64 /* ReportDeprecated */ && accessNode && prop.declarations &&
|
|
60748
|
+
if (accessFlags & 64 /* ReportDeprecated */ && accessNode && prop.declarations && isDeprecatedSymbol(prop) && isUncalledFunctionReference(accessNode, prop)) {
|
|
60741
60749
|
var deprecatedNode = (_a = accessExpression === null || accessExpression === void 0 ? void 0 : accessExpression.argumentExpression) !== null && _a !== void 0 ? _a : (ts.isIndexedAccessTypeNode(accessNode) ? accessNode.indexType : accessNode);
|
|
60742
60750
|
addDeprecatedSuggestion(deprecatedNode, prop.declarations, propName);
|
|
60743
60751
|
}
|
|
@@ -70140,9 +70148,9 @@ var ts;
|
|
|
70140
70148
|
markAliasReferenced(symbol, node);
|
|
70141
70149
|
}
|
|
70142
70150
|
var localOrExportSymbol = getExportSymbolOfValueSymbolIfExported(symbol);
|
|
70143
|
-
var
|
|
70144
|
-
if (
|
|
70145
|
-
addDeprecatedSuggestion(node,
|
|
70151
|
+
var targetSymbol = checkDeprecatedAliasedSymbol(localOrExportSymbol, node);
|
|
70152
|
+
if (isDeprecatedSymbol(targetSymbol) && isUncalledFunctionReference(node, targetSymbol) && targetSymbol.declarations) {
|
|
70153
|
+
addDeprecatedSuggestion(node, targetSymbol.declarations, node.escapedText);
|
|
70146
70154
|
}
|
|
70147
70155
|
var declaration = localOrExportSymbol.valueDeclaration;
|
|
70148
70156
|
if (declaration && localOrExportSymbol.flags & 32 /* Class */) {
|
|
@@ -73154,7 +73162,7 @@ var ts;
|
|
|
73154
73162
|
}
|
|
73155
73163
|
}
|
|
73156
73164
|
else {
|
|
73157
|
-
if (
|
|
73165
|
+
if (isDeprecatedSymbol(prop) && isUncalledFunctionReference(node, prop) && prop.declarations) {
|
|
73158
73166
|
addDeprecatedSuggestion(right, prop.declarations, right.escapedText);
|
|
73159
73167
|
}
|
|
73160
73168
|
checkPropertyNotUsedBeforeDeclaration(prop, node, right);
|
|
@@ -83323,7 +83331,6 @@ var ts;
|
|
|
83323
83331
|
return true;
|
|
83324
83332
|
}
|
|
83325
83333
|
function checkAliasSymbol(node) {
|
|
83326
|
-
var _a;
|
|
83327
83334
|
var symbol = getSymbolOfNode(node);
|
|
83328
83335
|
var target = resolveAlias(symbol);
|
|
83329
83336
|
if (target !== unknownSymbol) {
|
|
@@ -83379,11 +83386,46 @@ var ts;
|
|
|
83379
83386
|
}
|
|
83380
83387
|
}
|
|
83381
83388
|
}
|
|
83382
|
-
if (ts.isImportSpecifier(node)
|
|
83383
|
-
|
|
83389
|
+
if (ts.isImportSpecifier(node)) {
|
|
83390
|
+
var targetSymbol = checkDeprecatedAliasedSymbol(symbol, node);
|
|
83391
|
+
if (isDeprecatedAliasedSymbol(targetSymbol) && targetSymbol.declarations) {
|
|
83392
|
+
addDeprecatedSuggestion(node, targetSymbol.declarations, targetSymbol.escapedName);
|
|
83393
|
+
}
|
|
83384
83394
|
}
|
|
83385
83395
|
}
|
|
83386
83396
|
}
|
|
83397
|
+
function isDeprecatedAliasedSymbol(symbol) {
|
|
83398
|
+
return !!symbol.declarations && ts.every(symbol.declarations, function (d) { return !!(ts.getCombinedNodeFlags(d) & 134217728 /* Deprecated */); });
|
|
83399
|
+
}
|
|
83400
|
+
function checkDeprecatedAliasedSymbol(symbol, location) {
|
|
83401
|
+
if (!(symbol.flags & 2097152 /* Alias */))
|
|
83402
|
+
return symbol;
|
|
83403
|
+
var targetSymbol = resolveAlias(symbol);
|
|
83404
|
+
if (targetSymbol === unknownSymbol)
|
|
83405
|
+
return targetSymbol;
|
|
83406
|
+
while (symbol.flags & 2097152 /* Alias */) {
|
|
83407
|
+
var target = getImmediateAliasedSymbol(symbol);
|
|
83408
|
+
if (target) {
|
|
83409
|
+
if (target === targetSymbol)
|
|
83410
|
+
break;
|
|
83411
|
+
if (target.declarations && ts.length(target.declarations)) {
|
|
83412
|
+
if (isDeprecatedAliasedSymbol(target)) {
|
|
83413
|
+
addDeprecatedSuggestion(location, target.declarations, target.escapedName);
|
|
83414
|
+
break;
|
|
83415
|
+
}
|
|
83416
|
+
else {
|
|
83417
|
+
if (symbol === targetSymbol)
|
|
83418
|
+
break;
|
|
83419
|
+
symbol = target;
|
|
83420
|
+
}
|
|
83421
|
+
}
|
|
83422
|
+
}
|
|
83423
|
+
else {
|
|
83424
|
+
break;
|
|
83425
|
+
}
|
|
83426
|
+
}
|
|
83427
|
+
return targetSymbol;
|
|
83428
|
+
}
|
|
83387
83429
|
function checkImportBinding(node) {
|
|
83388
83430
|
checkCollisionsForDeclarationName(node, node.name);
|
|
83389
83431
|
checkAliasSymbol(node);
|
|
@@ -116041,14 +116083,14 @@ var ts;
|
|
|
116041
116083
|
redirectTargetsMap.add(fileFromPackageId.path, fileName);
|
|
116042
116084
|
addFileToFilesByName(dupFile, path, redirectedPath);
|
|
116043
116085
|
addFileIncludeReason(dupFile, reason);
|
|
116044
|
-
sourceFileToPackageName.set(path, packageId
|
|
116086
|
+
sourceFileToPackageName.set(path, ts.packageIdToPackageName(packageId));
|
|
116045
116087
|
processingOtherFiles.push(dupFile);
|
|
116046
116088
|
return dupFile;
|
|
116047
116089
|
}
|
|
116048
116090
|
else if (file) {
|
|
116049
116091
|
// This is the first source file to have this packageId.
|
|
116050
116092
|
packageIdToSourceFile.set(packageIdKey, file);
|
|
116051
|
-
sourceFileToPackageName.set(path, packageId
|
|
116093
|
+
sourceFileToPackageName.set(path, ts.packageIdToPackageName(packageId));
|
|
116052
116094
|
}
|
|
116053
116095
|
}
|
|
116054
116096
|
addFileToFilesByName(file, path, redirectedPath);
|
|
@@ -141898,6 +141940,8 @@ var ts;
|
|
|
141898
141940
|
}
|
|
141899
141941
|
if (flags & 16 /* Function */)
|
|
141900
141942
|
return isLocalVariableOrFunction(symbol) ? "local function" /* localFunctionElement */ : "function" /* functionElement */;
|
|
141943
|
+
// FIXME: getter and setter use the same symbol. And it is rare to use only setter without getter, so in most cases the symbol always has getter flag.
|
|
141944
|
+
// So, even when the location is just on the declaration of setter, this function returns getter.
|
|
141901
141945
|
if (flags & 32768 /* GetAccessor */)
|
|
141902
141946
|
return "getter" /* memberGetAccessorElement */;
|
|
141903
141947
|
if (flags & 65536 /* SetAccessor */)
|
|
@@ -141984,9 +142028,24 @@ var ts;
|
|
|
141984
142028
|
}
|
|
141985
142029
|
// Class at constructor site need to be shown as constructor apart from property,method, vars
|
|
141986
142030
|
if (symbolKind !== "" /* unknown */ || symbolFlags & 32 /* Class */ || symbolFlags & 2097152 /* Alias */) {
|
|
141987
|
-
// If
|
|
142031
|
+
// If symbol is accessor, they are allowed only if location is at declaration identifier of the accessor
|
|
141988
142032
|
if (symbolKind === "getter" /* memberGetAccessorElement */ || symbolKind === "setter" /* memberSetAccessorElement */) {
|
|
141989
|
-
|
|
142033
|
+
var declaration = ts.find(symbol.declarations, function (declaration) { return declaration.name === location; });
|
|
142034
|
+
if (declaration) {
|
|
142035
|
+
switch (declaration.kind) {
|
|
142036
|
+
case 171 /* GetAccessor */:
|
|
142037
|
+
symbolKind = "getter" /* memberGetAccessorElement */;
|
|
142038
|
+
break;
|
|
142039
|
+
case 172 /* SetAccessor */:
|
|
142040
|
+
symbolKind = "setter" /* memberSetAccessorElement */;
|
|
142041
|
+
break;
|
|
142042
|
+
default:
|
|
142043
|
+
ts.Debug.assertNever(declaration);
|
|
142044
|
+
}
|
|
142045
|
+
}
|
|
142046
|
+
else {
|
|
142047
|
+
symbolKind = "property" /* memberVariableElement */;
|
|
142048
|
+
}
|
|
141990
142049
|
}
|
|
141991
142050
|
var signature = void 0;
|
|
141992
142051
|
type = isThisExpression ? typeChecker.getTypeAtLocation(location) : typeChecker.getTypeOfSymbolAtLocation(symbol, location);
|
|
@@ -142300,6 +142359,8 @@ var ts;
|
|
|
142300
142359
|
}
|
|
142301
142360
|
// For properties, variables and local vars: show the type
|
|
142302
142361
|
if (symbolKind === "property" /* memberVariableElement */ ||
|
|
142362
|
+
symbolKind === "getter" /* memberGetAccessorElement */ ||
|
|
142363
|
+
symbolKind === "setter" /* memberSetAccessorElement */ ||
|
|
142303
142364
|
symbolKind === "JSX attribute" /* jsxAttribute */ ||
|
|
142304
142365
|
symbolFlags & 3 /* Variable */ ||
|
|
142305
142366
|
symbolKind === "local var" /* localVariableElement */ ||
|
|
@@ -142370,7 +142431,7 @@ var ts;
|
|
|
142370
142431
|
}
|
|
142371
142432
|
}
|
|
142372
142433
|
if (tags.length === 0 && !hasMultipleSignatures) {
|
|
142373
|
-
tags = symbol.
|
|
142434
|
+
tags = symbol.getContextualJsDocTags(enclosingDeclaration, typeChecker);
|
|
142374
142435
|
}
|
|
142375
142436
|
if (documentation.length === 0 && documentationFromAlias) {
|
|
142376
142437
|
documentation = documentationFromAlias;
|
|
@@ -160574,13 +160635,11 @@ var ts;
|
|
|
160574
160635
|
switch (context === null || context === void 0 ? void 0 : context.kind) {
|
|
160575
160636
|
case 171 /* GetAccessor */:
|
|
160576
160637
|
if (!this.contextualGetAccessorDocumentationComment) {
|
|
160577
|
-
this.contextualGetAccessorDocumentationComment = ts.emptyArray;
|
|
160578
160638
|
this.contextualGetAccessorDocumentationComment = getDocumentationComment(ts.filter(this.declarations, ts.isGetAccessor), checker);
|
|
160579
160639
|
}
|
|
160580
160640
|
return this.contextualGetAccessorDocumentationComment;
|
|
160581
160641
|
case 172 /* SetAccessor */:
|
|
160582
160642
|
if (!this.contextualSetAccessorDocumentationComment) {
|
|
160583
|
-
this.contextualSetAccessorDocumentationComment = ts.emptyArray;
|
|
160584
160643
|
this.contextualSetAccessorDocumentationComment = getDocumentationComment(ts.filter(this.declarations, ts.isSetAccessor), checker);
|
|
160585
160644
|
}
|
|
160586
160645
|
return this.contextualSetAccessorDocumentationComment;
|
|
@@ -160590,10 +160649,26 @@ var ts;
|
|
|
160590
160649
|
};
|
|
160591
160650
|
SymbolObject.prototype.getJsDocTags = function (checker) {
|
|
160592
160651
|
if (this.tags === undefined) {
|
|
160593
|
-
this.tags =
|
|
160652
|
+
this.tags = getJsDocTagsOfDeclarations(this.declarations, checker);
|
|
160594
160653
|
}
|
|
160595
160654
|
return this.tags;
|
|
160596
160655
|
};
|
|
160656
|
+
SymbolObject.prototype.getContextualJsDocTags = function (context, checker) {
|
|
160657
|
+
switch (context === null || context === void 0 ? void 0 : context.kind) {
|
|
160658
|
+
case 171 /* GetAccessor */:
|
|
160659
|
+
if (!this.contextualGetAccessorTags) {
|
|
160660
|
+
this.contextualGetAccessorTags = getJsDocTagsOfDeclarations(ts.filter(this.declarations, ts.isGetAccessor), checker);
|
|
160661
|
+
}
|
|
160662
|
+
return this.contextualGetAccessorTags;
|
|
160663
|
+
case 172 /* SetAccessor */:
|
|
160664
|
+
if (!this.contextualSetAccessorTags) {
|
|
160665
|
+
this.contextualSetAccessorTags = getJsDocTagsOfDeclarations(ts.filter(this.declarations, ts.isSetAccessor), checker);
|
|
160666
|
+
}
|
|
160667
|
+
return this.contextualSetAccessorTags;
|
|
160668
|
+
default:
|
|
160669
|
+
return this.getJsDocTags(checker);
|
|
160670
|
+
}
|
|
160671
|
+
};
|
|
160597
160672
|
return SymbolObject;
|
|
160598
160673
|
}());
|
|
160599
160674
|
var TokenObject = /** @class */ (function (_super) {
|
|
@@ -160763,10 +160838,7 @@ var ts;
|
|
|
160763
160838
|
return this.documentationComment || (this.documentationComment = getDocumentationComment(ts.singleElementArray(this.declaration), this.checker));
|
|
160764
160839
|
};
|
|
160765
160840
|
SignatureObject.prototype.getJsDocTags = function () {
|
|
160766
|
-
|
|
160767
|
-
this.jsDocTags = this.declaration ? getJsDocTagsOfSignature(this.declaration, this.checker) : [];
|
|
160768
|
-
}
|
|
160769
|
-
return this.jsDocTags;
|
|
160841
|
+
return this.jsDocTags || (this.jsDocTags = getJsDocTagsOfDeclarations(ts.singleElementArray(this.declaration), this.checker));
|
|
160770
160842
|
};
|
|
160771
160843
|
return SignatureObject;
|
|
160772
160844
|
}());
|
|
@@ -160778,12 +160850,30 @@ var ts;
|
|
|
160778
160850
|
function hasJSDocInheritDocTag(node) {
|
|
160779
160851
|
return ts.getJSDocTags(node).some(function (tag) { return tag.tagName.text === "inheritDoc"; });
|
|
160780
160852
|
}
|
|
160781
|
-
function
|
|
160782
|
-
|
|
160783
|
-
|
|
160784
|
-
|
|
160785
|
-
|
|
160786
|
-
|
|
160853
|
+
function getJsDocTagsOfDeclarations(declarations, checker) {
|
|
160854
|
+
if (!declarations)
|
|
160855
|
+
return ts.emptyArray;
|
|
160856
|
+
var tags = ts.JsDoc.getJsDocTagsFromDeclarations(declarations, checker);
|
|
160857
|
+
if (checker && (tags.length === 0 || declarations.some(hasJSDocInheritDocTag))) {
|
|
160858
|
+
var seenSymbols_1 = new ts.Set();
|
|
160859
|
+
var _loop_22 = function (declaration) {
|
|
160860
|
+
var inheritedTags = findBaseOfDeclaration(checker, declaration, function (symbol) {
|
|
160861
|
+
var _a;
|
|
160862
|
+
if (!seenSymbols_1.has(symbol)) {
|
|
160863
|
+
seenSymbols_1.add(symbol);
|
|
160864
|
+
if (declaration.kind === 171 /* GetAccessor */ || declaration.kind === 172 /* SetAccessor */) {
|
|
160865
|
+
return symbol.getContextualJsDocTags(declaration, checker);
|
|
160866
|
+
}
|
|
160867
|
+
return ((_a = symbol.declarations) === null || _a === void 0 ? void 0 : _a.length) === 1 ? symbol.getJsDocTags() : undefined;
|
|
160868
|
+
}
|
|
160869
|
+
});
|
|
160870
|
+
if (inheritedTags) {
|
|
160871
|
+
tags = __spreadArray(__spreadArray([], inheritedTags, true), tags, true);
|
|
160872
|
+
}
|
|
160873
|
+
};
|
|
160874
|
+
for (var _i = 0, declarations_6 = declarations; _i < declarations_6.length; _i++) {
|
|
160875
|
+
var declaration = declarations_6[_i];
|
|
160876
|
+
_loop_22(declaration);
|
|
160787
160877
|
}
|
|
160788
160878
|
}
|
|
160789
160879
|
return tags;
|
|
@@ -160793,18 +160883,24 @@ var ts;
|
|
|
160793
160883
|
return ts.emptyArray;
|
|
160794
160884
|
var doc = ts.JsDoc.getJsDocCommentsFromDeclarations(declarations, checker);
|
|
160795
160885
|
if (checker && (doc.length === 0 || declarations.some(hasJSDocInheritDocTag))) {
|
|
160796
|
-
var
|
|
160797
|
-
|
|
160798
|
-
var declaration = declarations_6[_i];
|
|
160886
|
+
var seenSymbols_2 = new ts.Set();
|
|
160887
|
+
var _loop_23 = function (declaration) {
|
|
160799
160888
|
var inheritedDocs = findBaseOfDeclaration(checker, declaration, function (symbol) {
|
|
160800
|
-
if (!
|
|
160801
|
-
|
|
160889
|
+
if (!seenSymbols_2.has(symbol)) {
|
|
160890
|
+
seenSymbols_2.add(symbol);
|
|
160891
|
+
if (declaration.kind === 171 /* GetAccessor */ || declaration.kind === 172 /* SetAccessor */) {
|
|
160892
|
+
return symbol.getContextualDocumentationComment(declaration, checker);
|
|
160893
|
+
}
|
|
160802
160894
|
return symbol.getDocumentationComment(checker);
|
|
160803
160895
|
}
|
|
160804
160896
|
});
|
|
160805
160897
|
// TODO: GH#16312 Return a ReadonlyArray, avoid copying inheritedDocs
|
|
160806
160898
|
if (inheritedDocs)
|
|
160807
160899
|
doc = doc.length === 0 ? inheritedDocs.slice() : inheritedDocs.concat(ts.lineBreakPart(), doc);
|
|
160900
|
+
};
|
|
160901
|
+
for (var _i = 0, declarations_7 = declarations; _i < declarations_7.length; _i++) {
|
|
160902
|
+
var declaration = declarations_7[_i];
|
|
160903
|
+
_loop_23(declaration);
|
|
160808
160904
|
}
|
|
160809
160905
|
}
|
|
160810
160906
|
return doc;
|
package/lib/typescript.d.ts
CHANGED
|
@@ -572,7 +572,7 @@ declare namespace ts {
|
|
|
572
572
|
}
|
|
573
573
|
export interface JSDocContainer {
|
|
574
574
|
}
|
|
575
|
-
export type HasJSDoc = ParameterDeclaration | CallSignatureDeclaration | ClassStaticBlockDeclaration | ConstructSignatureDeclaration | MethodSignature | PropertySignature | ArrowFunction | ParenthesizedExpression | SpreadAssignment | ShorthandPropertyAssignment | PropertyAssignment | FunctionExpression | EmptyStatement | DebuggerStatement | Block | VariableStatement | ExpressionStatement | IfStatement | DoStatement | WhileStatement | ForStatement | ForInStatement | ForOfStatement | BreakStatement | ContinueStatement | ReturnStatement | WithStatement | SwitchStatement | LabeledStatement | ThrowStatement | TryStatement | FunctionDeclaration | ConstructorDeclaration | MethodDeclaration | VariableDeclaration | PropertyDeclaration | AccessorDeclaration | ClassLikeDeclaration | InterfaceDeclaration | TypeAliasDeclaration | EnumMember | EnumDeclaration | ModuleDeclaration | ImportEqualsDeclaration | ImportDeclaration | NamespaceExportDeclaration | ExportAssignment | IndexSignatureDeclaration | FunctionTypeNode | ConstructorTypeNode | JSDocFunctionType | ExportDeclaration | NamedTupleMember | EndOfFileToken;
|
|
575
|
+
export type HasJSDoc = ParameterDeclaration | CallSignatureDeclaration | ClassStaticBlockDeclaration | ConstructSignatureDeclaration | MethodSignature | PropertySignature | ArrowFunction | ParenthesizedExpression | SpreadAssignment | ShorthandPropertyAssignment | PropertyAssignment | FunctionExpression | EmptyStatement | DebuggerStatement | Block | VariableStatement | ExpressionStatement | IfStatement | DoStatement | WhileStatement | ForStatement | ForInStatement | ForOfStatement | BreakStatement | ContinueStatement | ReturnStatement | WithStatement | SwitchStatement | LabeledStatement | ThrowStatement | TryStatement | FunctionDeclaration | ConstructorDeclaration | MethodDeclaration | VariableDeclaration | PropertyDeclaration | AccessorDeclaration | ClassLikeDeclaration | InterfaceDeclaration | TypeAliasDeclaration | EnumMember | EnumDeclaration | ModuleDeclaration | ImportEqualsDeclaration | ImportDeclaration | NamespaceExportDeclaration | ExportAssignment | IndexSignatureDeclaration | FunctionTypeNode | ConstructorTypeNode | JSDocFunctionType | ExportDeclaration | NamedTupleMember | ExportSpecifier | EndOfFileToken;
|
|
576
576
|
export type HasType = SignatureDeclaration | VariableDeclaration | ParameterDeclaration | PropertySignature | PropertyDeclaration | TypePredicateNode | ParenthesizedTypeNode | TypeOperatorNode | MappedTypeNode | AssertionExpression | TypeAliasDeclaration | JSDocTypeExpression | JSDocNonNullableType | JSDocNullableType | JSDocOptionalType | JSDocVariadicType;
|
|
577
577
|
export type HasTypeArguments = CallExpression | NewExpression | TaggedTemplateExpression | JsxOpeningElement | JsxSelfClosingElement;
|
|
578
578
|
export type HasInitializer = HasExpressionInitializer | ForStatement | ForInStatement | ForOfStatement | JsxAttribute;
|
|
@@ -1702,7 +1702,7 @@ declare namespace ts {
|
|
|
1702
1702
|
readonly name: Identifier;
|
|
1703
1703
|
readonly isTypeOnly: boolean;
|
|
1704
1704
|
}
|
|
1705
|
-
export interface ExportSpecifier extends NamedDeclaration {
|
|
1705
|
+
export interface ExportSpecifier extends NamedDeclaration, JSDocContainer {
|
|
1706
1706
|
readonly kind: SyntaxKind.ExportSpecifier;
|
|
1707
1707
|
readonly parent: NamedExports;
|
|
1708
1708
|
readonly isTypeOnly: boolean;
|