diff options
| author | Riley Bruins <ribru17@hotmail.com> | 2024-10-07 10:42:58 -0700 |
|---|---|---|
| committer | Christian Clason <c.clason@uni-graz.at> | 2024-10-08 08:43:26 +0200 |
| commit | 18adcafad0e817da303c41859d7dbe4ce5946759 (patch) | |
| tree | b8cde6f0a811a505ef1c0f15c8beacffd531f524 /queries/dart | |
| parent | bot(lockfile): update apex, mlir, nix, sflog, soql, sosl, superhtml, swift, t... (diff) | |
| download | nvim-treesitter-18adcafad0e817da303c41859d7dbe4ce5946759.tar nvim-treesitter-18adcafad0e817da303c41859d7dbe4ce5946759.tar.gz nvim-treesitter-18adcafad0e817da303c41859d7dbe4ce5946759.tar.bz2 nvim-treesitter-18adcafad0e817da303c41859d7dbe4ce5946759.tar.lz nvim-treesitter-18adcafad0e817da303c41859d7dbe4ce5946759.tar.xz nvim-treesitter-18adcafad0e817da303c41859d7dbe4ce5946759.tar.zst nvim-treesitter-18adcafad0e817da303c41859d7dbe4ce5946759.zip | |
fix(dart): more highlight coverage, import folds
Diffstat (limited to 'queries/dart')
| -rw-r--r-- | queries/dart/folds.scm | 1 | ||||
| -rw-r--r-- | queries/dart/highlights.scm | 51 |
2 files changed, 39 insertions, 13 deletions
diff --git a/queries/dart/folds.scm b/queries/dart/folds.scm index 8dc4e7815..fc75ac219 100644 --- a/queries/dart/folds.scm +++ b/queries/dart/folds.scm @@ -9,4 +9,5 @@ (list_literal) (set_or_map_literal) (string_literal) + (import_or_export)+ ] @fold diff --git a/queries/dart/highlights.scm b/queries/dart/highlights.scm index 142c6e190..5189a407a 100644 --- a/queries/dart/highlights.scm +++ b/queries/dart/highlights.scm @@ -1,27 +1,28 @@ +(identifier) @variable + (dotted_identifier_list) @string ; Methods ; -------------------- -(super) @function - ; TODO: add method/call_expression to grammar and ; distinguish method call from variable access (function_expression_body - (identifier) @function) + (identifier) @function.call) ; ((identifier)(selector (argument_part)) @function) ; NOTE: This query is a bit of a work around for the fact that the dart grammar doesn't ; specifically identify a node as a function call -(((identifier) @function - (#lua-match? @function "^_?[%l]")) +(((identifier) @function.call + (#lua-match? @function.call "^_?[%l]")) . (selector . - (argument_part))) @function + (argument_part))) @function.call ; Annotations ; -------------------- (annotation + "@" @attribute name: (identifier) @attribute) ; Operators and Tokens @@ -38,13 +39,12 @@ (escape_sequence) @string.escape [ - "@" "=>" ".." "??" "==" + "!" "?" - ":" "&&" "%" "<" @@ -53,6 +53,20 @@ ">=" "<=" "||" + ">>>=" + ">>=" + "<<=" + "&=" + "|=" + "??=" + "%=" + "+=" + "-=" + "*=" + "/=" + "^=" + "~/=" + (shift_operator) (multiplicative_operator) (increment_operator) (is_operator) @@ -76,6 +90,9 @@ ";" "." "," + ":" + "?." + "?" ] @punctuation.delimiter ; Types @@ -116,6 +133,12 @@ (type_alias (type_identifier) @type.definition) +(type_arguments + [ + "<" + ">" + ] @punctuation.bracket) + ; Variables ; -------------------- ; var keyword @@ -133,16 +156,12 @@ (conditional_assignable_selector (identifier) @property) -; assignments -(assignment_expression - left: (assignable_expression) @variable) - (this) @variable.builtin ; Parameters ; -------------------- (formal_parameter - name: (identifier) @variable.parameter) + (identifier) @variable.parameter) (named_argument (label @@ -263,6 +282,12 @@ "default" ] @keyword.conditional +(conditional_expression + [ + "?" + ":" + ] @keyword.conditional.ternary) + [ "try" "throw" |
