emacs-lsp / lsp-metals

lsp-mode :heart: metals
https://emacs-lsp.github.io/lsp-metals
GNU General Public License v3.0
58 stars 34 forks source link

Add client-side toggle to show/hide decorations. #42

Closed jakejx closed 3 years ago

jakejx commented 3 years ago

Hi there! Currently, the toggles for showing inline hints/implicit types are controlled on the server-side and (I believe) require a server restart whenever they are changed. I have added a small function to toggle these decorations on the client side so that its easy to turn off when there is too much clutter.

Let me know if this makes sense, thanks!

kurnevsky commented 3 years ago

Hi! Thanks for the pull request. I have one comment regarding it though. You implemented in on the emacs side - just ignoring metals decorations. But it's possible to tell metals to stop sending them - you can modify its settings defined here and pass them to metals. It should be more performant and correct way to implement this feature. You can check how it's done for vscode plugin. Would you be interested to try to implement this approach? :)

jakejx commented 3 years ago

Thanks for taking a look. I was under the impression that making the change on the server side would require the server to restart. I'll take a look at the VS code plugin and see how it's done :)

jakejx commented 3 years ago

Inspired by the VS Code plugin, I created a macro that would help to generate commands for toggling boolean configurations and created a few commands :)

kurnevsky commented 3 years ago

Thanks! Merged via https://github.com/emacs-lsp/lsp-metals/commit/9c14176b91bd0f1db39afd9128b6682dae144970