Skip to content

Commit

Permalink
Fix bug with // inside of a block comment
Browse files Browse the repository at this point in the history
  • Loading branch information
PanAeon committed Jun 26, 2019
1 parent efc7ab1 commit eef0470
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 24 deletions.
53 changes: 30 additions & 23 deletions src/typescript/Scala.tmLanguage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -651,6 +651,34 @@ export const scalaTmLanguage: TmLanguage = {
name: 'meta.bounds.scala'
},
comments: {
patterns: [
{
"include": "#block-comments"
},
{
end: '(?!\\G)',
begin: '(^[ \\t]+)?(?=//)',
beginCaptures: {
'1': {
name: 'punctuation.whitespace.comment.leading.scala'
}
},
patterns: [
{
end: '\\n',
begin: '//',
beginCaptures: {
'0': {
name: 'punctuation.definition.comment.scala'
}
},
name: 'comment.line.double-slash.scala'
}
]
}
]
},
'block-comments': {
patterns: [
{
match: '/\\*\\*/',
Expand Down Expand Up @@ -711,7 +739,7 @@ export const scalaTmLanguage: TmLanguage = {
}
},
{
"include": "#comments"
"include": "#block-comments"
}
],
endCaptures: {
Expand All @@ -731,32 +759,11 @@ export const scalaTmLanguage: TmLanguage = {
},
patterns: [
{
"include": "#comments"
"include": "#block-comments"
}
],
name: 'comment.block.scala'
},
{
end: '(?!\\G)',
begin: '(^[ \\t]+)?(?=//)',
beginCaptures: {
'1': {
name: 'punctuation.whitespace.comment.leading.scala'
}
},
patterns: [
{
end: '\\n',
begin: '//',
beginCaptures: {
'0': {
name: 'punctuation.definition.comment.scala'
}
},
name: 'comment.line.double-slash.scala'
}
]
}
]
},
'xml-embedded-content': {
Expand Down
Loading

0 comments on commit eef0470

Please sign in to comment.