mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-12 00:10:04 -04:00
highlights(Pascal): Fix highlighting of types
A recent change broke highlighting for namespaces & generic types like `foo.bar` and `foo<t>`.
This commit is contained in:
parent
e81a60b692
commit
b058034029
2 changed files with 52 additions and 4 deletions
|
|
@ -228,12 +228,20 @@
|
|||
(literalNumber) @number
|
||||
(literalString) @string
|
||||
|
||||
; -- Identifiers
|
||||
; -- Variables
|
||||
|
||||
; Unless a more specific rule applies, treat identifiers as variables
|
||||
(identifier) @variable
|
||||
(exprBinary (identifier) @variable)
|
||||
(exprUnary (identifier) @variable)
|
||||
(assignment (identifier) @variable)
|
||||
(exprBrackets (identifier) @variable)
|
||||
(exprParens (identifier) @variable)
|
||||
(exprDot (identifier) @variable)
|
||||
(exprTpl (identifier) @variable)
|
||||
(exprArgs (identifier) @variable)
|
||||
(defaultValue (identifier) @variable)
|
||||
|
||||
; -- Comments
|
||||
|
||||
(comment) @comment
|
||||
(pp) @function.macro
|
||||
|
||||
|
|
@ -278,11 +286,12 @@
|
|||
(genericTpl entity: (genericDot (identifier) @type))
|
||||
|
||||
; -- Exception parameters
|
||||
|
||||
(exceptionHandler variable: (identifier) @parameter)
|
||||
|
||||
; -- Type usage
|
||||
|
||||
(typeref (_) @type)
|
||||
(typeref) @type
|
||||
|
||||
; -- Constant usage
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue