Skip to content

Commit e007203

Browse files
committed
string interpolation - correct variable name to match sem. meaning, don't mark $vars as vars to be more consistent with the ${var.other}
1 parent 925245c commit e007203

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

src/typescript/Scala.tmLanguage.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { TmLanguage } from "./TMLanguageModel";
44
const letter = "[_a-zA-Z\\$\\p{Lo}\\p{Lt}\\p{Nl}\\p{Ll}\\p{Lu}]"
55
const digit = "[0-9]"
66
const letterOrDigit = `${letter}|${digit}`
7-
const variableName = `${letter}(?:${letterOrDigit})*`
7+
const simpleInterpolatedVariable = `${letter}(?:${letterOrDigit})*` // see SIP-11 https://docs.scala-lang.org/sips/string-interpolation.html
88

99
export const scalaTmLanguage: TmLanguage = {
1010
fileTypes: [
@@ -320,14 +320,10 @@ export const scalaTmLanguage: TmLanguage = {
320320
match: "\\$\\$"
321321
},
322322
{
323-
name: "constant.other.placeholder.scala",
324-
match: `(\\$)(${variableName})`,
323+
match: `(\\$)(${simpleInterpolatedVariable})`,
325324
captures: {
326325
"1": {
327326
name: "punctuation.definition.template-expression.begin.scala"
328-
},
329-
"2": {
330-
name: "variable.other.scala"
331327
}
332328
}
333329
},

0 commit comments

Comments
 (0)