LSP icon indicating copy to clipboard operation
LSP copied to clipboard

Display diagnostics inline similar to Error Lens in VSCode

Open Rapptz opened this issue 4 years ago • 4 comments

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.

Rapptz avatar May 29 '21 02:05 Rapptz

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.

rchl avatar May 29 '21 08:05 rchl

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.

Rapptz avatar May 29 '21 09:05 Rapptz

Now that I look at it, that PR was only doing that for diagnostic intersecting with the cursor.

rchl avatar May 29 '21 19:05 rchl

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).

rchl avatar May 29 '21 20:05 rchl

#1702 is merged 👌

It will be part of the next LSP release.

predragnikolic avatar Jun 22 '23 17:06 predragnikolic