-
Notifications
You must be signed in to change notification settings - Fork 89
Issue 547 cascade nested lambda breaks #574
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
base: main
Are you sure you want to change the base?
Issue 547 cascade nested lambda breaks #574
Conversation
Add new boolean configuration option to FormattingOptions and wire it through the command-line interface. This option will enable cascading lambda break decisions to nested trailing lambdas, useful for DSLs like Jetpack Compose. Changes: - Add cascadeNestedLambdaBreaks field to FormattingOptions data class - Add --cascade-nested-lambda-breaks command-line flag to ParsedArgs - Update CLI help text to document the new option - Default value is false to maintain backward compatibility 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Add parentLambdaBroke parameter to track parent lambda break state through nested lambda expressions. Add helper method to identify trailing lambdas that should inherit hierarchy preservation. Changes: - Add parentLambdaBroke parameter to visitLambdaExpressionInternal - Add isTrailingLambda helper method to detect trailing lambdas - Update method documentation to explain new parameter - All call sites use default value (false) for now No functional changes yet - context is passed but not used. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Implement the core cascading lambda break functionality. When cascadeNestedLambdaBreaks is enabled and a parent lambda breaks to multi-line, all nested trailing lambdas are forced to break as well, preserving visual hierarchy. Changes: - Add insideBreakingLambda member variable to track break state - Detect when current lambda will break to multi-line - Force nested trailing lambdas to multi-line when parent broke - Propagate break state through nested lambda visitor calls - Update visitArgumentInternal and visitLambdaOrScopingFunction The feature is now functional when --cascade-nested-lambda-breaks flag is enabled. Backward compatible - default behavior unchanged. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Add 7 comprehensive test cases covering various scenarios for the cascadeNestedLambdaBreaks feature. Tests verify basic hierarchy preservation, backward compatibility, deep nesting, edge cases, and that only trailing lambdas are affected. Changes: - Add test for forcing nested lambda hierarchy when option enabled - Add test for maintaining single line when option disabled - Add test for forcing only trailing lambdas (not map/filter) - Add test for forcing behavior when parent breaks - Add test for preserving hierarchy with multiple statements - Add test for handling deep nesting levels - Add test for no effect on non-nested lambdas - Fix containsTrailingLambdas to correctly detect nested lambdas - Update break detection logic to handle hierarchy properly All tests pass, feature fully functional. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
|
Hi @loganj! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at [email protected]. Thanks! |
Document the new --cascade-nested-lambda-breaks command-line option in the README with examples and usage guidelines. The documentation explains how the feature helps preserve visual hierarchy in DSL code like Jetpack Compose. Changes: - Add "Cascading Lambda Breaks" section to README.md - Include usage examples showing before/after formatting - Clarify that option only affects trailing lambdas - Note that it's useful for DSLs with semantic nesting Feature is now fully implemented, tested, and documented. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1885867 to
474ee2d
Compare
No description provided.