fix(css): restore indent after }); in LESS/SCSS - #2485
Conversation
Fixes #2380 When beautifying LESS/SCSS code with }); one-liner patterns (common in mixin calls), the indent level was not restored after trimming the newline. This caused subsequent code to be indented at the wrong level. Added set_indent() call after trim() to restore the correct indent level in both JavaScript and Python implementations. Signed-off-by: Mustafa Senoglu <mustafa@senoglu.local>
|
Hi, just checking in on this PR. It fixes the LESS/SCSS indentation issue after mixin calls. Would appreciate a review. Thanks! |
|
Add tests |
|
Hi @bitwiseman, I've added a test case for the LESS |
|
Update: Changed the test from |
|
Hi! Just checking in on this PR. The CI and CodeQL checks seem to require attention. The fix addresses LESS Let me know if there's anything I need to adjust. Thanks! |
Add additional test cases covering: - SCSS @each loop with mixin and subsequent rule - Multiple consecutive }); in LESS nested mixins These complement the existing LESS each() test to ensure indentation is properly restored after }); in various scenarios.
|
Hi @bitwiseman, I've added additional test cases:
The existing LESS |
Summary
Fixes #2380
Problem
When beautifying LESS/SCSS code with
});one-liner patterns (common in mixin calls likeeach()), the indent level was not restored after trimming the newline.This caused subsequent code to be indented at the wrong level:
Solution
Added
set_indent()call aftertrim()to restore the correct indent level in both JavaScript and Python implementations:Testing