branch: externals/csharp-mode commit eb3e9deeeffe5e0223f61e20b0be8965343f1aff Author: Theodor Thornhill <t...@thornhill.no> Commit: Theodor Thornhill <t...@thornhill.no>
Almost functional indentation --- csharp-mode.el | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/csharp-mode.el b/csharp-mode.el index 12530ee..bf3fb3f 100644 --- a/csharp-mode.el +++ b/csharp-mode.el @@ -173,13 +173,19 @@ Key bindings: \\{csharp-mode-map}" (setq tree-sitter-indent-csharp-scopes '((indent-all . ;; these nodes are always indented - ()) + (anonymous_object_creation_expression + switch_body + switch_section)) (indent-rest . ;; if parent node is one of these and node is not first → indent (namespace_declaration + using_statement class_declaration method_declaration object_creation_expression - anonymous_object_creation_expression + array_creation_expression + lambda_expression + local_function_statement + enum_declaration for_each_statement if_statement)) (indent-body . ;; if parent node is one of these and current node is in middle → indent @@ -209,8 +215,8 @@ Key bindings: (this_expression) @keyword ["using" "namespace" "class" "if" "else" "throw" "new" "for" "return" "await" "struct" "enum" "switch" "case" - "default" "typeof" "try" "catch" "finally" - "foreach" "in" "yield" + "default" "typeof" "try" "catch" "finally" "break" + "foreach" "in" "yield" "get" "set" ] @keyword ;; Literals [(real_literal) (integer_literal)] @number @@ -268,7 +274,6 @@ Key bindings: ;; Class (base_list (identifier) @type) - (accessor_declaration) @keyword (property_declaration type: (identifier) @type name: (identifier) @variable)