Skip to content

Commit cca0543

Browse files
authored
Merge pull request #257 from jkciesluk/fix-using-directive
improvement: Highlight using directives without double quote
2 parents 5666a62 + ffeefb2 commit cca0543

File tree

4 files changed

+72
-9
lines changed

4 files changed

+72
-9
lines changed

Diff for: src/typescript/Scala.tmLanguage.ts

+16-8
Original file line numberDiff line numberDiff line change
@@ -998,29 +998,37 @@ export const scalaTmLanguage: TmLanguage = {
998998
},
999999
'using-directive': {
10001000
end: '\\n',
1001-
begin: '^\\s*(//>)\\s*(using)[^\\S\\n]+',
1001+
begin: '^\\s*(//>)\\s*(using)[^\\S\\n]+(?:(\\S+))?',
10021002
beginCaptures: {
10031003
'1': {
10041004
name: 'punctuation.definition.comment.scala'
10051005
},
10061006
'2': {
10071007
name: 'keyword.other.import.scala'
1008+
},
1009+
'3': {
1010+
patterns: [
1011+
{
1012+
match: `${idUpper}|${backQuotedId}|${plainid}`,
1013+
name: 'entity.name.import.scala'
1014+
},
1015+
{
1016+
match: '\\.',
1017+
name: 'punctuation.definition.import'
1018+
}
1019+
]
10081020
}
10091021
},
10101022
patterns: [
10111023
{
1012-
match: `${idUpper}|${backQuotedId}|${plainid}`,
1013-
name: 'entity.name.import.scala'
1014-
},
1015-
{
1016-
match: '\\.',
1017-
name: 'punctuation.definition.import'
1024+
include: '#constants'
10181025
},
10191026
{
10201027
include: '#strings'
10211028
},
10221029
{
1023-
include: '#constants'
1030+
match: `[^\\s,]+`,
1031+
name: 'string.quoted.double.scala'
10241032
},
10251033
],
10261034
name: 'comment.line.shebang.scala'

0 commit comments

Comments
 (0)