Skip to content

fix(napi-derive): comments idents regression - #2857

Merged
Brooooooklyn merged 1 commit into
mainfrom
08-09-fix_napi-derive_comments_idents_regression
Aug 9, 2025
Merged

Brooooooklyn merged 1 commit into
mainfrom
08-09-fix_napi-derive_comments_idents_regression

Conversation

@Brooooooklyn

Copy link
Copy Markdown
Member

No description provided.

Copy link
Copy Markdown
Member Author

How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • ready-to-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

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.

@Brooooooklyn
Brooooooklyn requested a review from Copilot August 9, 2025 14:56

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

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

Copilot AI Aug 9, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment contains a grammatical error. 'you wanted behavior' should be 'the wanted behavior' or 'your wanted behavior'.

Suggested change
/// 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

Copilot uses AI. Check for mistakes.
@Brooooooklyn
Brooooooklyn merged commit bcef141 into main Aug 9, 2025
@Brooooooklyn
Brooooooklyn deleted the 08-09-fix_napi-derive_comments_idents_regression branch August 9, 2025 15:02
@github-actions github-actions Bot mentioned this pull request Aug 9, 2025
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.

2 participants