Skip to content

Commit

Permalink
Identify enum as a declaration
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolasstucki committed Jul 8, 2020
1 parent 77042c6 commit 55c670d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/typescript/Scala.tmLanguage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ export const scalaTmLanguage: TmLanguage = {
}
},
{
match: `\\b(?:(case|open)\\s+)?(class|object)\\s+([^\\s\\{\\(\\[;]+)(?<![^${opchar}]:)`,
match: `\\b(?:(case|open)\\s+)?(class|object|enum)\\s+([^\\s\\{\\(\\[;]+)(?<![^${opchar}]:)`,
captures: {
'1': {
name: 'keyword.declaration.scala'
Expand Down Expand Up @@ -816,7 +816,7 @@ export const scalaTmLanguage: TmLanguage = {
name: 'storage.modifier.access'
},
{
match: '\\b(synchronized|@volatile|abstract|final|lazy|sealed|implicit|enum|inline |opaque |override|@transient|@native)\\b',
match: '\\b(synchronized|@volatile|abstract|final|lazy|sealed|implicit|inline |opaque |override|@transient|@native)\\b',
name: 'storage.modifier.other'
}
]
Expand Down
8 changes: 4 additions & 4 deletions tests/unit/enum.test.scala
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
// SYNTAX TEST "source.scala"

enum Color:
// ^^^^ storage.modifier.other
// ^^^^ entity.name.class
// ^^^^ keyword.declaration.scala
// ^^^^^ entity.name.class.declaration
case Red, Green, Blue, Magenta
// ^^^^ keyword.control.flow.scala
// ^^^^^ entity.name.class
// ^^^^ entity.name.class
// ^^^^^^^ entity.name.class

enum Vehicle(val numberOfWheels: Int):
// ^^^^ storage.modifier.other
// ^^^^^^^ entity.name.class
// ^^^^ keyword.declaration.scala
// ^^^^^^^ entity.name.class.declaration
// ^^^ keyword.declaration.stable.scala
// ^^^^^^^^^^^^^^ variable.other.declaration.scala
// ^^^ entity.name.class
Expand Down

0 comments on commit 55c670d

Please sign in to comment.