From 3334cafa4d30687d67a098024729a8f802737945 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Eidt?= Date: Mon, 2 May 2022 09:05:31 -0700 Subject: [PATCH] Update xml.cson Fix tm regex for XML comment <%-- --%>. The end rule key and the name key are in the scope of the captures key, but should be up one level in the comments patterns. The grammar file for xml in VS is "comments": { "patterns": [ { "begin": "<%--", "captures": { "0": { "name": "punctuation.definition.comment.xml" }, "end": "--%>", "name": "comment.block.xml" } but should be: "comments": { "patterns": [ { "begin": "<%--", "captures": { "0": { "name": "punctuation.definition.comment.xml" } }, "end": "--%>", "name": "comment.block.xml" }, Repro: Add the <%-- style comment patterns to a XML file. <%-- This comment and all following content is not syntax colored. --%> All following lines are not processed for syntax coloring because the end rule key is missing for the comments patterns. Test: With the fixed regex, the comment will be correctly syntax colored as well as all the following xml content. --- grammars/xml.cson | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/grammars/xml.cson b/grammars/xml.cson index be5fabd..dbac12d 100644 --- a/grammars/xml.cson +++ b/grammars/xml.cson @@ -406,8 +406,8 @@ 'captures': '0': 'name': 'punctuation.definition.comment.xml' - 'end': '--%>' - 'name': 'comment.block.xml' + 'end': '--%>' + 'name': 'comment.block.xml' } { 'begin': '