Skip to content

Commit ea7700b

Browse files
gbogarinbGustavo Bogarín
authored andcommitted
Add c-sharp textobjects (helix-editor#3494)
Co-authored-by: Gustavo Bogarín <gbogarin@outlook.com> Co-authored-by: Gustavo Bogarín <gbogarin@posibillian.tech>
1 parent 2429e80 commit ea7700b

File tree

4 files changed

+36
-4
lines changed

4 files changed

+36
-4
lines changed

book/src/generated/lang-support.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
| bash || | | `bash-language-server` |
55
| beancount || | | |
66
| c |||| `clangd` |
7-
| c-sharp || | | `OmniSharp` |
7+
| c-sharp || | | `OmniSharp` |
88
| cairo || | | |
99
| clojure || | | `clojure-lsp` |
1010
| cmake |||| `cmake-language-server` |

languages.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ language-server = { command = "OmniSharp", args = [ "--languageserver" ] }
235235

236236
[[grammar]]
237237
name = "c-sharp"
238-
source = { git = "https://github.com/tree-sitter/tree-sitter-c-sharp", rev = "53a65a908167d6556e1fcdb67f1ee62aac101dda" }
238+
source = { git = "https://github.com/tree-sitter/tree-sitter-c-sharp", rev = "9c494a503c8e2044bfffce57f70b480c01a82f03" }
239239

240240
[[language]]
241241
name = "go"

runtime/queries/c-sharp/highlights.scm

+13-2
Original file line numberDiff line numberDiff line change
@@ -228,8 +228,19 @@
228228
"let"
229229
] @keyword
230230

231-
(preprocessor_call) @keyword.directive
232-
(preprocessor_call (_) @keyword.directive)
231+
(nullable_directive) @keyword.directive
232+
(define_directive) @keyword.directive
233+
(undef_directive) @keyword.directive
234+
(if_directive) @keyword.directive
235+
(else_directive) @keyword.directive
236+
(elif_directive) @keyword.directive
237+
(endif_directive) @keyword.directive
238+
(region_directive) @keyword.directive
239+
(endregion_directive) @keyword.directive
240+
(error_directive) @keyword.directive
241+
(warning_directive) @keyword.directive
242+
(line_directive) @keyword.directive
243+
(pragma_directive) @keyword.directive
233244

234245
;; Linq
235246
(from_clause (identifier) @variable)
+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
[
2+
(class_declaration body: (_) @class.inside)
3+
(struct_declaration body: (_) @class.inside)
4+
(interface_declaration body: (_) @class.inside)
5+
(enum_declaration body: (_) @class.inside)
6+
(delegate_declaration)
7+
(record_declaration body: (_) @class.inside)
8+
(record_struct_declaration body: (_) @class.inside)
9+
] @class.around
10+
11+
(constructor_declaration body: (_) @function.inside) @function.around
12+
13+
(destructor_declaration body: (_) @function.inside) @function.around
14+
15+
(method_declaration body: (_) @function.inside) @function.around
16+
17+
(property_declaration (_) @function.inside) @function.around
18+
19+
(parameter (_) @parameter.inside) @parameter.around
20+
21+
(comment)+ @comment.around

0 commit comments

Comments
 (0)