aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAkin Sowemimo <akin.sowemimo@gmail.com>2021-05-18 20:52:57 +0100
committerStephan Seitz <stephan.lauf@yahoo.de>2021-05-18 23:12:56 +0200
commitdb31158fdaa0e25a1e09a5a8091d6d3bbb316735 (patch)
treee40c1516778855dcab1fafb7a74e10463822a9c4
parentfeat: replace match with any-of (diff)
downloadnvim-treesitter-db31158fdaa0e25a1e09a5a8091d6d3bbb316735.tar
nvim-treesitter-db31158fdaa0e25a1e09a5a8091d6d3bbb316735.tar.gz
nvim-treesitter-db31158fdaa0e25a1e09a5a8091d6d3bbb316735.tar.bz2
nvim-treesitter-db31158fdaa0e25a1e09a5a8091d6d3bbb316735.tar.lz
nvim-treesitter-db31158fdaa0e25a1e09a5a8091d6d3bbb316735.tar.xz
nvim-treesitter-db31158fdaa0e25a1e09a5a8091d6d3bbb316735.tar.zst
nvim-treesitter-db31158fdaa0e25a1e09a5a8091d6d3bbb316735.zip
fix: uppercase variables being highlighted as type
-rw-r--r--queries/dart/highlights.scm19
1 files changed, 11 insertions, 8 deletions
diff --git a/queries/dart/highlights.scm b/queries/dart/highlights.scm
index ba3e91f93..1c9538073 100644
--- a/queries/dart/highlights.scm
+++ b/queries/dart/highlights.scm
@@ -2,10 +2,10 @@
; Methods
; --------------------
-;; TODO: does not work
-;(function_type
- ;name: (identifier) @method)
(super) @function
+; TODO: add method/call_expression to grammar and
+; distinguish method call from variable access
+(function_expression_body (identifier) @function)
; Annotations
; --------------------
@@ -105,13 +105,11 @@
(final_builtin) @constant.builtin
((identifier) @type
- (#match? @type "^_?[A-Z]"))
+ (#match? @type "^_?[A-Z].*[a-z]")) ; catch Classes or IClasses not CLASSES
("Function" @type)
; properties
-; TODO: add method/call_expression to grammar and
-; distinguish method call from variable access
(unconditional_assignable_selector
(identifier) @property)
(assignable_selector
@@ -156,9 +154,14 @@
["import" "library" "export"] @include
; Reserved words (cannot be used as identifiers)
-; TODO: "rethrow" @keyword
[
- ; "assert"
+ ; TODO:
+ ; "rethrow" cannot be targeted at all and seems to be an invisible node
+ ; TODO:
+ ; the assert keyword cannot be specifically targeted
+ ; because the grammar selects the whole node or the content
+ ; of the assertion not just the keyword
+ ; assert
(case_builtin)
"extension"
"on"