Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/typescript/Scala.tmLanguage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ export const scalaTmLanguage: TmLanguage = {
'using': {
patterns: [
{
match: `(?<=\\()\\s*(using)\\s+(?=[\\w\\d\\(\\.\\(\\{'"])`,
match: `(?<=\\()\\s*(using)\\s`,
captures: {
'1': {
name: 'keyword.declaration.scala'
Expand Down
7 changes: 7 additions & 0 deletions tests/unit/#180.test.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// SYNTAX TEST "source.scala"

case '{ Array[T]()(using $ct) } =>
// ^^^^^ keyword.declaration.scala

case '{ Array[T]()(using ($ct: ClassTag[T])) } =>
// ^^^^^ keyword.declaration.scala
18 changes: 17 additions & 1 deletion tests/unit/using.test.scala
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,20 @@ given [T](using Ord[T]) as Ord[List[T]]

f(using "")
// ^^^^^ keyword.declaration.scala
// ^^ string.quoted.double.scala
// ^^ string.quoted.double.scala

val using = ...
// ^^^^^ - keyword.declaration.scala
val using: X = ...
// ^^^^^ - keyword.declaration.scala
def using() = ...
// ^^^^^ - keyword.declaration.scala

using(foo)
// ^^^^^ - keyword.declaration.scala
bar(using(foo))
// ^^^^^ - keyword.declaration.scala
bar(using.apply(foo))
// ^^^^^ - keyword.declaration.scala
using.apply(foo)
// ^^^^^ - keyword.declaration.scala