mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-14 09:20:04 -04:00
fix: uppercase variables being highlighted as type
This commit is contained in:
parent
3633684b47
commit
db31158fda
1 changed files with 11 additions and 8 deletions
|
|
@ -2,10 +2,10 @@
|
||||||
|
|
||||||
; Methods
|
; Methods
|
||||||
; --------------------
|
; --------------------
|
||||||
;; TODO: does not work
|
|
||||||
;(function_type
|
|
||||||
;name: (identifier) @method)
|
|
||||||
(super) @function
|
(super) @function
|
||||||
|
; TODO: add method/call_expression to grammar and
|
||||||
|
; distinguish method call from variable access
|
||||||
|
(function_expression_body (identifier) @function)
|
||||||
|
|
||||||
; Annotations
|
; Annotations
|
||||||
; --------------------
|
; --------------------
|
||||||
|
|
@ -105,13 +105,11 @@
|
||||||
(final_builtin) @constant.builtin
|
(final_builtin) @constant.builtin
|
||||||
|
|
||||||
((identifier) @type
|
((identifier) @type
|
||||||
(#match? @type "^_?[A-Z]"))
|
(#match? @type "^_?[A-Z].*[a-z]")) ; catch Classes or IClasses not CLASSES
|
||||||
|
|
||||||
("Function" @type)
|
("Function" @type)
|
||||||
|
|
||||||
; properties
|
; properties
|
||||||
; TODO: add method/call_expression to grammar and
|
|
||||||
; distinguish method call from variable access
|
|
||||||
(unconditional_assignable_selector
|
(unconditional_assignable_selector
|
||||||
(identifier) @property)
|
(identifier) @property)
|
||||||
(assignable_selector
|
(assignable_selector
|
||||||
|
|
@ -156,9 +154,14 @@
|
||||||
["import" "library" "export"] @include
|
["import" "library" "export"] @include
|
||||||
|
|
||||||
; Reserved words (cannot be used as identifiers)
|
; 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)
|
(case_builtin)
|
||||||
"extension"
|
"extension"
|
||||||
"on"
|
"on"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue