Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 8d5aaf8

Browse filesBrowse files
author
Zhengbo Li
authored
avoid creating syntax nodes for jsdoc comment tags (microsoft#10526)
1 parent bab4a52 commit 8d5aaf8
Copy full SHA for 8d5aaf8

1 file changed

+5-6Lines changed: 5 additions & 6 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/services/services.ts‎

Copy file name to clipboardExpand all lines: src/services/services.ts
+5-6Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -280,11 +280,14 @@ namespace ts {
280280
let pos = this.pos;
281281
const useJSDocScanner = this.kind >= SyntaxKind.FirstJSDocTagNode && this.kind <= SyntaxKind.LastJSDocTagNode;
282282
const processNode = (node: Node) => {
283-
if (pos < node.pos) {
283+
const isJSDocTagNode = isJSDocTag(node);
284+
if (!isJSDocTagNode && pos < node.pos) {
284285
pos = this.addSyntheticNodes(children, pos, node.pos, useJSDocScanner);
285286
}
286287
children.push(node);
287-
pos = node.end;
288+
if (!isJSDocTagNode) {
289+
pos = node.end;
290+
}
288291
};
289292
const processNodes = (nodes: NodeArray<Node>) => {
290293
if (pos < nodes.pos) {
@@ -299,10 +302,6 @@ namespace ts {
299302
processNode(jsDocComment);
300303
}
301304
}
302-
// For syntactic classifications, all trivia are classcified together, including jsdoc comments.
303-
// For that to work, the jsdoc comments should still be the leading trivia of the first child.
304-
// Restoring the scanner position ensures that.
305-
pos = this.pos;
306305
forEachChild(this, processNode, processNodes);
307306
if (pos < this.end) {
308307
this.addSyntheticNodes(children, pos, this.end);

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.