Skip to content

Commit

Permalink
fix: update core tag names to include Marko 6 tags (#307)
Browse files Browse the repository at this point in the history
* fix: update core tag names to include Marko 6 tags
  • Loading branch information
DylanPiercey authored Dec 4, 2024
1 parent a31807c commit 38b62ec
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 3 deletions.
8 changes: 8 additions & 0 deletions .changeset/bright-hotels-boil.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"@marko/language-tools": patch
"marko-vscode": patch
"@marko/language-server": patch
"@marko/type-check": patch
---

Update core tag names to align with Marko 6.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const linkedAttrs: Map<string, Set<string>> = new Map([
"img",
"input",
"script",
"html-script",
"source",
"track",
"video",
Expand Down
9 changes: 9 additions & 0 deletions packages/language-tools/src/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -536,9 +536,18 @@ class Builder {
case "source":
case "track":
case "wbr":
case "const":
case "debug":
case "id":
case "let":
case "lifecycle":
case "log":
case "return":
bodyType = TagType.void;
break;
case "html-comment":
case "html-script":
case "html-style":
case "script":
case "textarea":
bodyType = TagType.text;
Expand Down
6 changes: 3 additions & 3 deletions packages/vscode/syntaxes/marko.tmLanguage.json
Original file line number Diff line number Diff line change
Expand Up @@ -811,7 +811,7 @@
"patterns": [
{
"comment": "HTML void elements",
"begin": "\\s*(<)(?=(area|base|br|col|embed|hr|img|input|link|meta|param|source|track|wbr)\\b)",
"begin": "\\s*(<)(?=(area|base|br|col|embed|hr|img|input|link|meta|param|source|track|wbr|const|debug|id|let|lifecycle|log|return)\\b)",
"end": "/?>",
"patterns": [{ "include": "#open-tag-content" }],
"beginCaptures": {
Expand Down Expand Up @@ -1083,15 +1083,15 @@
"patterns": [
{
"name": "support.type.builtin.marko",
"match": "(attrs|style|effect|lifecycle)(?=\\b)(?![-:@])"
"match": "(script|style|html-script|html-style|html-comment)(?=\\b)(?![-:@])"
},
{
"name": "keyword.control.flow.marko",
"match": "(for|if|while|else-if|else|try|await|return)(?=\\b)(?![-:@])"
},
{
"name": "support.function.marko",
"match": "(macro|tag|async|let|const|context|id|html-comment)(?=\\b)(?![-:@])"
"match": "(const|context|debug|define|id|let|log|lifecycle)(?=\\b)(?![-:@])"
},
{
"comment": "Attribute tag.",
Expand Down

0 comments on commit 38b62ec

Please sign in to comment.