News for hackers. Stuff that matters.
Re:Tree Sitter and the Complications of Parsing Languages by mst on Wednesday November 24, 2021 @04:23AM (#29328284)
While I'm aware that OP and I are in a minority - there is a cognitive overhead to having that information surfaced at all times when you may be trying to focus on something at e.g. the method level rather than the individual syntactic element level, and if that cognitive overhead exceeds the utility of having that information available, the sensible answer is to turn the highlighting off.

If I could have some sort of focus follows mind where highlighting automatically happens commensurate to what level of granularity I'm currently thinking about the code at I would be extremely interested, but absent "focus follows mind" it's a trade-off that everybody has to make for themselves.

Some people prefer to highlight almost everything, some almost nothing, some people find it helpful for some languages/tasks but not for others.

It's similar IME to the extent to which preferred debugging styles (printf versus interactive versus hybrid versus situational choices) are also something people have to figure out, and, well, different people are different, and that's neither a bad thing nor an avoidable thing.

Re:Tree Sitter and the Complications of Parsing Languages by nusaru on Wednesday November 24, 2021 @04:38AM (#29328353)
I wonder if perhaps this is also a generational thing. Programmers from before syntax highlighting became popular would be less likely to prefer it, no? I’m not even sure if programmers from current/recent generations ever prefer not to have syntax highlighting, but I’m genuinely curious if there are such people out there.
Re:Tree Sitter and the Complications of Parsing Languages by mst on Wednesday November 24, 2021 @06:18AM (#29328874)
I've known people who've started without synhi but wouldn't leave home without and people who started with rich synhi everywhere and now avoid it except for the first couple months of learning a new language, so it's certainly not just generational.

I would not at all be surprised if people who started off one way or the other (for generational reasons or indeed any 'whatever environment they were first introduced to' style reasons) are less likely to end up switching, but that probably says more about perceived switching costs as what would be most comfortable for somebody.

e.g. I know people who took a month to be comfortable without synhi but then loved that, and I've spent weeks trying to be more comfortable -with- and given up, and honestly anything that half screws your productivity for over a week is going to be a hard sell even if the end result -would- be better (waves in "also, still can't manage to drive emacs" ;)

Re:Tree Sitter and the Complications of Parsing Languages by AkshitGarg on Wednesday November 24, 2021 @05:26AM (#29328610)
I grew up with fully fledged syntax highlighting, but I still prefer to use really minimal themes as I find them to reduce cognitive overhead and eye strain.

It was hard for the first few hours, but then I eventually got used to it, and now I can't use anything else.

I know this is not quite as extreme as working without syntax highlighting :)

Re:Tree Sitter and the Complications of Parsing Languages by NoGravitas on Wednesday November 24, 2021 @11:25AM (#29331650)
I started before syntax highlighting became widely used (in the Emacs 18 era), but was super-excited for syntax highlighting when it became available (Emacs 19 and XEmacs), and probably went overboard with it. These days, I prefer minimal syntax highlighting.
Re:Tree Sitter and the Complications of Parsing Languages by azeirah on Wednesday November 24, 2021 @09:45AM (#29330432)
Not sure which editor I'm thinking about, but I do remember the exact feature you're describing implemented in one I used a while ago.

Ie, the paragraph (or block of code) your cursor is focused on is visible, the rest of the code is blurred out.

Re:Tree Sitter and the Complications of Parsing Languages by spiralx on Thursday November 25, 2021 @07:25AM (#29340740)
I recall that as well, my guess would be Sublime Text. Ah, it might have been this plugin for Atom, I was using that for a while:

https://github.com/davidleghorn/atom-focus-mode

Edited to add that I found this for VS Code which I might try:

https://marketplace.visualstudio.com/items?itemName=imagio.v...

Re:Tree Sitter and the Complications of Parsing Languages by azeirah on Friday November 26, 2021 @08:18AM (#29349971)
I think I met this feature specifically in an editor made specifically for markdown and markdown only.

Although I can definitely imagine this being a plugin in different editors

Re:Tree Sitter and the Complications of Parsing Languages by Kinrany on Wednesday November 24, 2021 @05:11AM (#29328516)
The IDE could temporarily turn off all syntax highlighting outside the node that has the cursor.
Re:Tree Sitter and the Complications of Parsing Languages by mst on Wednesday November 24, 2021 @06:09AM (#29328835)
Where the cursor is and where my mental focus is don't necessarily match, and it's really the granularity problem - expression level versus statement versus block versus etc. that causes 'mismatch between highlighting and focus' for me at least.

It certainly sounds like an experiment that would be interesting to try, though.