LSP
LSP copied to clipboard
Display diagnostics inline similar to Error Lens in VSCode
Is your feature request related to a problem? Please describe. VSCode has the ability to display diagnostics inline using an extension named Error Lens. This makes it easier to visually see both where the error is and what it is.
Describe the solution you'd like A setting to display errors inline.
Describe alternatives you've considered Hovering over every error or binding the hover to a keybinding.
Additional context I'm not sure if this would be possible to do with the ST plugin ecosystem. I also wouldn't really mind doing it myself but I don't know if there's a way to hook into LSP and get a list of diagnostics for me to work with for cross-plugin interactions.
ST provides functionality to show annotations at the right-hand side of the view (not immediately after the text like in VSCode). It was tried in https://github.com/sublimelsp/LSP/pull/1214 but wasn't ideal.
I have code actions set to the bulb (since I exclusively use key bindings to trigger the menu) so the interference mentioned there doesn't really impact me much. I think it would have been good to allow the option even if that caveat is documented just like the bulb caveat is mentioned right now.
Now that I look at it, that PR was only doing that for diagnostic intersecting with the cursor.
Implemented a proof on concept based on @rwols PR here: https://github.com/sublimelsp/LSP/pull/1702
Feel free to test it out (have to clone the repo manually).
#1702 is merged 👌
It will be part of the next LSP release.