by tschumacher · 1y ago · 0 comments
https://www.janestreet.com/tech-talks/rust-for-everyone/
As I recall, he also explains how Rust is uniquely positioned to enable this kind of syntax formatting.
Eclipse CDT has a real-time static analyzer for the code you're working on though. It's not as naive as it looks from a distance.
void inc(int* a, int* b) {
*a += 1; *b += 2;
}
Are you adding one to an integer and adding two to another integer, or are you adding three to a single integer?In other words are the two pointers actually pointing to the same variable? There's no way to know. When you select one pointer, should the other also be highlighted?
But in Rust you cannot have two mutable references to a single variable so the above cannot happen.
Variable renaming is a much much simpler task than this. Of course it is archaic and has existed for a long time.
It just highlights parts that interface with a symbol, right? And that's information the language server is supposed to expose.
You'd "just" have to make a x+1 mapping to highlight anything that's touching the symbol
To be clear, I'm just speculating here and not speaking with authority on the topic. It's possible I'm missing something which makes this approach infeasible in practice
But that says nothing about providing the same value to the user in other languages via different means.
But that says nothing about whether it actually can exist.
There's no need to unleash a fuzzy and inefficient network on something designed to be deterministic and parseable.
The information channel is shareable.
It then goes on to talk about rainbow parentheses, which is information multiplexed on the color channel with the syntax highlighting.
That is a big "unless". We aren't all working on pristine code written to high standards…
I'm surprised my comment was downvoted so bad for making an astute observation. It happens to me all the time. A lot of the users of this site suck.
https://news.ycombinator.com/newsguidelines.html:
"Please don't fulminate. Please don't sneer, including at the rest of the community."
"Please don't comment about the voting on comments. It never does any good, and it makes boring reading."