mirror of
https://github.com/chenasraf/nvim-treesitter.git
synced 2026-05-18 01:39:00 +00:00
Lua: highlight function name
This commit is contained in:
committed by
Thomas Vigouroux
parent
688161c174
commit
429036317a
@@ -124,6 +124,7 @@ are optional and will not have any effect for now.
|
||||
@label for C/Lua-like labels
|
||||
@operator
|
||||
@keyword
|
||||
function
|
||||
@exception
|
||||
@include keywords for including modules (e.g. import/from in Python)
|
||||
|
||||
|
||||
@@ -388,6 +388,10 @@ For any operator: `+`, but also `->` and `*` in C.
|
||||
*hl-TSKeyword*
|
||||
For keywords that don't fall in previous categories.
|
||||
|
||||
`TSKeywordFunction`
|
||||
*hl-TSKeywordFunction*
|
||||
For keywords used to define a fuction.
|
||||
|
||||
`TSException`
|
||||
*hl-TSException*
|
||||
For exception related keywords.
|
||||
|
||||
@@ -46,6 +46,7 @@ hlmap["repeat"] = "TSRepeat"
|
||||
hlmap["label"] = "TSLabel"
|
||||
hlmap["operator"] = "TSOperator"
|
||||
hlmap["keyword"] = "TSKeyword"
|
||||
hlmap["keyword.function"] = "TSKeywordFunction"
|
||||
hlmap["exception"] = "TSException"
|
||||
|
||||
hlmap["type"] = "TSType"
|
||||
|
||||
@@ -54,6 +54,7 @@ highlight default link TSRepeat Repeat
|
||||
highlight default link TSLabel Label
|
||||
highlight default link TSOperator Operator
|
||||
highlight default link TSKeyword Keyword
|
||||
highlight default link TSKeywordFunction Keyword
|
||||
highlight default link TSException Exception
|
||||
|
||||
highlight default link TSType Type
|
||||
|
||||
@@ -25,11 +25,11 @@
|
||||
)
|
||||
|
||||
[
|
||||
"in"
|
||||
"local"
|
||||
"return"
|
||||
(break_statement)
|
||||
"goto"
|
||||
"in"
|
||||
"local"
|
||||
"return"
|
||||
(break_statement)
|
||||
"goto"
|
||||
] @keyword
|
||||
|
||||
;; Operators
|
||||
@@ -77,9 +77,12 @@
|
||||
(nil) @constant.builtin
|
||||
(spread) @constant ;; "..."
|
||||
|
||||
;; Nodes
|
||||
("function" @function "end" @function) ;; Any node that has both funtion and end in it
|
||||
;; Functions
|
||||
("function" @keyword.function
|
||||
[(function_name) (identifier)] @function
|
||||
"end" @keyword.function)
|
||||
|
||||
;; Nodes
|
||||
(table ["{" "}"] @constructor)
|
||||
(comment) @comment
|
||||
(string) @string
|
||||
|
||||
Reference in New Issue
Block a user