sublimelsp / LSP

Client implementation of the Language Server Protocol for Sublime Text
https://lsp.sublimetext.io/
MIT License
1.61k stars 182 forks source link

feat: toggle show diagnostics without server restart #2429

Closed ta946 closed 2 months ago

ta946 commented 2 months ago

referencing https://github.com/sublimelsp/LSP/issues/2161#issuecomment-1935350667

Introduce the ability to toggle the display of diagnostics without restarting the server

LSP-pyright's output can be quite distracting when trying to read the code to understand it before making changes.

Current method to hide the output, setting show_diagnostics_severity_level to 0, causes the server to restart which can take quite a while with lsp-pyright. Which can be very frustrating and slows down development.

Even worse is that there is no indication that the server is still starting up, so i have to wait longer to make sure there are no errors as opposed to the server still starting up

How it works is by caching the latest diagnostic information. When toggled off, it removes the regions, and when toggled on again, it re-adds the regions by mimicking that new diagnostic information was received

This PR is more a low-quality proof of concept as I don't know the LSP code-base enough nor whats required to contribute correctly

rchl commented 2 months ago

Thanks for the work but I think it would make sense to just create a feature request for it rather than a pull request that is not really done properly.

ta946 commented 2 months ago

not sure how to show file changes in a feature request so will just close the pr as that other issue is already open