Skip to content

Commit f6a9a8f

Browse files
authored
Merge pull request #48 from scala/support-then-and-end
Fix #47: Support `then` keyword and `end` soft keyword
2 parents 1ed0182 + 6525f7d commit f6a9a8f

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/typescript/Scala.tmLanguage.ts

+6-2
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)