Skip to content

Grammar parser does not correctly recognize pug rule #82

@alexr00

Description

@alexr00

Simple example:

li:	custom-link.has-text-primary(to="/")

Grammar is here: https://github.com/davidrios/pug-tmbundle

The li is correctly categorized as entity.name.tag.pug. custom-link is incorrectly categorized as text.pug If you copy the same grammar into a different editor and use their text mate engine, custom-link is correctly categorized as entity.name.tag.pug.

In the grammar, this is the rule that is not getting applied correctly:

            "tag_name": {
			"begin": "([#!]\\{(?=.*?\\}))|(\\w(([\\w:-]+[\\w-])|([\\w-]*)))",
			"end": "(\\G(?<!\\5[^\\w-]))|\\}|$",
			"name": "meta.tag.other entity.name.tag.pug",
			"patterns": [
				{
					"begin": "\\G(?<=\\{)",
					"end": "(?=\\})",
					"name": "meta.tag.other entity.name.tag.pug",
					"patterns": [
						{
							"match": "{",
							"name": "invalid.illegal.tag.pug"
						},
						{
							"include": "source.js"
						}
					]
				}
			]
		},

Originally found in microsoft/vscode#65983

Metadata

Metadata

Assignees

Labels

bugIssue identified by VS Code Team member as probable bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions