diff --git a/src/typescript/Scala.tmLanguage.ts b/src/typescript/Scala.tmLanguage.ts index 7a93e2a..1aace96 100644 --- a/src/typescript/Scala.tmLanguage.ts +++ b/src/typescript/Scala.tmLanguage.ts @@ -590,8 +590,16 @@ export const scalaTmLanguage: TmLanguage = { ] }, 'scala-quoted': { - match: "('\\{|'\\[)(?!')", - name: 'constant.other.quoted.scala' + patterns: [ + { // Start of `'{ .. }` or `${ .. }` + match: "['$]\\{(?!')", + name: 'punctuation.section.block.begin.scala' + }, + { // Start of `'[ .. ]` + match: "'\\[(?!')", + name: 'meta.bracket.scala' + } + ] }, 'xml-doublequotedString': { end: '"', diff --git a/tests/unit/quoted.test.scala b/tests/unit/quoted.test.scala index d17ca1c..23349e8 100644 --- a/tests/unit/quoted.test.scala +++ b/tests/unit/quoted.test.scala @@ -1,11 +1,27 @@ // SYNTAX TEST "source.scala" '{ 2 } -// ^^ constant.other.quoted.scala +// ^^ punctuation.section.block.begin.scala // ^ constant.numeric.scala // ^ punctuation.section.block.end.scala '[ String ] -// ^^ constant.other.quoted.scala +// ^^ meta.bracket.scala // ^^^^^^ entity.name.class +// ^ meta.bracket.scala + + + ${ 1 } +// ^^ punctuation.section.block.begin.scala +// ^ constant.numeric.scala +// ^ punctuation.section.block.end.scala + + case '{ x } => +// ^^^^ keyword.control.flow.scala +// ^^ punctuation.section.block.begin.scala +// ^ punctuation.section.block.end.scala + + case '[ T ] => +// ^^^^ keyword.control.flow.scala +// ^^ meta.bracket.scala // ^ meta.bracket.scala