Text Coloring Suddenly Changed in C


#1

In the above image, the text coloring on the left is what I am used to seeing until recently everything switched to the coloring scheme on the right. If you look closely, the text editor is no longer distinguishing between built-in C functions and those I created. In addition (and this is not visible in the screenshot above) I found earlier that certain operands are not being highlighted for some reason. At first, I thought this was some sort of styling issue, but regardless of what styling pack I use, these problems remain consistent. I’m starting to think it might be an issue with the language pack (or perhaps an update of it – one which I don’t care for). I can fix the issue by reinstalling Atom with my old installer file, but it returns later (hence why I think it could just be an update that is causing it).

Any insight would be appreciated. Thanks!


#2

You can go to Settings and scroll down to Use Tree Sitter Parsers and uncheck it. That will probably fix your issue.

If it works, here’s the explanation: tree-sitter is a new piece of software for highlighting source code based on a semantically meaningful tree representation of the code, which is better able to distinguish parts of code than the original regular expression technique. In some cases, the new text coloring is because the grammar being used is of better quality than the old one; in others, it’s because the syntax theme hasn’t been updated to properly portray the new grammar. My personal preference is to adapt to the changes, because they will on net be more context-aware and useful than the old way of doing things, even if our perception of the colors are thrown off for a time. At the moment (and I don’t see why this wouldn’t be true indefinitely), we have the ability to choose.


#3

That is exactly what it was and your response was both thoughtful and informative. Now that I know for certain that this isn’t an issue with corruption of the language pack or something to that extent, I will give this new scheme a try. Hopefully, I will adapt to the changes and, as you said, the new coloring will be useful.

Thank you for your help!


#4

I hope the Atom team has learned from this. Obviously the transition to tree-sitter was premature or at least should have been communicated better.