Repository navigation
fix(napi-derive): comments idents regression - #2857
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. |
There was a problem hiding this comment.
Pull Request Overview
This PR fixes a regression in the napi-derive crate related to handling comment indentation. The fix ensures that comment blocks are properly dedented while preserving their internal formatting structure.
- Updated typegen logic to calculate minimum indentation and preserve relative indentation in comment blocks
- Added a new CompilerAssumptions struct with comprehensive documentation to test the fix
Reviewed Changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| crates/backend/src/typegen.rs | Implements proper comment dedenting logic by calculating minimum indentation |
| examples/napi/src/object.rs | Adds CompilerAssumptions struct with multi-line documentation to test the fix |
| examples/napi/index.d.cts | Generated TypeScript definitions for the new struct |
| examples/napi/tests/snapshots/values.spec.ts.md | Updated test snapshot reflecting the new TypeScript output |
| /// _defineProperty(Test, "staticField", 3); | ||
| /// ``` | ||
| /// | ||
| /// NOTE: For TypeScript, if you wanted behavior is equivalent to `useDefineForClassFields: false`, you should |
There was a problem hiding this comment.
The comment contains a grammatical error. 'you wanted behavior' should be 'the wanted behavior' or 'your wanted behavior'.
| /// NOTE: For TypeScript, if you wanted behavior is equivalent to `useDefineForClassFields: false`, you should | |
| /// NOTE: For TypeScript, if the wanted behavior is equivalent to `useDefineForClassFields: false`, you should |

No description provided.