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

Syntax Coloring Stops working if 2d array is hit that is split across lines. #510

Closed tmaslach closed 4 years ago

tmaslach commented 4 years ago

Checklist

It really does look like it is only broken for C++!

The code with a problem is:

// comment1 - nice and green
int ItIsAReallyLongVariableNameWith[A_REALLY_LONG_CONSTANT_NAME_HERE]
                                   [AND_A_REALLY_LONG_CONSTANT_NAME_HERE];

// comment2 - it's unfortunately white and everything below as well
typedef const int OtherStuff;

class Test
{
};

It looks like:

The default Vscode theme is being used. image

It should look like:

Moving the 2d array to be on one line completely fixes the problem. Unfortunately, I need it split on 2 due to formatting requirements. image

jeff-hykin commented 4 years ago

Are you using the latest version of the extension? It works for me

Screen Shot 2020-10-18 at 9 45 22 PM

tmaslach commented 4 years ago

Hi Jeff - I am using VS Code version 1.50.1 .. My understanding is that I don't need any extension here, as your functionality is baked into VSCode itself, right?

I have also disabled all extensions and my VSCode is pretty much the default settings on the machine I am right now using. And it is still showing the problem.

I assume the extension of your file is .cpp? Figured I'd ask, just in case.. If there are any other settings I should try tweaking, just let me know .. Thanks!

jeff-hykin commented 4 years ago

Sorry for the delay.

The extension will get you the fix immediately, since it contains the latest version. Once the version in the extension has been tested for awhile, then it gets merged into VS Code. I'm not sure what the timeline is (how often they update it).

And yes the the file extension is .cpp 👍

tmaslach commented 4 years ago

That did the trick - thanks!