Repository navigation
Improve @throws {@link CustomError} handling - #61722
Mateusz Burzyński (Andarist) wants to merge 1 commit into
Conversation
7dac38a to
5d7ead4
Compare
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
| return finishNode(factory.createJSDocSeeTag(tagName, nameExpression, comments), start); | ||
| } | ||
|
|
||
| function parseThrowsTag(start: number, tagName: Identifier, indent: number, indentText: string): JSDocThrowsTag { |
There was a problem hiding this comment.
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 Nathan Shively-Sanders (@sandersn)
|
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:
|
closes #58599