chore: sync highlights back with nvim-treesitter (#148)

pull/481/head
Chris Kipp 2023-01-15 12:16:57 +07:00 committed by GitHub
parent 73d5a6680c
commit b49a1fca34
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 20 additions and 27 deletions

@ -1,22 +1,22 @@
; CREDITS @stumash (stuart.mashaal@gmail.com) ; CREDITS @stumash (stuart.mashaal@gmail.com)
(class_definition (class_definition
name: (identifier) @type.definition) name: (identifier) @type)
(enum_definition (enum_definition
name: (identifier) @type.definition) name: (identifier) @type)
(object_definition (object_definition
name: (identifier) @type.definition) name: (identifier) @type)
(trait_definition (trait_definition
name: (identifier) @type.definition) name: (identifier) @type)
(full_enum_case (full_enum_case
name: (identifier) @type.definition) name: (identifier) @type)
(simple_enum_case (simple_enum_case
name: (identifier) @type.definition) name: (identifier) @type)
;; variables ;; variables
@ -96,8 +96,6 @@
(generic_function (generic_function
function: (identifier) @function.call) function: (identifier) @function.call)
;; I think this is broken
; function definitions ; function definitions
(function_definition (function_definition
@ -111,7 +109,6 @@
; expressions ; expressions
(field_expression field: (identifier) @property) (field_expression field: (identifier) @property)
(field_expression value: (identifier) @type (field_expression value: (identifier) @type
(#lua-match? @type "^[A-Z]")) (#lua-match? @type "^[A-Z]"))
@ -161,6 +158,7 @@
"var" "var"
"with" "with"
"given" "given"
"using"
"end" "end"
"implicit" "implicit"
"extension" "extension"
@ -170,18 +168,13 @@
[ [
"abstract" "abstract"
"final" "final"
"using"
"lazy" "lazy"
"sealed" "sealed"
] @type.qualifier
(inline_modifier) @storageclass
[
"private" "private"
"protected" "protected"
] @storageclass ] @type.qualifier
(inline_modifier) @storageclass
(null_literal) @constant.builtin (null_literal) @constant.builtin

@ -1,6 +1,6 @@
object Hello { object Hello {
// ^ keyword // ^ keyword
// ^ type.definition // ^ type
val x = if (true) (25 * 1.0) else "hello" val x = if (true) (25 * 1.0) else "hello"
// ^keyword // ^keyword
// ^variable // ^variable
@ -17,7 +17,7 @@ object Hello {
trait Test { trait Test {
// ^ keyword // ^ keyword
// ^ type.definition // ^ type
def meth(i: Int)(implicit x: Boolean) = ??? def meth(i: Int)(implicit x: Boolean) = ???
// ^keyword.function // ^keyword.function
// ^keyword // ^keyword
@ -27,7 +27,7 @@ object Hello {
} }
protected abstract class Bla(test: String) protected abstract class Bla(test: String)
// ^storageclass // ^type.qualifier
// ^keyword // ^keyword
// ^type.qualifier // ^type.qualifier
// ^parameter // ^parameter
@ -40,7 +40,7 @@ object Hello {
class A { class A {
// ^ keyword // ^ keyword
// ^ type.definition // ^ type
self: X => self: X =>
// ^constant // ^constant
// ^type // ^type

@ -1,7 +1,7 @@
// Optional braces syntax // Optional braces syntax
class C: class C:
// ^keyword // ^keyword
// ^type.definition // ^type
def test(aaaa: A): Int = def test(aaaa: A): Int =
//^keyword.function //^keyword.function
@ -17,7 +17,7 @@ class C:
object O1: object O1:
//^keyword //^keyword
// ^type.definition // ^type
def test: Unit = () def test: Unit = ()
//^keyword.function //^keyword.function
@ -63,16 +63,16 @@ enum Test(a: Int) derives Codec:
// ^type // ^type
// ^keyword // ^keyword
// ^type // ^type
// ^type.definition // ^type
// ^parameter // ^parameter
case Test(b: String) case Test(b: String)
// ^keyword // ^keyword
// ^type // ^type
// ^type.definition // ^type
// ^parameter // ^parameter
case Hello, Bla case Hello, Bla
// ^type.definition // ^type
// ^type.definition // ^type
case Bla extends Test(256) case Bla extends Test(256)
// ^keyword // ^keyword
@ -98,7 +98,7 @@ inline given Test = new Test {
object A: object A:
// ^ keyword // ^ keyword
// ^type.definition // ^type
::(123) ::(123)
//^function.call //^function.call