Skip to content

Improve @throws {@link CustomError} handling#61722

Closed
Andarist wants to merge 1 commit intomicrosoft:mainfrom
Andarist:fix/jsdoc-links-in-tags
Closed

Improve @throws {@link CustomError} handling#61722
Andarist wants to merge 1 commit intomicrosoft:mainfrom
Andarist:fix/jsdoc-links-in-tags

Conversation

@Andarist
Copy link
Copy Markdown
Contributor

closes #58599

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
Copy Markdown
Contributor

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
Copy Markdown
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

@typescript-bot
Copy link
Copy Markdown
Collaborator

With 6.0 out as the final release vehicle for this codebase, we're closing all PRs that don't fit the merge criteria for post-6.0 patches. If you think this was a mistake and this PR fits the post-6.0 patch criteria, please post to the 6.0 iteration issue with details (specifically, which PR and which patch criteria it satisfies).

Next steps for PRs:

  • For crash bugfixes or language service improvements, PRs are currently accepted at the typescript-go repo
  • Changes to type system behavior should wait until after 7.0, at which point mainline TypeScript development will resume in this repository with the Go codebase
  • Library file updates (lib.d.ts etc) continue to live in this repo or the DOM Generator repo as appropriate

@github-project-automation github-project-automation bot moved this from Not started to Done in PR Backlog Mar 24, 2026
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: Done

Development

Successfully merging this pull request may close these issues.

Syntax highlighting can not resolve @throws of tsdoc

4 participants