diff --git a/src/typescript/Scala.tmLanguage.ts b/src/typescript/Scala.tmLanguage.ts index a819529..e6fd6c8 100644 --- a/src/typescript/Scala.tmLanguage.ts +++ b/src/typescript/Scala.tmLanguage.ts @@ -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' diff --git a/tests/unit/#180.test.scala b/tests/unit/#180.test.scala new file mode 100644 index 0000000..39f6041 --- /dev/null +++ b/tests/unit/#180.test.scala @@ -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 diff --git a/tests/unit/using.test.scala b/tests/unit/using.test.scala index 15ec77b..fb00b38 100644 --- a/tests/unit/using.test.scala +++ b/tests/unit/using.test.scala @@ -41,4 +41,20 @@ given [T](using Ord[T]) as Ord[List[T]] f(using "") // ^^^^^ keyword.declaration.scala -// ^^ string.quoted.double.scala \ No newline at end of file +// ^^ 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