Closed ssrmm closed 7 years ago
I fixed this issue in my own implementation of the grammar by adding an include #comments
in the type-declaration
pattern:
Before:
{
begin: ":"
end: "(?={|where)"
patterns: [
{
include: "#type"
}
{
match: "([\\w<>]+)\\s*"
captures:
"1":
name: "storage.type.cs"
}
]
}
After:
{
begin: ":"
end: "(?={|where)"
patterns: [
{
include: "#type"
}
{
match: "([\\w<>]+)\\s*"
captures:
"1":
name: "storage.type.cs"
}
{
include: "#comments"
}
]
}
I haven't got time to do my own pull request right now. Will do when I get a chance, if no one picks it up before.
Thanks @tomchkk - While testing your change I also noticed another place. Comments can technically appear anywhere and that really messes up the grammar system as it's based on pattern matching using regexes rather than a traditional parser structure so we might not be able to support them everywhere - thankfully in these two cases it works just fine :)
Prerequisites
I'm not actually using Aton, but rather found this issue through the Github syntax highlighter, which directed me here. As such some of the below doesn't quiet apply to my case and I've only done the points that seemed reasonable to me and removed the other ones from the list
Description
Comments are not highlighted correctly when they start behind the first line of a class definition that implements an interface.
Steps to Reproduce
2 Check syntax highlighting
Expected behavior: The comment on the first line should be highlighted in grey.
Actual behavior:
Reproduces how often: Always
Versions
Not using Atom at all (see Prequisities). Happens on Github issues.