jeff-hykin / better-cpp-syntax

💾 The source of VS Code's C++ syntax highlighting
GNU General Public License v3.0
155 stars 30 forks source link

[C++] "struct foo::bar baz" confuses syntax highlighter #471

Closed alexr00 closed 4 months ago

alexr00 commented 4 years ago

Originally from @tbm0 in https://github.com/microsoft/vscode/issues/95834

Checklist

The code with a problem is:

void test() {
    struct foo::bar baz;
    if (bar(baz,
            "%u;%ld",
            false);) {

    }
}

It looks like:

https://user-images.githubusercontent.com/658101/79951062-54b03f00-8478-11ea-9e4f-908f36524509.png

It should look like:

struct foo::bar baz confuses the C++ syntax hilighter.

Removing the "struct" prefix fixes things. It is redundant but it should still be OK to have. This worked alright in previous vscode versions. Reproduced with all extensions disabled.

VS Code version: Code 1.44.2 (ff91584, 2020-04-16T17:50:03.709Z) OS version: Linux x64 5.3.0-46-generic Remote OS version: Linux x64 5.3.0-40-generic

jeff-hykin commented 4 months ago

fixed