Skip to content

Commit

Permalink
feat: add support for Go comments in templ files, fixes a-h/templ#233
Browse files Browse the repository at this point in the history
  • Loading branch information
a-h committed Oct 14, 2023
1 parent 5b1473c commit 09e01f3
Showing 1 changed file with 32 additions and 1 deletion.
33 changes: 32 additions & 1 deletion syntaxes/templ.tmLanguage.json
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,12 @@
{
"include": "#html-comment"
},
{
"include": "#go-comment-block"
},
{
"include": "#go-comment-double-slash"
},
{
"include": "#sgml"
},
Expand Down Expand Up @@ -486,6 +492,31 @@
}
]
},
"go-comment-block": {
"name": "comment.block.go",
"begin": "(\\/\\*)",
"beginCaptures": {
"1": {
"name": "punctuation.definition.comment.go"
}
},
"end": "(\\*\\/)",
"endCaptures": {
"1": {
"name": "punctuation.definition.comment.go"
}
}
},
"go-comment-double-slash": {
"name": "comment.line.double-slash.go",
"begin": "(\\/\\/)",
"beginCaptures": {
"1": {
"name": "punctuation.definition.comment.go"
}
},
"end": "(?:\\n|$)"
},
"html-comment": {
"begin": "<!--",
"end": "-->",
Expand Down Expand Up @@ -734,4 +765,4 @@
]
}
}
}
}

0 comments on commit 09e01f3

Please sign in to comment.