Firstly, thank you for developing this plugin, and for all the work you've obviously put in to the rewrite. v3 is great :heart:
This PR just makes a minor tweak and fixes an off-by-one error.
The off-by-one is for the [row, col] display. ctx.item.pos seems to be (1, 0) indexed, so the +1 should be on the column, not the row.
The tweak is for the formatting of an item's "source". Currently there are three different ways this is displayed:
Diagnostics have the source highlighted as a comment, before the position
LSP definitions/references/etc have the client name highlighted as normal text, in brackets, before the position
LSP incoming/outgoing calls have the client name highlighted as a "Title", without brackets, after the position
What I've done is change the LSP format strings to be more like the diagnostics one. This is what looks the nicest imo, but I don't really have a strong opinion here so if you feel differently then I don't mind changing it.
I've also changed the diagnostic formatting, so that the brackets around the code are also highlighted as a comment. Currently the brackets are shown as normal text, which looks a bit off to me, but again it's not a big deal and I wouldn't mind changing/reverting it.
These changes seem to work for me, but the code is quite complicated and I don't really understand much of what's going on - so it's very possible I've done something very wrong or missed something. Please feel free to fix/change anything if needed.
Firstly, thank you for developing this plugin, and for all the work you've obviously put in to the rewrite. v3 is great :heart:
This PR just makes a minor tweak and fixes an off-by-one error.
The off-by-one is for the
[row, col]
display.ctx.item.pos
seems to be(1, 0)
indexed, so the+1
should be on the column, not the row.The tweak is for the formatting of an item's "source". Currently there are three different ways this is displayed:
What I've done is change the LSP format strings to be more like the diagnostics one. This is what looks the nicest imo, but I don't really have a strong opinion here so if you feel differently then I don't mind changing it.
I've also changed the diagnostic formatting, so that the brackets around the code are also highlighted as a comment. Currently the brackets are shown as normal text, which looks a bit off to me, but again it's not a big deal and I wouldn't mind changing/reverting it.
These changes seem to work for me, but the code is quite complicated and I don't really understand much of what's going on - so it's very possible I've done something very wrong or missed something. Please feel free to fix/change anything if needed.