@@ -6417,6 +6417,7 @@ var ts;
64176417 cache = ts.concatenate(cache, node.jsDoc);
64186418 }
64196419 }
6420+ ts.getJSDocs = getJSDocs;
64206421 function getJSDocParameterTags(param) {
64216422 if (!isParameter(param)) {
64226423 return undefined;
@@ -18434,7 +18435,7 @@ var ts;
1843418435 }
1843518436 function parseTagComments(indent) {
1843618437 var comments = [];
18437- var state = 1 ;
18438+ var state = 0 ;
1843818439 var margin;
1843918440 function pushComment(text) {
1844018441 if (!margin) {
@@ -60253,13 +60254,14 @@ var ts;
6025360254 var symbols = completionData.symbols, location_1 = completionData.location;
6025460255 var symbol = ts.forEach(symbols, function (s) { return getCompletionEntryDisplayNameForSymbol(typeChecker, s, compilerOptions.target, false, location_1) === entryName ? s : undefined; });
6025560256 if (symbol) {
60256- var _a = ts.SymbolDisplay.getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker, symbol, sourceFile, location_1, location_1, 7), displayParts = _a.displayParts, documentation = _a.documentation, symbolKind = _a.symbolKind;
60257+ var _a = ts.SymbolDisplay.getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker, symbol, sourceFile, location_1, location_1, 7), displayParts = _a.displayParts, documentation = _a.documentation, symbolKind = _a.symbolKind, tags = _a.tags ;
6025760258 return {
6025860259 name: entryName,
6025960260 kindModifiers: ts.SymbolDisplay.getSymbolModifiers(symbol),
6026060261 kind: symbolKind,
6026160262 displayParts: displayParts,
60262- documentation: documentation
60263+ documentation: documentation,
60264+ tags: tags
6026360265 };
6026460266 }
6026560267 }
@@ -60270,7 +60272,8 @@ var ts;
6027060272 kind: ts.ScriptElementKind.keyword,
6027160273 kindModifiers: ts.ScriptElementKindModifier.none,
6027260274 displayParts: [ts.displayPart(entryName, ts.SymbolDisplayPartKind.keyword)],
60273- documentation: undefined
60275+ documentation: undefined,
60276+ tags: undefined
6027460277 };
6027560278 }
6027660279 return undefined;
@@ -62939,6 +62942,29 @@ var ts;
6293962942 return documentationComment;
6294062943 }
6294162944 JsDoc.getJsDocCommentsFromDeclarations = getJsDocCommentsFromDeclarations;
62945+ function getJsDocTagsFromDeclarations(declarations) {
62946+ var tags = [];
62947+ forEachUnique(declarations, function (declaration) {
62948+ var jsDocs = ts.getJSDocs(declaration);
62949+ if (!jsDocs) {
62950+ return;
62951+ }
62952+ for (var _i = 0, jsDocs_1 = jsDocs; _i < jsDocs_1.length; _i++) {
62953+ var doc = jsDocs_1[_i];
62954+ var tagsForDoc = doc.tags;
62955+ if (tagsForDoc) {
62956+ tags.push.apply(tags, tagsForDoc.filter(function (tag) { return tag.kind === 283; }).map(function (jsDocTag) {
62957+ return {
62958+ name: jsDocTag.tagName.text,
62959+ text: jsDocTag.comment
62960+ };
62961+ }));
62962+ }
62963+ }
62964+ });
62965+ return tags;
62966+ }
62967+ JsDoc.getJsDocTagsFromDeclarations = getJsDocTagsFromDeclarations;
6294262968 function forEachUnique(array, callback) {
6294362969 if (array) {
6294462970 for (var i = 0; i < array.length; i++) {
@@ -65130,7 +65156,8 @@ var ts;
6513065156 suffixDisplayParts: suffixDisplayParts,
6513165157 separatorDisplayParts: [ts.punctuationPart(25), ts.spacePart()],
6513265158 parameters: signatureHelpParameters,
65133- documentation: candidateSignature.getDocumentationComment()
65159+ documentation: candidateSignature.getDocumentationComment(),
65160+ tags: candidateSignature.getJsDocTags()
6513465161 };
6513565162 });
6513665163 var argumentIndex = argumentListInfo.argumentIndex;
@@ -65271,6 +65298,7 @@ var ts;
6527165298 if (semanticMeaning === void 0) { semanticMeaning = ts.getMeaningFromLocation(location); }
6527265299 var displayParts = [];
6527365300 var documentation;
65301+ var tags;
6527465302 var symbolFlags = symbol.flags;
6527565303 var symbolKind = getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(typeChecker, symbol, location);
6527665304 var hasAddedSymbolInfo;
@@ -65557,6 +65585,7 @@ var ts;
6555765585 }
6555865586 if (!documentation) {
6555965587 documentation = symbol.getDocumentationComment();
65588+ tags = symbol.getJsDocTags();
6556065589 if (documentation.length === 0 && symbol.flags & 4) {
6556165590 if (symbol.parent && ts.forEach(symbol.parent.declarations, function (declaration) { return declaration.kind === 264; })) {
6556265591 for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) {
@@ -65569,14 +65598,15 @@ var ts;
6556965598 continue;
6557065599 }
6557165600 documentation = rhsSymbol.getDocumentationComment();
65601+ tags = rhsSymbol.getJsDocTags();
6557265602 if (documentation.length > 0) {
6557365603 break;
6557465604 }
6557565605 }
6557665606 }
6557765607 }
6557865608 }
65579- return { displayParts: displayParts, documentation: documentation, symbolKind: symbolKind };
65609+ return { displayParts: displayParts, documentation: documentation, symbolKind: symbolKind, tags: tags };
6558065610 function addNewLineIfDisplayPartsExist() {
6558165611 if (displayParts.length) {
6558265612 displayParts.push(ts.lineBreakPart());
@@ -65627,6 +65657,7 @@ var ts;
6562765657 displayParts.push(ts.punctuationPart(19));
6562865658 }
6562965659 documentation = signature.getDocumentationComment();
65660+ tags = signature.getJsDocTags();
6563065661 }
6563165662 function writeTypeParametersOfSymbol(symbol, enclosingDeclaration) {
6563265663 var typeParameterParts = ts.mapToDisplayParts(function (writer) {
@@ -70133,6 +70164,12 @@ var ts;
7013370164 }
7013470165 return this.documentationComment;
7013570166 };
70167+ SymbolObject.prototype.getJsDocTags = function () {
70168+ if (this.tags === undefined) {
70169+ this.tags = ts.JsDoc.getJsDocTagsFromDeclarations(this.declarations);
70170+ }
70171+ return this.tags;
70172+ };
7013670173 return SymbolObject;
7013770174 }());
7013870175 var TokenObject = (function (_super) {
@@ -70216,6 +70253,12 @@ var ts;
7021670253 }
7021770254 return this.documentationComment;
7021870255 };
70256+ SignatureObject.prototype.getJsDocTags = function () {
70257+ if (this.jsDocTags === undefined) {
70258+ this.jsDocTags = this.declaration ? ts.JsDoc.getJsDocTagsFromDeclarations([this.declaration]) : [];
70259+ }
70260+ return this.jsDocTags;
70261+ };
7021970262 return SignatureObject;
7022070263 }());
7022170264 var SourceFileObject = (function (_super) {
@@ -70847,7 +70890,8 @@ var ts;
7084770890 kindModifiers: ts.ScriptElementKindModifier.none,
7084870891 textSpan: ts.createTextSpan(node.getStart(), node.getWidth()),
7084970892 displayParts: ts.typeToDisplayParts(typeChecker, type, ts.getContainerNode(node)),
70850- documentation: type.symbol ? type.symbol.getDocumentationComment() : undefined
70893+ documentation: type.symbol ? type.symbol.getDocumentationComment() : undefined,
70894+ tags: type.symbol ? type.symbol.getJsDocTags() : undefined
7085170895 };
7085270896 }
7085370897 }
@@ -70859,7 +70903,8 @@ var ts;
7085970903 kindModifiers: ts.SymbolDisplay.getSymbolModifiers(symbol),
7086070904 textSpan: ts.createTextSpan(node.getStart(), node.getWidth()),
7086170905 displayParts: displayPartsDocumentationsAndKind.displayParts,
70862- documentation: displayPartsDocumentationsAndKind.documentation
70906+ documentation: displayPartsDocumentationsAndKind.documentation,
70907+ tags: displayPartsDocumentationsAndKind.tags
7086370908 };
7086470909 }
7086570910 function getDefinitionAtPosition(fileName, position) {
@@ -76212,6 +76257,7 @@ var ts;
7621276257 end: scriptInfo.positionToLineOffset(ts.textSpanEnd(quickInfo.textSpan)),
7621376258 displayString: displayString,
7621476259 documentation: docString,
76260+ tags: quickInfo.tags || []
7621576261 };
7621676262 }
7621776263 else {
0 commit comments