branch: externals/csharp-mode commit 27cd2e8da1f374fd9db121826bf78484b0e4079e Author: Theodor Thornhill <t...@thornhill.no> Commit: Theodor Thornhill <t...@thornhill.no>
Align argument to siblings --- csharp-tree-sitter.el | 102 +++++++++++++++++++++++++------------------------- 1 file changed, 51 insertions(+), 51 deletions(-) diff --git a/csharp-tree-sitter.el b/csharp-tree-sitter.el index 8c0bd99..e4c6cb3 100644 --- a/csharp-tree-sitter.el +++ b/csharp-tree-sitter.el @@ -284,57 +284,57 @@ :group 'csharp) (defvar tree-sitter-indent-csharp-tree-sitter-scopes - '((indent-all . ;; these nodes are always indented - (accessor_declaration - break_statement - arrow_expression_clause - parameter_list - conditional_expression - constructor_initializer - argument_list - ".")) - (indent-rest . ;; if parent node is one of these and node is not first → indent - ( - binary_expression - switch_section - )) - (indent-body . ;; if parent node is one of these and current node is in middle → indent - (enum_member_declaration_list - base_list - block - anonymous_object_creation_expression - initializer_expression - expression_statement - declaration_list - attribute_argument_list - switch_body)) - - (paren-indent . ;; if parent node is one of these → indent to paren opener - (parenthesized_expression)) - (align-char-to . ;; chaining char → node types we move parentwise to find the first chaining char - ()) - (aligned-siblings . ;; siblings (nodes with same parent) should be aligned to the first child - (parameter)) - - (multi-line-text . ;; if node is one of these, then don't modify the indent - ;; this is basically a peaceful way out by saying "this looks like something - ;; that cannot be indented using AST, so best I leave it as-is" - (comment - preprocessor_call - labeled_statement)) - (outdent . ;; these nodes always outdent (1 shift in opposite direction) - (;; "}" - case_switch_label - - )) - - (align-to-node-line . ;; this group has lists of alist (node type . (node types... )) - ;; we move parentwise, searching for one of the node - ;; types associated with the key node type. if found, - ;; align key node with line where the ancestor node - ;; was found. - ((block . (lambda_expression)))) - ) + '((indent-all + ;; these nodes are always indented + . (accessor_declaration + break_statement + arrow_expression_clause + parameter_list + conditional_expression + constructor_initializer + argument_list + ".")) + (indent-rest + ;; if parent node is one of these and node is not first → indent + . (binary_expression + switch_section)) + (indent-body + ;; if parent node is one of these and current node is in middle → indent + . (enum_member_declaration_list + base_list + block + anonymous_object_creation_expression + initializer_expression + expression_statement + declaration_list + attribute_argument_list + switch_body)) + (paren-indent + ;; if parent node is one of these → indent to paren opener + . (parenthesized_expression)) + (align-char-to + ;; chaining char → node types we move parentwise to find the first chaining char + . ()) + (aligned-siblings + ;; siblings (nodes with same parent) should be aligned to the first child + . (parameter + argument)) + (multi-line-text + ;; if node is one of these, then don't modify the indent + ;; this is basically a peaceful way out by saying "this looks like something + ;; that cannot be indented using AST, so best I leave it as-is" + . (preprocessor_call + labeled_statement)) + (outdent + ;; these nodes always outdent (1 shift in opposite direction) + . (case_switch_label)) + (align-to-node-line + ;; this group has lists of alist (node type . (node types... )) + ;; we move parentwise, searching for one of the node + ;; types associated with the key node type. if found, + ;; align key node with line where the ancestor node + ;; was found. + . ((block . (lambda_expression))))) "Scopes for indenting in C#.") ;;; tree-sitter helper-functions. navigation, editing, etc.