mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-13 17:00:09 -04:00
fix(clojure): fix field highlighting (#5319)
This commit is contained in:
parent
dfbba919dd
commit
e942c720ac
2 changed files with 60 additions and 3 deletions
|
|
@ -63,7 +63,7 @@
|
||||||
|
|
||||||
; Constructor
|
; Constructor
|
||||||
((sym_lit) @constructor
|
((sym_lit) @constructor
|
||||||
(#lua-match? @constructor "^-\\>[^\\>].*"))
|
(#lua-match? @constructor "^-%>[^>].*"))
|
||||||
|
|
||||||
; Builtin dynamic variables
|
; Builtin dynamic variables
|
||||||
((sym_lit) @variable.builtin
|
((sym_lit) @variable.builtin
|
||||||
|
|
@ -100,12 +100,17 @@
|
||||||
(#lua-match? @type "^[^/]+[.][^/]*$"))
|
(#lua-match? @type "^[^/]+[.][^/]*$"))
|
||||||
|
|
||||||
; Interop
|
; Interop
|
||||||
|
; (.instanceMember instance args*)
|
||||||
|
; (.instanceMember Classname args*)
|
||||||
((sym_lit) @method
|
((sym_lit) @method
|
||||||
(#lua-match? @method "^[.][^-]"))
|
(#lua-match? @method "^%.[^-]"))
|
||||||
|
; (.-instanceField instance)
|
||||||
((sym_lit) @field
|
((sym_lit) @field
|
||||||
(#lua-match? @field "^[.]-"))
|
(#lua-match? @field "^%.%-.*"))
|
||||||
|
; Classname/staticField
|
||||||
((sym_lit) @field
|
((sym_lit) @field
|
||||||
(#lua-match? @field "^[%u].*/.+"))
|
(#lua-match? @field "^[%u].*/.+"))
|
||||||
|
; (Classname/staticMethod args*)
|
||||||
(list_lit
|
(list_lit
|
||||||
.
|
.
|
||||||
(sym_lit) @method
|
(sym_lit) @method
|
||||||
|
|
|
||||||
52
tests/query/highlights/clojure/test.clj
Normal file
52
tests/query/highlights/clojure/test.clj
Normal file
|
|
@ -0,0 +1,52 @@
|
||||||
|
(ns test {:clj-kondo/ignore true})
|
||||||
|
; <- punctuation.bracket
|
||||||
|
; ^ include
|
||||||
|
; ^ namespace
|
||||||
|
|
||||||
|
; asdf
|
||||||
|
;^^^^^^ comment
|
||||||
|
|
||||||
|
#_ abc
|
||||||
|
;^^^^^^ comment
|
||||||
|
|
||||||
|
(func obj)
|
||||||
|
;^^^^ function.call
|
||||||
|
; ^^^ variable
|
||||||
|
|
||||||
|
#(+ % %1 %&)
|
||||||
|
;^ punctuation.special
|
||||||
|
; ^ function.call
|
||||||
|
; ^ ^^ ^^ variable.builtin
|
||||||
|
|
||||||
|
&
|
||||||
|
;^ parameter
|
||||||
|
|
||||||
|
->abc
|
||||||
|
;^^^^^ constructor
|
||||||
|
|
||||||
|
->>abc
|
||||||
|
;^^^^^^ variable
|
||||||
|
|
||||||
|
*1 *2 *3 *e
|
||||||
|
;^^ ^^ ^^ ^^ variable.builtin
|
||||||
|
|
||||||
|
(.method)
|
||||||
|
;^^^^^^^ method
|
||||||
|
|
||||||
|
(.-field)
|
||||||
|
;^^^^^^^ field
|
||||||
|
|
||||||
|
Abc/method
|
||||||
|
;^^^^^^^^^^ field
|
||||||
|
|
||||||
|
(Abc/method)
|
||||||
|
;^^^^^^^^^^ method
|
||||||
|
|
||||||
|
Abc
|
||||||
|
;^^^ type
|
||||||
|
|
||||||
|
abc.
|
||||||
|
;^^^^ type
|
||||||
|
|
||||||
|
^abc
|
||||||
|
;^ punctuation.special
|
||||||
Loading…
Add table
Add a link
Reference in a new issue