mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 11:06:54 -04:00
feat(kos): highlights improvements (#8404)
* Mark floats as number.float * Mark function arguments as variable.parameter * Mark _ placeholder as character.special * Mark string interpolation delimiters as punctuation.special
This commit is contained in:
parent
de878155ca
commit
6feaebb456
3 changed files with 54 additions and 5 deletions
|
|
@ -1189,7 +1189,7 @@ return {
|
|||
},
|
||||
kos = {
|
||||
install_info = {
|
||||
revision = '5f11d41b3150b0837e8b3964151ebb7fc4f367e9',
|
||||
revision = '03b261c1a78b71c38cf4616497f253c4a4ce118b',
|
||||
url = 'https://github.com/kos-lang/tree-sitter-kos',
|
||||
},
|
||||
maintainers = { '@cdragan' },
|
||||
|
|
|
|||
|
|
@ -4,8 +4,13 @@
|
|||
|
||||
(number) @number
|
||||
|
||||
(float_number) @number.float
|
||||
|
||||
(identifier) @variable
|
||||
|
||||
(parameter
|
||||
parameter: (identifier) @variable.parameter)
|
||||
|
||||
(property_identifier) @property
|
||||
|
||||
[
|
||||
|
|
@ -57,8 +62,9 @@
|
|||
"=>"
|
||||
] @keyword.function
|
||||
|
||||
"_" @character.special
|
||||
|
||||
[
|
||||
"_"
|
||||
(line)
|
||||
"assert"
|
||||
;"async"
|
||||
|
|
@ -96,6 +102,15 @@
|
|||
"}"
|
||||
] @punctuation.bracket
|
||||
|
||||
(string_literal_begin
|
||||
"\\(" @punctuation.special)
|
||||
|
||||
(string_literal_continuation
|
||||
"\\(" @punctuation.special)
|
||||
|
||||
(formatted_string
|
||||
")" @punctuation.special)
|
||||
|
||||
[
|
||||
";"
|
||||
":"
|
||||
|
|
|
|||
|
|
@ -21,15 +21,15 @@ fun name(arg1,
|
|||
# ^ keyword.function
|
||||
# ^ function
|
||||
# ^ punctuation.bracket
|
||||
# ^ variable
|
||||
# ^ variable.parameter
|
||||
# ^ punctuation.delimiter
|
||||
arg2 = "default",
|
||||
# ^ variable
|
||||
# ^ variable.parameter
|
||||
# ^ operator
|
||||
# ^ string
|
||||
# ^ punctuation.delimiter
|
||||
arg3...)
|
||||
# ^ variable
|
||||
# ^ variable.parameter
|
||||
# ^ operator
|
||||
# ^ punctuation.bracket
|
||||
{
|
||||
|
|
@ -147,3 +147,37 @@ name.name()
|
|||
# ^ function.method.call
|
||||
# ^ punctuation.bracket
|
||||
# ^ punctuation.bracket
|
||||
|
||||
print("hello \(123 + var) world \(true)")
|
||||
# <- function.call
|
||||
# ^ punctuation.bracket
|
||||
# ^ string
|
||||
# ^ punctuation.special
|
||||
# ^ number
|
||||
# ^ operator
|
||||
# ^ variable
|
||||
# ^ punctuation.special
|
||||
# ^ string
|
||||
# ^ punctuation.special
|
||||
# ^ boolean
|
||||
# ^ punctuation.special
|
||||
# ^ punctuation.bracket
|
||||
|
||||
[] -> each((x,_,y) => x + y)
|
||||
# <- punctuation.bracket
|
||||
#^ punctuation.bracket
|
||||
# ^ operator
|
||||
# ^ function.call
|
||||
# ^ punctuation.bracket
|
||||
# ^ punctuation.bracket
|
||||
# ^ variable.parameter
|
||||
# ^ punctuation.delimiter
|
||||
# ^ character.special
|
||||
# ^ punctuation.delimiter
|
||||
# ^ variable.parameter
|
||||
# ^ punctuation.bracket
|
||||
# ^ keyword.function
|
||||
# ^ variable
|
||||
# ^ operator
|
||||
# ^ variable
|
||||
# ^ punctuation.bracket
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue