Skip to content

Commit 796e3f2

Browse files
cornishonRheof
authored and
CedricMeu
committed
Odin textobjects (helix-editor#12302)
Co-authored-by: Adam Zadrożny <[email protected]>
1 parent faebd89 commit 796e3f2

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

book/src/generated/lang-support.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@
147147
| nunjucks || | | |
148148
| ocaml || || `ocamllsp` |
149149
| ocaml-interface || | | `ocamllsp` |
150-
| odin || || `ols` |
150+
| odin || || `ols` |
151151
| ohm |||| |
152152
| opencl |||| `clangd` |
153153
| openscad || | | `openscad-lsp` |

runtime/queries/odin/textobjects.scm

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
(procedure_declaration (identifier) (procedure (block) @function.inside)) @function.around
2+
(procedure_declaration (identifier) (procedure (uninitialized) @function.inside)) @function.around
3+
(overloaded_procedure_declaration (identifier) @function.inside) @function.around
4+
5+
(procedure_type (parameters (parameter (identifier) @parameter.inside) @parameter.around))
6+
(procedure (parameters (parameter (identifier) @parameter.inside) @parameter.around))
7+
8+
((procedure_declaration
9+
(attributes (attribute "@" "(" (identifier) @attr_name ")"))
10+
(identifier) (procedure (block) @test.inside)) @test.around
11+
(#match? @attr_name "test"))
12+
13+
(comment) @comment.inside
14+
(comment)+ @comment.around
15+
(block_comment) @comment.inside
16+
(block_comment)+ @comment.around
17+
18+
(struct_declaration (identifier) "::") @class.around
19+
(enum_declaration (identifier) "::") @class.around
20+
(union_declaration (identifier) "::") @class.around
21+
(bit_field_declaration (identifier) "::") @class.around
22+
(const_declaration (identifier) "::" [(array_type) (distinct_type) (bit_set_type) (pointer_type)]) @class.around

0 commit comments

Comments
 (0)