Skip to content

Commit

Permalink
chore: update js comment syntax highlighting
Browse files Browse the repository at this point in the history
  • Loading branch information
DylanPiercey committed Aug 2, 2022
1 parent 7106de4 commit 3041a4e
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 11 deletions.
6 changes: 6 additions & 0 deletions .changeset/gorgeous-icons-own.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"marko-vscode": patch
"@marko/language-server": patch
---

Improve syntax highlighting for JS style comments in html blocks.
23 changes: 21 additions & 2 deletions clients/vscode/syntaxes/marko.tmLanguage.json
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@
{ "include": "#cdata" },
{ "include": "#doctype" },
{ "include": "#declaration" },
{ "include": "#javascript-comments" },
{ "include": "#javascript-comments-after-whitespace" },
{ "include": "#html-comment" },
{ "include": "#tag-html" },
{
Expand Down Expand Up @@ -505,7 +505,7 @@
{ "include": "#cdata" },
{ "include": "#doctype" },
{ "include": "#declaration" },
{ "include": "#javascript-comments" },
{ "include": "#javascript-comments-after-whitespace" },
{ "include": "#html-comment" },
{ "include": "#invalid-close-tag" },
{ "include": "#tag-html" },
Expand Down Expand Up @@ -630,6 +630,25 @@
}
]
},
"javascript-comments-after-whitespace": {
"patterns": [
{
"comment": "JavaScript /* block comment */",
"contentName": "source.ts",
"begin": "(?:^|\\s+)(?=/\\*)",
"end": "(?<=\\*/)",
"patterns": [{ "include": "source.ts" }]
},
{
"comment": "JavaScript // single line comment",
"contentName": "source.ts",
"match": "(?:^|\\s+)//.*$",
"captures": {
"0": { "patterns": [{ "include": "source.ts" }] }
}
}
]
},
"javascript-expression": {
"comment": "Matches JavaScript source code, but always continues for certain types of expressions.",
"patterns": [
Expand Down
16 changes: 8 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"@marko/babel-utils": "^5.21.2",
"@marko/compiler": "^5.22.2",
"@marko/translator-default": "^5.21.4",
"htmljs-parser": "^5.1.0",
"htmljs-parser": "^5.1.1",
"lasso-package-root": "^1.0.1",
"marko": "^5.21.5",
"prettier": "^2.7.1",
Expand Down

0 comments on commit 3041a4e

Please sign in to comment.