mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-17 02:40:09 -04:00
Lua: highlight function name
This commit is contained in:
parent
688161c174
commit
429036317a
5 changed files with 17 additions and 7 deletions
|
|
@ -124,6 +124,7 @@ are optional and will not have any effect for now.
|
||||||
@label for C/Lua-like labels
|
@label for C/Lua-like labels
|
||||||
@operator
|
@operator
|
||||||
@keyword
|
@keyword
|
||||||
|
function
|
||||||
@exception
|
@exception
|
||||||
@include keywords for including modules (e.g. import/from in Python)
|
@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*
|
*hl-TSKeyword*
|
||||||
For keywords that don't fall in previous categories.
|
For keywords that don't fall in previous categories.
|
||||||
|
|
||||||
|
`TSKeywordFunction`
|
||||||
|
*hl-TSKeywordFunction*
|
||||||
|
For keywords used to define a fuction.
|
||||||
|
|
||||||
`TSException`
|
`TSException`
|
||||||
*hl-TSException*
|
*hl-TSException*
|
||||||
For exception related keywords.
|
For exception related keywords.
|
||||||
|
|
|
||||||
|
|
@ -46,6 +46,7 @@ hlmap["repeat"] = "TSRepeat"
|
||||||
hlmap["label"] = "TSLabel"
|
hlmap["label"] = "TSLabel"
|
||||||
hlmap["operator"] = "TSOperator"
|
hlmap["operator"] = "TSOperator"
|
||||||
hlmap["keyword"] = "TSKeyword"
|
hlmap["keyword"] = "TSKeyword"
|
||||||
|
hlmap["keyword.function"] = "TSKeywordFunction"
|
||||||
hlmap["exception"] = "TSException"
|
hlmap["exception"] = "TSException"
|
||||||
|
|
||||||
hlmap["type"] = "TSType"
|
hlmap["type"] = "TSType"
|
||||||
|
|
|
||||||
|
|
@ -54,6 +54,7 @@ highlight default link TSRepeat Repeat
|
||||||
highlight default link TSLabel Label
|
highlight default link TSLabel Label
|
||||||
highlight default link TSOperator Operator
|
highlight default link TSOperator Operator
|
||||||
highlight default link TSKeyword Keyword
|
highlight default link TSKeyword Keyword
|
||||||
|
highlight default link TSKeywordFunction Keyword
|
||||||
highlight default link TSException Exception
|
highlight default link TSException Exception
|
||||||
|
|
||||||
highlight default link TSType Type
|
highlight default link TSType Type
|
||||||
|
|
|
||||||
|
|
@ -25,11 +25,11 @@
|
||||||
)
|
)
|
||||||
|
|
||||||
[
|
[
|
||||||
"in"
|
"in"
|
||||||
"local"
|
"local"
|
||||||
"return"
|
"return"
|
||||||
(break_statement)
|
(break_statement)
|
||||||
"goto"
|
"goto"
|
||||||
] @keyword
|
] @keyword
|
||||||
|
|
||||||
;; Operators
|
;; Operators
|
||||||
|
|
@ -77,9 +77,12 @@
|
||||||
(nil) @constant.builtin
|
(nil) @constant.builtin
|
||||||
(spread) @constant ;; "..."
|
(spread) @constant ;; "..."
|
||||||
|
|
||||||
;; Nodes
|
;; Functions
|
||||||
("function" @function "end" @function) ;; Any node that has both funtion and end in it
|
("function" @keyword.function
|
||||||
|
[(function_name) (identifier)] @function
|
||||||
|
"end" @keyword.function)
|
||||||
|
|
||||||
|
;; Nodes
|
||||||
(table ["{" "}"] @constructor)
|
(table ["{" "}"] @constructor)
|
||||||
(comment) @comment
|
(comment) @comment
|
||||||
(string) @string
|
(string) @string
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue