Skip to content

Commit 29b8512

Browse files
nicolasstuckiPanAeon
authored andcommitted
Fix scala#118: Detect start of anonymous new
1 parent be023f7 commit 29b8512

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

src/typescript/Scala.tmLanguage.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -743,7 +743,7 @@ export const scalaTmLanguage: TmLanguage = {
743743
name: 'string.quoted.other constant.character.literal.scala'
744744
},
745745
initialization: {
746-
match: '\\b(new)\\s+([^\\s,\\{\\}\\(\\)\\[\\]]+)',
746+
match: '\\b(new)\\s+([^\\s,\\{\\}\\(\\)\\[\\]]+|(?=\\{))',
747747
captures: {
748748
'1': {
749749
name: 'keyword.declaration.scala'

tests/unit/#118.test.scala

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// SYNTAX TEST "source.scala"
2+
3+
new A
4+
// ^^^ keyword.declaration.scala
5+
// ^ entity.name.class
6+
7+
new { }
8+
// ^^^ keyword.declaration.scala
9+
// ^ punctuation.section.block.begin.scala
10+
// ^ punctuation.section.block.end.scala

0 commit comments

Comments
 (0)