Skip to content
This repository has been archived by the owner on Dec 13, 2018. It is now read-only.

Commit

Permalink
Fix xhp commenting syntax.
Browse files Browse the repository at this point in the history
Reviewed By: matthewwithanm

Differential Revision: D9978898

fbshipit-source-id: 01ece5bdac2c70ec8e742204b69b284627ec9b43
  • Loading branch information
hchau-fb authored and facebook-github-bot committed Sep 22, 2018
1 parent 3ea855d commit e659438
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/nuclide-language-hack/grammars/hack.cson
Expand Up @@ -2246,6 +2246,7 @@
},
"patterns": [
{ "include": "#xhp-tag-termination" },
{ "include": "#xhp-html-comments"},
{ "include": "#xhp-tag-attributes" }
]
}
Expand All @@ -2256,7 +2257,7 @@
{
"comment": "this matches the end > of an opening tag when in the form <tag> </tag>",
"comment": "uses non consuming search for </ in </tag>",
"begin": "(>)",
"begin": "(?<!--)(>)",
"end": "(</)",
"beginCaptures": {
"0": { "name": "punctuation.definition.tag.xhp" },
Expand Down
12 changes: 12 additions & 0 deletions pkg/nuclide-language-hack/spec/fixtures/syntax_test_xhp.php
Expand Up @@ -53,3 +53,15 @@ function exampleXHPBracketHighlighting() {
</Test>
)
}

function exampleXHPComments() {
return (
<ui:foo
<!--attr={'test'}-->
// ^ comment.block.html punctuation.definition.comment.html
/>
if (true) {
// ^ punctuation.section.scope.begin.php
}
)
}

0 comments on commit e659438

Please sign in to comment.