Skip to content

Commit

Permalink
Handle names ending with symbolic characters
Browse files Browse the repository at this point in the history
Fixes #202
  • Loading branch information
nicolasstucki committed Aug 16, 2021
1 parent 0e4f065 commit f9ea511
Show file tree
Hide file tree
Showing 2 changed files with 14 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 @@ -645,7 +645,7 @@ export const scalaTmLanguage: TmLanguage = {
name: 'keyword.operator.arithmetic.scala'
},
{
match: `(?<!${opchar})(!|&&|\\|\\|)(?!${opchar})`,
match: `(?<!${opchar}|_)(!|&&|\\|\\|)(?!${opchar})`,
name: 'keyword.operator.logical.scala'
},
{
Expand Down Expand Up @@ -921,7 +921,7 @@ export const scalaTmLanguage: TmLanguage = {
comment: 'For themes: Brackets look nice when colored.'
},
qualifiedClassName: {
match: '(\\b([A-Z][\\w]*))',
match: `(\\b([A-Z][\\w]*)(?:(?<=_)${opchar}+)?)`,
captures: {
'1': {
name: 'entity.name.class'
Expand Down
12 changes: 12 additions & 0 deletions tests/unit/#202.test.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// SYNTAX TEST "source.scala"

defn.Any_!
// ^^^^^ entity.name.class
// ^^^^^ - keyword.operator.logical.scala

defn.any_!
// ^^^^^ - keyword.operator.logical.scala

def any_!:
// ^^^^^ entity.name.function.declaration
// ^^^^^ - keyword.operator.logical.scala

0 comments on commit f9ea511

Please sign in to comment.