emacs-lsp / lsp-treemacs

lsp-mode :heart: treemacs
GNU General Public License v3.0
403 stars 48 forks source link

Automatic pop-up / collapse when not needed. #4

Open sakshamsharma opened 5 years ago

sakshamsharma commented 5 years ago

Any plans to add a "collapse when there's no errors around" mode to lsp-treemacs? I don't like the fact that it takes up precious screen real estate all the time.

Actually a better approach would be to make it configurable about when it should pop up. I'd ideally want to make it pop up only if I've been idle for 2 seconds and there's some useful information to show.

yyoncho commented 5 years ago

IMO the solution should be external to lsp-mode/lsp-treemacs using the hooks/functions that are exposed by lsp-mode/lsp-treemacs. What you have described is a personal preference(in a good sense) which could vary. E. g.

  1. Someone might want to display error list when there are errors but ignore the warnings
  2. Someone might want to display the error list when there are errors for the current project or only if they are for the current buffer
  3. Someone might want to display the error list when there are errors in the current language (e. g, if you are editing Java display errors list only if there is an error in java file.

I would propose inspecting the lsp-mode/lsp-treemacs API and identify the gaps that are needed so any user could achieve the customizations that he/she wants(we need lsp-treemacs-error-list-hide at least).

Later, when we start building lsp-ide package (https://github.com/emacs-lsp/lsp-ide) which will contain opinionated set of settings/configurations we will assemble a set of default configuration scripts that will go into it.

Of course, if a lot of user request that functionality will promote it as core functionality.

Let me know what do you think.

sakshamsharma commented 5 years ago

Definitely makes sense. Having this as a issue here is useful nonetheless as it'll help someone who may stumble across the same requirement in the future. I'll try to get something working on my own then when I get some free time.

yyoncho commented 5 years ago

Ok, if you need help feel free to ping me here or in gitter.