Skip to content

Commit

Permalink
improvement: Show named bounds properly
Browse files Browse the repository at this point in the history
  • Loading branch information
tgodzik committed Jan 13, 2025
1 parent a88f1ae commit d25e5ec
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 1 deletion.
18 changes: 18 additions & 0 deletions src/typescript/Scala.tmLanguage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,9 @@ export const scalaTmLanguage: TmLanguage = {
{
include: '#xml-literal'
},
{
include: '#namedBounds'
},
{
include: '#keywords'
},
Expand Down Expand Up @@ -1018,6 +1021,21 @@ export const scalaTmLanguage: TmLanguage = {
],
comment: 'For themes: Brackets look nice when colored.'
},
namedBounds: {
patterns: [
{
match: `\\s+(as)\\s+(${idLower})\\b`,
captures: {
'1': {
name: 'keyword.other.import.as.scala'
},
'2': {
name: 'variable.stable.declaration.scala'
}
}
}
]
},
qualifiedClassName: {
match: `(\\b([A-Z][\\w]*)(?:(?<=_)${opchar}+)?)`,
captures: {
Expand Down
Loading

0 comments on commit d25e5ec

Please sign in to comment.