Skip to content

Commit 6525f7d

Browse files
committed
Fix #47: Support then keyword and end soft keyword
1 parent 1ed0182 commit 6525f7d

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/typescript/Scala.tmLanguage.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -389,9 +389,13 @@ export const scalaTmLanguage: TmLanguage = {
389389
name: 'support.function.type-of.scala'
390390
},
391391
{
392-
match: '\\b(else|if|do|while|for|yield|match|case)\\b',
392+
match: '\\b(else|if|then|do|while|for|yield|match|case)\\b',
393393
name: 'keyword.control.flow.scala'
394394
},
395+
{
396+
match: `^\\s*end(?=\\s+(if|while|for|match|${plainid})\\s*(//.*|/\\*(?!.*\\*/\\s*\\S.*).*)?$)`,
397+
name: 'keyword.control.flow.end.scala'
398+
},
395399
{
396400
match: '\\b(catch|finally|try)\\b',
397401
name: 'keyword.control.exception.scala'
@@ -631,7 +635,7 @@ export const scalaTmLanguage: TmLanguage = {
631635
// capture back quoted variables in code so special symbols inside them do not
632636
// interfere with the rest of the rules. But don't assign any extra scope, to make them
633637
// consistent with the rest of variables
634-
match: `${backQuotedId}`
638+
match: `${backQuotedId}`
635639
},
636640
'storage-modifiers': {
637641
patterns: [

0 commit comments

Comments
 (0)