Skip to content

Commit b412c9d

Browse files
committed
improvement: Show named bounds properly
1 parent a88f1ae commit b412c9d

File tree

3 files changed

+53
-1
lines changed

3 files changed

+53
-1
lines changed

src/typescript/Scala.tmLanguage.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,9 @@ export const scalaTmLanguage: TmLanguage = {
297297
{
298298
include: '#xml-literal'
299299
},
300+
{
301+
include: '#namedBounds'
302+
},
300303
{
301304
include: '#keywords'
302305
},
@@ -1018,6 +1021,27 @@ export const scalaTmLanguage: TmLanguage = {
10181021
],
10191022
comment: 'For themes: Brackets look nice when colored.'
10201023
},
1024+
namedBounds: {
1025+
patterns: [
1026+
{
1027+
match: `\\s*([\\:])\\s*(${idUpper})\\s+(as)\\s+(${idLower})\\b`,
1028+
captures: {
1029+
'1': {
1030+
name: 'keyword.operator.scala'
1031+
},
1032+
'2': {
1033+
name: 'entity.name.class'
1034+
},
1035+
'3': {
1036+
name: 'keyword.other.import.as.scala'
1037+
},
1038+
'4': {
1039+
name: 'entity.name.declaration'
1040+
}
1041+
}
1042+
}
1043+
]
1044+
},
10211045
qualifiedClassName: {
10221046
match: `(\\b([A-Z][\\w]*)(?:(?<=_)${opchar}+)?)`,
10231047
captures: {

0 commit comments

Comments
 (0)