diff options
| author | George Harker <george@george-graphics.co.uk> | 2023-03-20 14:44:39 -0700 |
|---|---|---|
| committer | Amaan Qureshi <amaanq12@gmail.com> | 2023-03-24 13:07:53 -0400 |
| commit | cb568af5393241e5dbc9c19157c5df5e9ca9af2d (patch) | |
| tree | e3a1848a3f1c7a03a4ecadd14f95022eaeb52f0f /queries/gdscript | |
| parent | split delimiter into open_delimiter and close_delimiter (diff) | |
| download | nvim-treesitter-cb568af5393241e5dbc9c19157c5df5e9ca9af2d.tar nvim-treesitter-cb568af5393241e5dbc9c19157c5df5e9ca9af2d.tar.gz nvim-treesitter-cb568af5393241e5dbc9c19157c5df5e9ca9af2d.tar.bz2 nvim-treesitter-cb568af5393241e5dbc9c19157c5df5e9ca9af2d.tar.lz nvim-treesitter-cb568af5393241e5dbc9c19157c5df5e9ca9af2d.tar.xz nvim-treesitter-cb568af5393241e5dbc9c19157c5df5e9ca9af2d.tar.zst nvim-treesitter-cb568af5393241e5dbc9c19157c5df5e9ca9af2d.zip | |
use indent.X syntax for captures and properties of set directives
update CONTRIBUTING.md
adjust indents for bass
fix doc capture comment
Diffstat (limited to 'queries/gdscript')
| -rw-r--r-- | queries/gdscript/indents.scm | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/queries/gdscript/indents.scm b/queries/gdscript/indents.scm index b7c0ac836..4eb579b22 100644 --- a/queries/gdscript/indents.scm +++ b/queries/gdscript/indents.scm @@ -12,12 +12,12 @@ (match_body) (set_body) (get_body) -] @indent +] @indent.begin [ (elif_clause) (else_clause) -] @branch +] @indent.branch [ (string) @@ -26,46 +26,46 @@ (dictionary) (parenthesized_expression) (ERROR) -] @auto +] @indent.auto [ (pass_statement) (continue_statement) (break_statement) (return_statement) -] @dedent +] @indent.dedent [ (ERROR "[") (ERROR "(") (ERROR "{") -] @indent +] @indent.begin ;; This only works with expanded tabs. -; ((parameters) @aligned_indent (#set! "open_delimiter" "(") (#set! "close_delimiter" ")")) -; ((arguments) @aligned_indent (#set! "open_delimiter" "(") (#set! "close_delimiter" ")")) +; ((parameters) @indent.align (#set! indent.open_delimiter "(") (#set! indent.close_delimiter ")")) +; ((arguments) @indent.align (#set! indent.open_delimiter "(") (#set! indent.close_delimiter ")")) ;; The following queries either do not agree with the current body parsing or are ;; attempted workarounds. Specifically as the last statement of a body. Opening ;; a new line in between statements works well. ;; -;; The overall experience is poor, so I've opted for @auto. +;; The overall experience is poor, so I've opted for @indent.auto. ;; ;; The gdscript parser will need to be patched to accommodate more interactive ;; edits. As far as I can tell the parser greedily consumes whitespace ;; as a zero-width token which causes trouble when inserting indents. ;; This indents correctly with tabs. -; (arguments) @indent -; (parameters) @indent -; (array) @indent -; (dictionary) @indent -; (parenthesized_expression) @indent +; (arguments) @indent.begin +; (parameters) @indent.begin +; (array) @indent.begin +; (dictionary) @indent.begin +; (parenthesized_expression) @indent.begin ;; Partial workaround for when the cursor is on the bracket character and a newline ;; is created with <o>. Without this the newline is opened with extra ;; indentation. -; (body (_ (array "]" @indent_end) ) _) +; (body (_ (array "]" @indent.end) ) _) ;; Problematic behaviors occur at the last statement of a body. ;; with @dedent: ;; - [ | ] i<CR> will dedent ] to 0. @@ -75,4 +75,4 @@ ;; - [ | ] i<CR> same ;; - [ ;; ]| o will open new line with extra indent. -;(body (_ (array "]" @auto) ) .) +;(body (_ (array "]" @indent.auto) ) .) |
