Skip to content

Commit f9ea511

Browse files
committed
Handle names ending with symbolic characters
Fixes #202
1 parent 0e4f065 commit f9ea511

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

src/typescript/Scala.tmLanguage.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -645,7 +645,7 @@ export const scalaTmLanguage: TmLanguage = {
645645
name: 'keyword.operator.arithmetic.scala'
646646
},
647647
{
648-
match: `(?<!${opchar})(!|&&|\\|\\|)(?!${opchar})`,
648+
match: `(?<!${opchar}|_)(!|&&|\\|\\|)(?!${opchar})`,
649649
name: 'keyword.operator.logical.scala'
650650
},
651651
{
@@ -921,7 +921,7 @@ export const scalaTmLanguage: TmLanguage = {
921921
comment: 'For themes: Brackets look nice when colored.'
922922
},
923923
qualifiedClassName: {
924-
match: '(\\b([A-Z][\\w]*))',
924+
match: `(\\b([A-Z][\\w]*)(?:(?<=_)${opchar}+)?)`,
925925
captures: {
926926
'1': {
927927
name: 'entity.name.class'

tests/unit/#202.test.scala

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// SYNTAX TEST "source.scala"
2+
3+
defn.Any_!
4+
// ^^^^^ entity.name.class
5+
// ^^^^^ - keyword.operator.logical.scala
6+
7+
defn.any_!
8+
// ^^^^^ - keyword.operator.logical.scala
9+
10+
def any_!:
11+
// ^^^^^ entity.name.function.declaration
12+
// ^^^^^ - keyword.operator.logical.scala

0 commit comments

Comments
 (0)