branch: externals/csharp-mode commit 6b232b1f33afdcef912cd32b76e6a480c63e88c2 Author: Theodor Thornhill <t...@thornhill.no> Commit: Theodor Thornhill <t...@thornhill.no>
Much better support for strings, interpolated in particular --- csharp-tree-sitter.el | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/csharp-tree-sitter.el b/csharp-tree-sitter.el index dea5172..3ab0451 100644 --- a/csharp-tree-sitter.el +++ b/csharp-tree-sitter.el @@ -50,7 +50,15 @@ [(real_literal) (integer_literal)] @number (null_literal) @constant (boolean_literal) @constant - (character_literal) @string + [(string_literal) + (verbatim_string_literal) + (interpolated_string_text) + (interpolated_verbatim_string_text) + (character_literal) + "\"" + "$\"" + "@$\""] @string + ;; Keywords ["using" "namespace" "class" "if" "else" "throw" "new" "for" @@ -69,11 +77,6 @@ (select_clause (identifier) @variable) (query_continuation (identifier) @variable) @keyword - ;; String - (interpolation (identifier) (interpolation_format_clause) @variable) - (interpolation (identifier)* @variable) - [(string_literal) (verbatim_string_literal) (interpolated_string_expression)] @string - ;; Enum (enum_member_declaration (identifier) @variable) (enum_declaration (identifier) @type) @@ -222,6 +225,8 @@ (lock_statement (identifier) @variable) ;; Other + (argument_list + (identifier) @variable) (label_name) @variable (qualified_name (identifier) @type) (using_directive (identifier)* @type) @@ -235,6 +240,12 @@ (name_equals (identifier) @type) (field_declaration) (argument (identifier) @variable) + + ;; Catch-alls + (identifier) @variable + + ;; Interpolation + ;; (interpolated_string_expression) @string ] "Default patterns for tree-sitter support.")