close
Skip to content

preserve jsdoc prop descriptions in declaration emit#4250

Merged
jakebailey merged 1 commit into
microsoft:mainfrom
a-tarasyuk:fix/4235
Jun 9, 2026
Merged

preserve jsdoc prop descriptions in declaration emit#4250
jakebailey merged 1 commit into
microsoft:mainfrom
a-tarasyuk:fix/4235

Conversation

@a-tarasyuk

Copy link
Copy Markdown
Contributor

Fixes #4235

Copilot AI review requested due to automatic review settings June 9, 2026 09:02

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

Note

Copilot was unable to run its full agentic suite in this review.

This PR improves JSDoc comment preservation/formatting in generated declarations by reusing a shared JSDoc text-extraction helper and by restoring lost property documentation when nodes were reparsed.

Changes:

  • Preserve (partial) JSDoc descriptions for reparsed property signature declarations during declaration transformation.
  • Add a scanner utility to extract/trims JSDoc comment text consistently (including {@link ...} nodes).
  • Update hover handling to use the shared JSDoc comment text utility and refresh affected baseline outputs.

Reviewed changes

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

Show a summary per file
File Description
internal/transformers/declarations/transform.go Adds preservePartialJsDoc and applies it to property signature transformations.
internal/scanner/utilities.go Introduces GetTextOfJSDocComment for consistent JSDoc text extraction and trimming.
internal/ls/hover.go Replaces local JSDoc comment concatenation with the shared scanner utility.
testdata/baselines/reference/submodule*/conformance/*.js Updates baselines to reflect newly preserved property JSDoc blocks.
testdata/baselines/reference/submoduleAccepted/conformance/*.js.diff Updates “accepted” baselines to reflect new emitted output.

Comment thread internal/scanner/utilities.go
Comment thread internal/transformers/declarations/transform.go
Comment thread internal/transformers/declarations/transform.go
@a-tarasyuk a-tarasyuk requested a review from jakebailey June 9, 2026 23:14
@jakebailey jakebailey added this pull request to the merge queue Jun 9, 2026
Merged via the queue into microsoft:main with commit f20e919 Jun 9, 2026
21 checks passed
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.

Behavior difference: tsgo no longer emits comment on @typedef style object attributes

5 participants