Skip to content

Commit

Permalink
Fix #118: Detect start of anonymous new
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolasstucki committed Jul 8, 2020
1 parent 5b19916 commit 16d49e5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/typescript/Scala.tmLanguage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -729,7 +729,7 @@ export const scalaTmLanguage: TmLanguage = {
name: 'string.quoted.other constant.character.literal.scala'
},
initialization: {
match: '\\b(new)\\s+([^\\s,\\{\\}\\(\\)\\[\\]]+)',
match: '\\b(new)\\s+([^\\s,\\{\\}\\(\\)\\[\\]]+|(?=\\{))',
captures: {
'1': {
name: 'keyword.declaration.scala'
Expand Down
10 changes: 10 additions & 0 deletions tests/unit/#118.test.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// SYNTAX TEST "source.scala"

new A
// ^^^ keyword.declaration.scala
// ^ entity.name.class

new { }
// ^^^ keyword.declaration.scala
// ^ punctuation.section.block.begin.scala
// ^ punctuation.section.block.end.scala

0 comments on commit 16d49e5

Please sign in to comment.