Skip to content

Commit

Permalink
improvement: Highlight using directives without double quote
Browse files Browse the repository at this point in the history
Adds support for using directives without `"` like
//> using dep some::dependency:1.0.0
  • Loading branch information
jkciesluk committed Jul 11, 2023
1 parent 78750ed commit ffeefb2
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 9 deletions.
24 changes: 16 additions & 8 deletions src/typescript/Scala.tmLanguage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -998,29 +998,37 @@ export const scalaTmLanguage: TmLanguage = {
},
'using-directive': {
end: '\\n',
begin: '^\\s*(//>)\\s*(using)[^\\S\\n]+',
begin: '^\\s*(//>)\\s*(using)[^\\S\\n]+(?:(\\S+))?',
beginCaptures: {
'1': {
name: 'punctuation.definition.comment.scala'
},
'2': {
name: 'keyword.other.import.scala'
},
'3': {
patterns: [
{
match: `${idUpper}|${backQuotedId}|${plainid}`,
name: 'entity.name.import.scala'
},
{
match: '\\.',
name: 'punctuation.definition.import'
}
]
}
},
patterns: [
{
match: `${idUpper}|${backQuotedId}|${plainid}`,
name: 'entity.name.import.scala'
},
{
match: '\\.',
name: 'punctuation.definition.import'
include: '#constants'
},
{
include: '#strings'
},
{
include: '#constants'
match: `[^\\s,]+`,
name: 'string.quoted.double.scala'
},
],
name: 'comment.line.shebang.scala'
Expand Down
Loading

0 comments on commit ffeefb2

Please sign in to comment.