atom / language-csharp

C# language support for Atom
Other
62 stars 53 forks source link

C# - strings not highlighting correctly in classes #52

Closed lmntr closed 7 years ago

lmntr commented 8 years ago

There's a weird glitch in highlighting strings. If you have a string within a class and that string has a { anywhere in it and there's anything before the string other than =, ignoring @, then the highlighting doesn't pick up the opening " and starts highlighting at the end of the string instead, making the rest of the code appear to be within a string. Here's a small example of what I mean: error-example

It doesn't affect the program at all, but it gets really hard to read, especially if this happens at the top of the file.

jamesqo commented 8 years ago

Ran into this the other day with code that uses string.Format, here's an example.

I've also opened an issue at the VSCode repo about this, which uses this for the C# grammar: Microsoft/vscode#4725

damieng commented 7 years ago

Has been fixed in master and should ship in the next beta. Here's a screenshot of your code from there;

image