Skip to content

Commit 643cbc3

Browse files
committed
Fix #57: Fix handling of scala.quoted opening quotes
* Remove `'(` as a opening quote * Make sure that `'{`/`'[` is not followed by `'`
1 parent 439028b commit 643cbc3

File tree

4 files changed

+34
-2
lines changed

4 files changed

+34
-2
lines changed

src/typescript/Scala.tmLanguage.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ export const scalaTmLanguage: TmLanguage = {
434434
]
435435
},
436436
'scala-quoted': {
437-
match: "'\\{'|'\\('|'\\['|'\\{|'\\(|'\\[",
437+
match: "('\\{|'\\[)(?!')",
438438
name: 'constant.other.quoted.scala'
439439
},
440440
'xml-doublequotedString': {

syntaxes/Scala.tmLanguage.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

tests/unit/#57.test.scala

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// SYNTAX TEST "source.scala"
2+
3+
'['
4+
// ^ punctuation.definition.character.begin.scala
5+
// ^ constant.character.literal.scala
6+
// ^ punctuation.definition.character.end.scala
7+
8+
'{'
9+
// ^ punctuation.definition.character.begin.scala
10+
// ^ constant.character.literal.scala
11+
// ^ punctuation.definition.character.end.scala
12+
13+
'('
14+
// ^ punctuation.definition.character.begin.scala
15+
// ^ constant.character.literal.scala
16+
// ^ punctuation.definition.character.end.scala
17+
18+
'\n'
19+
// ^ punctuation.definition.character.begin.scala
20+
// ^^ constant.character.literal.scala
21+
// ^ punctuation.definition.character.end.scala

tests/unit/quoted.test.scala

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// SYNTAX TEST "source.scala"
2+
3+
'{ 2 }
4+
// ^^ constant.other.quoted.scala
5+
// ^ constant.numeric.scala
6+
// ^ punctuation.section.block.end.scala
7+
8+
'[ String ]
9+
// ^^ constant.other.quoted.scala
10+
// ^^^^^^ storage.type.scala
11+
// ^ meta.bracket.scala

0 commit comments

Comments
 (0)