Skip to content

Commit 1d3965a

Browse files
committed
feat(ecma): refine class.inner text object selection
Replace basic node capture for class.inner with make-range! implementation to select class body content without including braces. This makes class.inner behavior consistent with function.inner, providing a more intuitive text object selection for editing class contents.
1 parent 9937e5e commit 1d3965a

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

queries/ecma/textobjects.scm

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,15 @@
7272
(#make-range! "function.inner" @_start @_end)))
7373

7474
(class_declaration
75-
body: (class_body) @class.inner) @class.outer
75+
body: (class_body
76+
.
77+
"{"
78+
.
79+
(_) @_start @_end
80+
(_)? @_end
81+
.
82+
"}"
83+
(#make-range! "class.inner" @_start @_end)))
7684

7785
(export_statement
7886
(class_declaration)) @class.outer

0 commit comments

Comments
 (0)