Skip to content

Commit

Permalink
test: update queries and highlights
Browse files Browse the repository at this point in the history
  • Loading branch information
amaanq committed May 11, 2024
1 parent e93de5f commit 02bf5da
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 20 deletions.
4 changes: 2 additions & 2 deletions queries/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,8 @@

"return" @keyword.return

(comment) @spell @comment
(block_comment) @spell @comment
(comment) @comment
(block_comment) @comment

;; `case` is a conditional keyword in case_block

Expand Down
6 changes: 3 additions & 3 deletions test/highlight/comments.scala
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//> using scala 3.1.0
// ^keyword
// ^parameter
// ^string
// ^ keyword
// ^ parameter
// ^ string

/*
* Beep boop
Expand Down
30 changes: 15 additions & 15 deletions test/highlight/scala3.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ class C:
// ^type

def test(aaaa: A): Int =
//^keyword.function
// ^method
// <- keyword.function
// ^ method
// no curly braces, but this is still in test method
val bbb = 1
//^keyword
// ^variable
//^ keyword
// ^ variable
val ccc = 2
//^keyword
// ^variable
Expand All @@ -20,8 +20,8 @@ object O1:
// ^type

def test: Unit = ()
//^keyword.function
// ^method
//^ keyword.function
// ^ method

object O2:
type Elem[A] = A match
Expand Down Expand Up @@ -74,15 +74,15 @@ enum Simple:
case A, B, C
// ^type
enum Test(a: Int) derives Codec:
// ^keyword
// ^keyword
// ^type
// ^type
// ^keyword
// ^type
// ^type
// ^parameter
case Test(b: String)
// ^keyword
// ^keyword
// ^type
// ^type
// ^parameter
Expand All @@ -94,22 +94,22 @@ enum Test(a: Int) derives Codec:

opaque type Blow <: Int = 25
// ^type.qualifier
// ^keyword
// ^type
// ^keyword
// ^type
// ^type.definition

inline given Test = new Test {
// ^ storageclass
inline def hello(inline x: Boolean) =
inline def hello(inline x: Boolean) =
// ^ storageclass
// ^ storageclass
inline if x then "hi" else "bye"
inline if x then "hi" else "bye"
// ^storageclass
// ^conditional
inline x match
inline x match
// ^storageclass
case true => 25
case false => 26
case true => 25
case false => 26
}

object A:
Expand Down

0 comments on commit 02bf5da

Please sign in to comment.