Skip to content

Commit

Permalink
Update the Enso grammar in the VS Code extension (#7625)
Browse files Browse the repository at this point in the history
Following up on #7539 which introduced great improvements to the Enso grammar, I add some more to try to make it even better.

- Changing to highlight `self` instead of `this` (as the keyword was renamed a long time ago).
- Trying to include the string quotes to be highlighted as part of the string - a bit more controversial but IMO it looks more consistent with simple literals.

Before:
![image](https://github.com/enso-org/enso/assets/1436948/7d455c22-042a-4b43-a603-d661190aa7a4)

After:
![image](https://github.com/enso-org/enso/assets/1436948/5bfab6c0-ad67-4302-b5d3-0ef2fce232a9)
  • Loading branch information
radeusgd authored Aug 22, 2023
1 parent 5dc2c4c commit d078a37
Showing 1 changed file with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"keywords": {
"patterns": [{
"name": "keyword.other",
"match": "\\b(here|this|type)\\b"
"match": "\\b(self|type)\\b"
}, {
"name": "keyword.control",
"match": "\\b(case|of|if|then|else)\\b"
Expand Down Expand Up @@ -88,12 +88,22 @@
{
"contentName": "string.quoted.triple.begin",
"begin": "^(\\s*)(\"\"\"|''')",
"end": "^(?!\\1\\s+)(?!\\s*$)"
"end": "^(?!\\1\\s+)(?!\\s*$)",
"beginCaptures": {
"2": {
"name": "string.quoted.triple.begin"
}
}
},
{
"contentName": "string.quoted.triple.middle",
"begin": "^(\\s*)[^\\s].*(\"\"\"|''')",
"end": "^(?!\\1\\s+)(?!\\s*$)"
"end": "^(?!\\1\\s+)(?!\\s*$)",
"beginCaptures": {
"2": {
"name": "string.quoted.triple.begin"
}
}
},
{
"name": "string.quoted.single",
Expand Down

0 comments on commit d078a37

Please sign in to comment.