Skip to content

Commit e10df91

Browse files
authored
feat(ecma): refine class.inner text object selection (#747)
* 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. * feat(ecma): separate class.outer and class.inner text objects
1 parent 0e3be38 commit e10df91

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

queries/ecma/textobjects.scm

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

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

7788
(export_statement
7889
(class_declaration)) @class.outer

0 commit comments

Comments
 (0)