VHDL-LS / rust_hdl

Other
334 stars 65 forks source link

Add support for textDocument/documentHighlight request #308

Closed rapgenic closed 3 months ago

rapgenic commented 4 months ago

Hi, thank you all for the great project, which has helped me a lot while writing VHDL code!

In most of the other language servers, I use a lot the documentHighlight feature, which highlights all the occurrences of a symbol in the current file. Noticing that it was missing from this LS I attempted my own implementation

See the result here:

https://github.com/VHDL-LS/rust_hdl/assets/10487071/ebb064ce-89f1-459c-a37b-edf11d7af977

Edit

It seems that VScode has some kind of fallback that performs the same result even if the server does not have this capability! (I am actually using another editor - Zed - that would not do the same)

See the before and after in Zed:

Before

https://github.com/VHDL-LS/rust_hdl/assets/10487071/6162dcfc-965a-4857-86e5-8dc6a060a4f0

After

https://github.com/VHDL-LS/rust_hdl/assets/10487071/382ad155-a142-44f8-b731-6372cbd82c85

rapgenic commented 3 months ago

What about something like this? I have tried it and it seems to perform actually faster!

Schottkyc137 commented 3 months ago

What about something like this? I have tried it and it seems to perform actually faster!

Very nice, that's exactly what I had in mind.