Skip to content

Comment containing the word "event" after property breaks the rest of the file #115

Closed

Description

@michaelblyons

Details

VS Code 1.23.0
C# for VS Code 1.14.0

Repro

public class Foo
{
    // The word "event" in the comment below breaks highlighting in the rest
    // of the file.  Adding or removing any characters in "event" such that
    // it no longer matches \bevent\b will restore highlighting.
    public string Bar { get; set; } // comment comment event comment
    public string Baz { get; set; }
}

Activity

  1. DustinCampbell commented on May 9, 2018

    @DustinCampbell
    Member

    Thanks for taking the time to file this issue! This is another case of #75.

  2. DustinCampbell commented on May 14, 2018

    @DustinCampbell
    Member

    It may in fact be a challenge with the property pattern. I'll take a look.

    Note that excluding comments from rules results in comments not being highlighted at all.

    The reality is that regular expressions are a terrible way to syntax highlight a language. 😄

  3. DustinCampbell commented on May 14, 2018

    @DustinCampbell
    Member

    It looks like the rule that's causing this behavior is right here: https://github.com/dotnet/csharp-tmLanguage/blob/master/src/csharp.tmLanguage.yml#L492. Commenting that fixes the issue, but introduces others.

  4. DustinCampbell commented on May 14, 2018

    @DustinCampbell
    Member

    No problem. It was your comment about it being an issue for properties but not for fields that led me to the problematic rule. 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions