Improve @throws {@link CustomError} handling#61722
Open
Andarist wants to merge 1 commit intomicrosoft:mainfrom
Open
Improve @throws {@link CustomError} handling#61722Andarist wants to merge 1 commit intomicrosoft:mainfrom
@throws {@link CustomError} handling#61722Andarist wants to merge 1 commit intomicrosoft:mainfrom
Conversation
7dac38a to
5d7ead4
Compare
Contributor
There was a problem hiding this comment.
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
Andarist
commented
May 18, 2025
| return finishNode(factory.createJSDocSeeTag(tagName, nameExpression, comments), start); | ||
| } | ||
|
|
||
| function parseThrowsTag(start: number, tagName: Identifier, indent: number, indentText: string): JSDocThrowsTag { |
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
closes #58599