You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: trailing comma inside delimiters no longer over-indents (#27)
* fix: trailing comma inside delimiters no longer over-indents
Two bugs fixed:
1. Trailing commas inside delimited constructs ({}, [], ()) added an
extra indent level because the CONTINUATION regex matched them and
added cx.unit on top of what delimitedIndent already provided. Added
isInsideDelimiter() to skip continuation indent when inside an
unclosed bracket.
2. The CONTINUATION regex's trailing-comment capture (#.*)?$ matched
#{interpolation} inside strings as a "comment", so lines like
"Hello, #{@name}!" were treated as ending with a trailing comma.
Changed to (#(?:[^{].*)?)?$ to exclude #{.
13 new test cases (section 33), 1 previously-skipped test unskipped.
* chore: rebuild demo bundle with latest indent fix
* chore: release 0.4.3
Copy file name to clipboardExpand all lines: CHANGELOG.md
+17Lines changed: 17 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,23 @@ All notable changes to this project will be documented in this file.
4
4
5
5
This project follows [Semantic Versioning](https://semver.org/).
6
6
7
+
## [0.4.3] - 2026-03-27
8
+
9
+
### Fixed
10
+
11
+
-**Trailing comma inside delimiters** — Pressing Enter after a line ending with a trailing comma inside `{}`, `[]`, or `()` no longer adds an extra indent level. Added delimiter-depth detection so the continuation-indent logic defers to `delimitedIndent` inside brackets.
12
+
-**String interpolation false positive** — The continuation regex's trailing-comment capture `(#.*)?$` was matching `#{interpolation}` inside strings as a comment, causing lines like `"Hello, #{@name}!"` to be treated as trailing-comma continuations. Fixed by excluding `#{` from the comment pattern.
13
+
14
+
### Added
15
+
16
+
- 14 new indent test cases (section 33 + unskipped 28b) covering hashes, arrays, method args, nested constructs, bare call continuations, and interpolated strings
17
+
18
+
## [0.4.2] - 2026-03-27
19
+
20
+
### Fixed
21
+
22
+
-**Heredocs with trailing code** — `foo(<<~SQL)`, `<<~HEREDOC.strip`, and similar patterns where code follows the heredoc opener now parse correctly.
0 commit comments