Created
June 6, 2019 13:08
-
-
Save olafurpg/125fc86cfb4d6a3728285411a5bdbcc2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/source.scala.json b/source.scala.json | |
index 1491594..9586413 100644 | |
--- a/source.scala.json | |
+++ b/source.scala.json | |
@@ -16,7 +16,7 @@ | |
"include": "#block-comments" | |
}, | |
{ | |
- "match": "(?x)\n\t\t\t(?! /\\*)\n\t\t\t(?! \\*/)\n\t\t " | |
+ "match": "(?x)(?! /\\*)(?! \\*/)" | |
} | |
] | |
}, | |
@@ -248,7 +248,7 @@ | |
"declarations": { | |
"patterns": [ | |
{ | |
- "match": "(?x)\n\t\t\t\t\t\t\\b(def)\\s+\n\t\t\t\t\t\t(`[^`]+`|[_$a-zA-Z][_$a-zA-Z0-9]*(?:_[^\\t .,;()\\[\\]{}'\"`\\w])(?=[(\\t ])|[_$a-zA-Z][_$a-zA-Z0-9]*|[-?~\u003e\u003c^+*%:!#|/@\\\\]+)", | |
+ "match": "(?x)\\b(def)\\s+(`[^`]+`|(?:[[A-Z\\p{Lt}\\p{Lu}][_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}]](?:[[A-Z\\p{Lt}\\p{Lu}][_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}]]|[0-9])*(?:(?\u003c=_)[!#%\u0026*+\\-\\/:\u003c\u003e=?@^|~[\\p{Sm}\\p{So}]]+)?|(?:[!#%\u0026*+\\-\\/:\u003c\u003e=?@^|~[\\p{Sm}\\p{So}]])+))", | |
"captures": { | |
"1": { | |
"name": "keyword.declaration.scala" | |
@@ -284,7 +284,7 @@ | |
} | |
}, | |
{ | |
- "match": "\\b(type)\\s+(`[^`]+`|[_$a-zA-Z][_$a-zA-Z0-9]*(?:_[^\\s])(?=[\\t ])|[_$a-zA-Z][_$a-zA-Z0-9]*|[-?~\u003e\u003c^+*%:!#|/@\\\\]+)", | |
+ "match": "\\b(type)\\s+(`[^`]+`|(?:[[A-Z\\p{Lt}\\p{Lu}][_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}]](?:[[A-Z\\p{Lt}\\p{Lu}][_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}]]|[0-9])*(?:(?\u003c=_)[!#%\u0026*+\\-\\/:\u003c\u003e=?@^|~[\\p{Sm}\\p{So}]]+)?|(?:[!#%\u0026*+\\-\\/:\u003c\u003e=?@^|~[\\p{Sm}\\p{So}]])+))", | |
"captures": { | |
"1": { | |
"name": "keyword.declaration.scala" | |
@@ -295,7 +295,7 @@ | |
} | |
}, | |
{ | |
- "match": "\\b(val)\\s+(?:([A-Z][_a-zA-Z0-9]*))\\b", | |
+ "match": "\\b(val)\\s+([A-Z\\p{Lt}\\p{Lu}](?:[[A-Z\\p{Lt}\\p{Lu}][_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}]]|[0-9])*(?:(?\u003c=_)[!#%\u0026*+\\-\\/:\u003c\u003e=?@^|~[\\p{Sm}\\p{So}]]+)?)\\b", | |
"captures": { | |
"1": { | |
"name": "keyword.declaration.stable.scala" | |
@@ -306,7 +306,7 @@ | |
} | |
}, | |
{ | |
- "match": "\\b(?:(val)|(var))\\s+(?:(`[^`]+`|[_$a-zA-Z][_$a-zA-Z0-9]*(?:_[^\\t .,;()\\[\\]{}'\"`\\w])(?=[\\t ])|[_$a-zA-Z][_$a-zA-Z0-9]*|[-?~\u003e\u003c^+*%:!#|/@\\\\]+)|(?=\\())", | |
+ "match": "\\b(?:(val)|(var))\\s+(?:(`[^`]+`|(?:[[A-Z\\p{Lt}\\p{Lu}][_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}]](?:[[A-Z\\p{Lt}\\p{Lu}][_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}]]|[0-9])*(?:(?\u003c=_)[!#%\u0026*+\\-\\/:\u003c\u003e=?@^|~[\\p{Sm}\\p{So}]]+)?|(?:[!#%\u0026*+\\-\\/:\u003c\u003e=?@^|~[\\p{Sm}\\p{So}]])+))|(?=\\())", | |
"captures": { | |
"1": { | |
"name": "keyword.declaration.stable.scala" | |
@@ -343,7 +343,7 @@ | |
}, | |
{ | |
"name": "entity.name.package.scala", | |
- "match": "(`[^`]+`|[_$a-zA-Z][_$a-zA-Z0-9]*)" | |
+ "match": "(`[^`]+`|(?:[[A-Z\\p{Lt}\\p{Lu}][_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}]](?:[[A-Z\\p{Lt}\\p{Lu}][_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}]]|[0-9])*(?:(?\u003c=_)[!#%\u0026*+\\-\\/:\u003c\u003e=?@^|~[\\p{Sm}\\p{So}]]+)?|(?:[!#%\u0026*+\\-\\/:\u003c\u003e=?@^|~[\\p{Sm}\\p{So}]])+))" | |
}, | |
{ | |
"name": "punctuation.definition.package", | |
@@ -377,7 +377,7 @@ | |
}, | |
{ | |
"name": "entity.name.import.scala", | |
- "match": "(`[^`]+`|[_$a-zA-Z][_$a-zA-Z0-9]*)" | |
+ "match": "(`[^`]+`|(?:[[A-Z\\p{Lt}\\p{Lu}][_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}]](?:[[A-Z\\p{Lt}\\p{Lu}][_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}]]|[0-9])*(?:(?\u003c=_)[!#%\u0026*+\\-\\/:\u003c\u003e=?@^|~[\\p{Sm}\\p{So}]]+)?|(?:[!#%\u0026*+\\-\\/:\u003c\u003e=?@^|~[\\p{Sm}\\p{So}]])+))" | |
}, | |
{ | |
"name": "punctuation.definition.import", | |
@@ -389,7 +389,7 @@ | |
"end": "}", | |
"patterns": [ | |
{ | |
- "match": "(?x) \\s*\n\t\t\t\t (`[^`]+`|[_$a-zA-Z][_$a-zA-Z0-9]*) \\s*\n\t\t\t\t (=\u003e) \\s*\n\t\t\t\t (`[^`]+`|[_$a-zA-Z][_$a-zA-Z0-9]*) \\s*\n\t\t\t ", | |
+ "match": "(?x)\\s*(`[^`]+`|(?:[[A-Z\\p{Lt}\\p{Lu}][_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}]](?:[[A-Z\\p{Lt}\\p{Lu}][_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}]]|[0-9])*(?:(?\u003c=_)[!#%\u0026*+\\-\\/:\u003c\u003e=?@^|~[\\p{Sm}\\p{So}]]+)?|(?:[!#%\u0026*+\\-\\/:\u003c\u003e=?@^|~[\\p{Sm}\\p{So}]])+))\\s*(=\u003e)\\s*(`[^`]+`|(?:[[A-Z\\p{Lt}\\p{Lu}][_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}]](?:[[A-Z\\p{Lt}\\p{Lu}][_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}]]|[0-9])*(?:(?\u003c=_)[!#%\u0026*+\\-\\/:\u003c\u003e=?@^|~[\\p{Sm}\\p{So}]]+)?|(?:[!#%\u0026*+\\-\\/:\u003c\u003e=?@^|~[\\p{Sm}\\p{So}]])+))\\s*", | |
"captures": { | |
"1": { | |
"name": "entity.name.import.renamed-from.scala" | |
@@ -518,7 +518,7 @@ | |
"parameter-list": { | |
"patterns": [ | |
{ | |
- "match": "(?\u003c=[^\\._$a-zA-Z0-9])(`[^`]+`|[_$a-z][_$a-zA-Z0-9]*(?:_[^\\s])(?=[\\t ])|[_$a-z][_$a-zA-Z0-9]*|[-?~\u003e\u003c^+*%:!#|/@\\\\]+)\\s*(:)\\s+", | |
+ "match": "(?\u003c=[^\\._$a-zA-Z0-9])(`[^`]+`|[_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}](?:[[A-Z\\p{Lt}\\p{Lu}][_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}]]|[0-9])*(?:(?\u003c=_)[!#%\u0026*+\\-\\/:\u003c\u003e=?@^|~[\\p{Sm}\\p{So}]]+)?)\\s*(:)\\s+", | |
"captures": { | |
"1": { | |
"name": "variable.parameter.scala" | |
@@ -544,7 +544,7 @@ | |
}, | |
"scala-symbol": { | |
"name": "constant.other.symbol.scala", | |
- "match": "'\\w+(?=[^'\\w]|$)" | |
+ "match": "(?\u003e'(?:[[A-Z\\p{Lt}\\p{Lu}][_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}]](?:[[A-Z\\p{Lt}\\p{Lu}][_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}]]|[0-9])*(?:(?\u003c=_)[!#%\u0026*+\\-\\/:\u003c\u003e=?@^|~[\\p{Sm}\\p{So}]]+)?|(?:[!#%\u0026*+\\-\\/:\u003c\u003e=?@^|~[\\p{Sm}\\p{So}]])+))(?!')" | |
}, | |
"script-header": { | |
"name": "comment.block.shebang.scala", | |
@@ -570,6 +570,42 @@ | |
} | |
] | |
}, | |
+ "string-interpolation": { | |
+ "patterns": [ | |
+ { | |
+ "name": "constant.character.escape.interpolation.scala", | |
+ "match": "\\$\\$" | |
+ }, | |
+ { | |
+ "match": "(\\$)([[A-Z\\p{Lt}\\p{Lu}][_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}]](?:[[A-Z\\p{Lt}\\p{Lu}][_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}]]|[0-9])*)", | |
+ "captures": { | |
+ "1": { | |
+ "name": "punctuation.definition.template-expression.begin.scala" | |
+ } | |
+ } | |
+ }, | |
+ { | |
+ "name": "punctuation.definition.template-expression.scala", | |
+ "begin": "\\$\\{", | |
+ "end": "\\}", | |
+ "patterns": [ | |
+ { | |
+ "include": "#code" | |
+ } | |
+ ], | |
+ "beginCaptures": { | |
+ "0": { | |
+ "name": "punctuation.definition.template-expression.begin.scala" | |
+ } | |
+ }, | |
+ "endCaptures": { | |
+ "0": { | |
+ "name": "punctuation.definition.template-expression.end.scala" | |
+ } | |
+ } | |
+ } | |
+ ] | |
+ }, | |
"strings": { | |
"patterns": [ | |
{ | |
@@ -593,6 +629,36 @@ | |
} | |
} | |
}, | |
+ { | |
+ "begin": "\\b([[A-Z\\p{Lt}\\p{Lu}][_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}]]+)(\"\"\")", | |
+ "end": "\"\"\"(?!\")", | |
+ "patterns": [ | |
+ { | |
+ "include": "#string-interpolation" | |
+ }, | |
+ { | |
+ "name": "constant.character.escape.scala", | |
+ "match": "\\\\\\\\|\\\\u[0-9A-Fa-f]{4}" | |
+ }, | |
+ { | |
+ "name": "string.quoted.triple.interpolated.scala", | |
+ "match": "." | |
+ } | |
+ ], | |
+ "beginCaptures": { | |
+ "1": { | |
+ "name": "keyword.interpolation.scala" | |
+ }, | |
+ "2": { | |
+ "name": "string.quoted.triple.interpolated.scala punctuation.definition.string.begin.scala" | |
+ } | |
+ }, | |
+ "endCaptures": { | |
+ "0": { | |
+ "name": "string.quoted.triple.interpolated.scala punctuation.definition.string.end.scala" | |
+ } | |
+ } | |
+ }, | |
{ | |
"name": "string.quoted.double.scala", | |
"begin": "\"", | |
@@ -617,6 +683,40 @@ | |
"name": "punctuation.definition.string.end.scala" | |
} | |
} | |
+ }, | |
+ { | |
+ "begin": "\\b([[A-Z\\p{Lt}\\p{Lu}][_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}]]+)(\")", | |
+ "end": "\"", | |
+ "patterns": [ | |
+ { | |
+ "include": "#string-interpolation" | |
+ }, | |
+ { | |
+ "name": "constant.character.escape.scala", | |
+ "match": "\\\\(?:[btnfr\\\\\"']|[0-7]{1,3}|u[0-9A-Fa-f]{4})" | |
+ }, | |
+ { | |
+ "name": "invalid.illegal.unrecognized-string-escape.scala", | |
+ "match": "\\\\." | |
+ }, | |
+ { | |
+ "name": "string.quoted.double.interpolated.scala", | |
+ "match": "." | |
+ } | |
+ ], | |
+ "beginCaptures": { | |
+ "1": { | |
+ "name": "keyword.interpolation.scala" | |
+ }, | |
+ "2": { | |
+ "name": "string.quoted.double.interpolated.scala punctuation.definition.string.begin.scala" | |
+ } | |
+ }, | |
+ "endCaptures": { | |
+ "0": { | |
+ "name": "string.quoted.double.interpolated.scala punctuation.definition.string.end.scala" | |
+ } | |
+ } | |
} | |
] | |
}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment