Handle msising tags for JsDoc nodes
This commit is contained in:
parent
b7d1d11ba3
commit
e6610c5d54
3 changed files with 25 additions and 9 deletions
|
@ -1604,7 +1604,7 @@ namespace ts {
|
|||
|
||||
// @kind(SyntaxKind.JSDocComment)
|
||||
export interface JSDoc extends Node {
|
||||
tags: NodeArray<JSDocTag>;
|
||||
tags: NodeArray<JSDocTag> | undefined;
|
||||
comment: string | undefined;
|
||||
}
|
||||
|
||||
|
|
|
@ -218,15 +218,13 @@ namespace ts.NavigationBar {
|
|||
break;
|
||||
|
||||
default:
|
||||
if (node.jsDocComments) {
|
||||
for (const jsDocComment of node.jsDocComments) {
|
||||
for (const tag of jsDocComment.tags) {
|
||||
if (tag.kind === SyntaxKind.JSDocTypedefTag) {
|
||||
addLeafNode(tag);
|
||||
}
|
||||
forEach(node.jsDocComments, jsDocComment => {
|
||||
forEach(jsDocComment.tags, tag => {
|
||||
if (tag.kind === SyntaxKind.JSDocTypedefTag) {
|
||||
addLeafNode(tag);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
forEachChild(node, addChildrenRecursively);
|
||||
}
|
||||
|
|
18
tests/cases/fourslash/navigationBarJsDocCommentWithNoTags.ts
Normal file
18
tests/cases/fourslash/navigationBarJsDocCommentWithNoTags.ts
Normal file
|
@ -0,0 +1,18 @@
|
|||
/// <reference path="fourslash.ts"/>
|
||||
|
||||
/////** Test */
|
||||
////export const Test = {}
|
||||
|
||||
verify.navigationBar([
|
||||
{
|
||||
"text": "\"navigationBarJsDocCommentWithNoTags\"",
|
||||
"kind": "module",
|
||||
"childItems": [
|
||||
{
|
||||
"text": "Test",
|
||||
"kind": "const",
|
||||
"kindModifiers": "export"
|
||||
}
|
||||
]
|
||||
}
|
||||
]);
|
Loading…
Reference in a new issue