Closed unphased closed 1 year ago
Simple testing reveals that the highlights correspond to whether a given symbol/variable/token is being set or read. something like that. So i'll close, but the documentation needs improvement IMHO.
after reading that, i still don't understand :/
i noticed this only really works on very few languages. basically this plugin uses treesitter to differentiate between when a given highlighted symbol is in a "read" context or a "write" context.
For example when you assign a variable e.g. let x = "42"
and you put your cursor on some later reference to x
, the style you gave IlluminatedWordWrite
will be applied to the x
in the assignment statement but not to the other references of it. Make sense?
I find very little value in this because it only works on like 2% of languages in my experience -- probably only ever seen it work for lua. And if it's not gonna work everywhere then you can't count on it to help you. You may as well not assign these highlight styles since they will by default link to the Text one I think.
Some languages have an LSP or treesitter queries which differentiate read/write, others just use text
because it's easier. It's not up to vim-illuminate, but we will interpret them appropriately if they are available. As OP said, it's rare they are implemented.
Describe the bug In the help and readme, it says:
It's not clear what this means. What is a read/write "kind" of reference?