Skip to content

🐛 fix(formatter): handle selector attributes in assignment expressions#1228

Merged
harehare merged 1 commit intomainfrom
fix/formatter-selector-attr-in-assign
Feb 6, 2026
Merged

🐛 fix(formatter): handle selector attributes in assignment expressions#1228
harehare merged 1 commit intomainfrom
fix/formatter-selector-attr-in-assign

Conversation

@harehare
Copy link
Copy Markdown
Owner

@harehare harehare commented Feb 6, 2026

Format selector nodes (e.g., value.test) directly using format_selector in assignment expressions to avoid inserting unwanted newlines from leading trivia when using format_node.

Format selector nodes (e.g., value.test) directly using format_selector
in assignment expressions to avoid inserting unwanted newlines from
leading trivia when using format_node.
Copilot AI review requested due to automatic review settings February 6, 2026 14:45
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 formatting issue where assignment expressions containing selector attributes (e.g., value.test) were incorrectly inserting unwanted newlines. The fix ensures that selector nodes are formatted directly using format_selector instead of format_node, which was applying leading trivia inappropriately.

Changes:

  • Added special handling for Selector nodes in assignment expressions to prevent unwanted newline insertion
  • Added a test case to verify the fix for assignment expressions with selector attributes

@harehare harehare merged commit 05a4767 into main Feb 6, 2026
6 checks passed
@harehare harehare deleted the fix/formatter-selector-attr-in-assign branch February 6, 2026 14:56
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