Skip to content

Add getJSDocCommentsAndTags back with functionality of 6.0 - #64455

Open
Titian Cernicova-Dragomir (dragomirtitian) wants to merge 2 commits into
microsoft:mainfrom
bloomberg:getjsdoc-comments-and-tags
Open

Titian Cernicova-Dragomir (dragomirtitian) wants to merge 2 commits into
microsoft:mainfrom
bloomberg:getjsdoc-comments-and-tags

Conversation

@dragomirtitian

Copy link
Copy Markdown
Contributor

Fixes #64394

Copilot AI balanced review requested due to automatic review settings September 25, 2026 21:59
@typescript-automation typescript-automation Bot added For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Sep 25, 2026
@typescript-automation

Copy link
Copy Markdown

This PR doesn't have any linked issues. Please open an issue that references this PR. From there we can discuss and prioritise.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Formatting, public documentation, and individual-tag test coverage need correction.

Get a fresh assessment by requesting another Copilot review.

Review effort: Balanced
Findings: 1 Medium severity · 1 Low severity

Open (2)
What changed in this PR

Restores the public getJSDocCommentsAndTags AST API with TypeScript 6-compatible ancestor traversal and comment preservation.

Changes:

  • Returns whole JSDoc nodes when appropriate while preserving getJSDocTags.
  • Adds async and generated sync API tests.
File Description
packages/​typescript/​src/​ast/​jsdoc.ts Implements and exports the restored API.
packages/​typescript/​test/​async/​api.test.ts Adds API behavior tests.
packages/​typescript/​test/​sync/​api.test.ts Adds generated synchronous tests.

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

assert.deepEqual(getJSDocTags(answer), []);
});

test("returns individual tags when the host node does not own all of them", async () => {
Comment on lines +103 to 112
let onlyOwnTags = jsDoc.tags?.every(t => ownsJSDocTag(hostNode, t)) ?? true
if(!onlyOwnTags && jsDoc.tags) {
for (const tag of jsDoc.tags) {
if (ownsJSDocTag(hostNode, tag)) {
result.push(tag);
}
}
} else {
result.push(jsDoc)
}

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

For Uncommitted Bug PR for untriaged, rejected, closed or missing bug

Projects

Status: Not started

Development

Successfully merging this pull request may close these issues.

# [API] getJSDocCommentsAndTags is no longer exposed

3 participants