Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Update xml.cson #107

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Update xml.cson #107

wants to merge 1 commit into from

Conversation

jurgen178
Copy link

@jurgen178 jurgen178 commented May 2, 2022

Description of the Change

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.

Requirements

  • Filling out the template is required. Any pull request that does not include enough information to be reviewed in a timely manner may be closed at the maintainers' discretion.
  • All new code requires tests to ensure against regressions

Alternate Designs

Benefits

Possible Drawbacks

Applicable Issues

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.
@jurgen178
Copy link
Author

Looks like this issue is reported multiple times before.
#96
#106

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant