Skip to content

Commit

Permalink
Fix #68 and fix #77: End names on open brackets
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolasstucki committed Jun 29, 2020
1 parent 1342458 commit 05a24a6
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/typescript/Scala.tmLanguage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@ export const scalaTmLanguage: TmLanguage = {
}
},
{
match: '\\b(?:(case|open)\\s+)?(class|object)\\s+([^\\s\\{\\(\\[]+)',
match: '\\b(?:(case|open)\\s+)?(class|object)\\s+([^\\s\\{\\(\\[;]+)',
captures: {
'1': {
name: 'keyword.declaration.scala'
Expand Down Expand Up @@ -935,7 +935,7 @@ export const scalaTmLanguage: TmLanguage = {
inheritance: {
patterns: [
{
match: '(extends|with|derives)\\s+([^\\s\\(\\{\\[\\]]+|(?=\\([^\\)]+=>))',
match: '(extends|with|derives)\\s+([^\\s\\(\\{\\[\\]\\)\\};]+|(?=\\([^\\)]+=>))',
captures: {
'1': {
name: 'keyword.declaration.scala'
Expand Down
15 changes: 15 additions & 0 deletions tests/unit/#77.test.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// SYNTAX TEST "source.scala"


class A extends B with NoStackTrace)
// ^^^^ keyword.declaration.scala
// ^^^^^^^^^^^^ entity.other.inherited-class.scala
// ^ meta.bracket.scala
class A extends B with NoStackTrace}
// ^^^^ keyword.declaration.scala
// ^^^^^^^^^^^^ entity.other.inherited-class.scala
// ^ punctuation.section.block.end.scala
class A extends B with NoStackTrace]
// ^^^^ keyword.declaration.scala
// ^^^^^^^^^^^^ entity.other.inherited-class.scala
// ^ meta.bracket.scala

0 comments on commit 05a24a6

Please sign in to comment.