yegappan / lsp

Language Server Protocol (LSP) plugin for Vim9
MIT License
458 stars 49 forks source link

Enable inlay hints only for the current line #469

Open ghost opened 6 months ago

ghost commented 6 months ago

Hi, there. This is more of a suggestion (or perhaps a couple suggestions), but it would be nice if inlay hints could be enabled, but hidden except for the current line. I find them distracting when filling a whole file, generally, and this would also have the benefit of pairing nicely with cursorline (although I wouldn't want cursorline to be a requirement for such a feature).

Additionally, I'm not quite sure what the best way to update inlay hints is... I previously used:

au InsertEnter * LspInlayHints disable
au InsertLeave * LspInlayHints enable

which updates inlay hints when leaving insert mode and hides them while writing code, but there is a fairly significant delay upon re-enabling them... it would be nice if the inlay hints could be cached or something and then simply hidden or updated when necessary.

If I'm missing an existing function that could help me on these fronts, please do let me know.