Skip to content

Commit 2e5b873

Browse files
authored
Fix queries for block in rust and ecma script (#796)
The blocks in rust and javascript seem very unintuitive to me. When I select @block.inner in rust for example, this gets matched: <img width="734" height="153" alt="grafik" src="https://github.com/user-attachments/assets/f33eb2f8-a4a3-4425-82fe-a8dcc71b578a" /> This PR changes this, so @block.inner becomes this: <img width="734" height="161" alt="grafik" src="https://github.com/user-attachments/assets/f3ab2989-833e-48ea-96b4-f899451ad1f8" />
1 parent 8d2c25a commit 2e5b873

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

queries/ecma/textobjects.scm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,8 @@
130130
")") @call.outer)
131131

132132
; blocks
133-
(_
134-
(statement_block) @block.inner) @block.outer
133+
(statement_block
134+
(_)* @block.inner) @block.outer
135135

136136
; parameters
137137
; function ({ x }) ...

queries/rust/textobjects.scm

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,11 +108,11 @@
108108
"}")) @loop.outer
109109

110110
; blocks
111-
(_
112-
(block) @block.inner) @block.outer
111+
(block
112+
(_)* @block.inner) @block.outer
113113

114114
(unsafe_block
115-
(_)? @block.inner) @block.outer
115+
(_)* @block.inner) @block.outer
116116

117117
; calls
118118
(macro_invocation) @call.outer

0 commit comments

Comments
 (0)