Skip to content

fix(63726): fix declaration emit for multiline jsdoc literal types - #4839

Open
Oleksandr Tarasiuk (a-tarasyuk) wants to merge 1 commit into
microsoft:mainfrom
a-tarasyuk:fix/63726
Open

fix(63726): fix declaration emit for multiline jsdoc literal types#4839
Oleksandr Tarasiuk (a-tarasyuk) wants to merge 1 commit into
microsoft:mainfrom
a-tarasyuk:fix/63726

Conversation

@a-tarasyuk

Copy link
Copy Markdown
Contributor

Copilot AI balanced review requested due to automatic review settings August 6, 2026 17:20

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.

Pull request overview

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Adds a regression test and adjusts scanner trivia-skipping to correctly preserve multiline JSDoc literal union types during declaration emit (fixes TypeScript issue #63726).

Changes:

  • Added a new compiler test case for multiline JSDoc union literal typedefs in JS files.
  • Updated the reference baseline to validate correct .d.ts output and preserved JSDoc formatting.
  • Adjusted GetTextOfNodeFromSourceText to use JSDoc-aware trivia skipping when extracting text from JSDoc nodes.

Reviewed changes

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

File Description
testdata/tests/cases/compiler/jsdocMultilineUnion.ts New regression test covering multiline JSDoc literal union typedef formatting.
testdata/baselines/reference/compiler/jsdocMultilineUnion.js Baseline validating correct declaration emit and preserved multiline JSDoc formatting.
internal/scanner/utilities.go Uses JSDoc-aware trivia skipping when extracting node text for JSDoc nodes.

Comment thread internal/scanner/utilities.go Outdated
Comment thread internal/scanner/utilities.go Outdated
Comment thread testdata/tests/cases/compiler/jsdocMultilineUnion.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Poorly formed output with JSDoc typedef

2 participants