fix(isolated-declarations): lost leading comments of export default function/class/interface#10990
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
CodSpeed Instrumentation Performance ReportMerging #10990 will not alter performanceComparing Summary
|
There was a problem hiding this comment.
Pull Request Overview
This PR fixes the issue where leading comments for export default functions, classes, or interfaces were lost.
- Updated test snapshots to include the expected leading comment.
- Adjusted the source code in the fixture and module to correctly retain and attach leading comments without affecting functionality.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| crates/oxc_isolated_declarations/tests/snapshots/export-default.snap | Snapshot updated with the expected leading comment for the class. |
| crates/oxc_isolated_declarations/tests/fixtures/export-default.ts | Moved the leading comment to precede the class definition and applied minor formatting improvements. |
| crates/oxc_isolated_declarations/src/module.rs | Refactored comment handling logic to preserve comments based on the presence of a variable declaration. |
Merge activity
|
61ec046 to
9a4b135
Compare

close: #10989