Skip to content

Conversation

Andarist
Copy link
Contributor

closes #58599

@Copilot Copilot AI review requested due to automatic review settings May 18, 2025 09:05
@Andarist Andarist force-pushed the fix/jsdoc-links-in-tags branch from 7dac38a to 5d7ead4 Compare May 18, 2025 09:05
@github-project-automation github-project-automation bot moved this to Not started in PR Backlog May 18, 2025
@typescript-bot typescript-bot added the For Backlog Bug PRs that fix a backlog bug label May 18, 2025
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR improves the handling of the JSDoc @throws tag when a markdown or JSDoc link is used by centralizing the link-check logic and updating type expression parsing accordingly.

  • Added a new test file to validate quick info baseline for @throws links.
  • Refactored parser.ts to extract the markdown/JSDoc link check into the isMarkdownOrJSDocLink function.
  • Updated both parseSeeTag and parseThrowsTag to conditionally bypass name expression and type expression parsing when a link is detected.

Reviewed Changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 2 comments.

File Description
tests/cases/fourslash/jsdocLink7.ts Adds a test file to verify proper baseline quick info handling.
src/compiler/parser.ts Refactors inline link detection logic into the isMarkdownOrJSDocLink function and updates tag parsing accordingly.
Files not reviewed (1)
  • tests/baselines/reference/jsdocLink7.baseline: Language not supported

return finishNode(factory.createJSDocSeeTag(tagName, nameExpression, comments), start);
}

function parseThrowsTag(start: number, tagName: Identifier, indent: number, indentText: string): JSDocThrowsTag {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@LukeAbby suggested @returns and @yields could use the same treatment. @yields isn't a specialized tag in TS today so I skipped that and I'm slightly on the fence when it comes to @returns. cc @sandersn

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
For Backlog Bug PRs that fix a backlog bug
Projects
Status: Not started
Development

Successfully merging this pull request may close these issues.

Syntax highlighting can not resolve @throws of tsdoc
2 participants