-
-
Notifications
You must be signed in to change notification settings - Fork 713
feat(transformer_plugins): add changed field to InjectGlobalVariablesReturn #14618
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Adds a changed flag to track whether the AST was modified during the inject_global_variables transformation, enabling callers to detect modifications without diffing the AST.
- Add changed: bool to InjectGlobalVariablesReturn and pipeline state
- Set changed when imports are injected and when dot-define member expressions are replaced
- Return changed from build in all code paths
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
bd10f2b to
67c13e3
Compare
Merge activity
|
…Return (#14618) ## Summary Add a `changed: bool` field to `InjectGlobalVariablesReturn` to track whether the AST was modified during the global variable injection transformation. - Adds `changed` field to `InjectGlobalVariablesReturn` struct - Tracks changes via consolidated `mark_as_changed()` helper method - Updates `replace_dot_defines` when dot define replacements occur - Updates `inject_imports` when import statements are injected - Updates `build` method to return `changed` in all paths This allows callers to efficiently determine if injections or replacements were made without needing to compare the AST before and after transformation. ## Test plan - [x] All existing tests pass - [x] No new tests needed - change tracking is straightforward 🤖 Generated with [Claude Code](https://claude.com/claude-code)
67c13e3 to
6daf3c2
Compare
…Return (#14618) ## Summary Add a `changed: bool` field to `InjectGlobalVariablesReturn` to track whether the AST was modified during the global variable injection transformation. - Adds `changed` field to `InjectGlobalVariablesReturn` struct - Tracks changes via consolidated `mark_as_changed()` helper method - Updates `replace_dot_defines` when dot define replacements occur - Updates `inject_imports` when import statements are injected - Updates `build` method to return `changed` in all paths This allows callers to efficiently determine if injections or replacements were made without needing to compare the AST before and after transformation. ## Test plan - [x] All existing tests pass - [x] No new tests needed - change tracking is straightforward 🤖 Generated with [Claude Code](https://claude.com/claude-code)
6daf3c2 to
2f85b31
Compare
Summary
Add a
changed: boolfield toInjectGlobalVariablesReturnto track whether the AST was modified during the global variable injection transformation.changedfield toInjectGlobalVariablesReturnstructmark_as_changed()helper methodreplace_dot_defineswhen dot define replacements occurinject_importswhen import statements are injectedbuildmethod to returnchangedin all pathsThis allows callers to efficiently determine if injections or replacements were made without needing to compare the AST before and after transformation.
Test plan
🤖 Generated with Claude Code