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

String literals aren't handled correctly with this sample C++ code #551

Closed sean-mcmanus closed 4 months ago

sean-mcmanus commented 3 years ago

Checklist

The code with a problem is:

#define A
struct foo
{
    /*d*/ void func(const char* c)
    {
        #ifdef FOO
            int i;
        #else
            func("" A ")");
        #endif
    }
};

It looks like:

image

It should look like:

image

Originally reported at https://github.com/microsoft/vscode-cpptools/discussions/7627

jeff-hykin commented 3 years ago

This one is going to be tough to fix correctly

As with all things, there might be a hacky solution I'm not thinking of.

jeff-hykin commented 4 months ago

fixed with a hacky solution (not sure when)