emacs-lsp / lsp-treemacs

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

lsp-treemacs-errors-list: Consider putting errors in the current buffer first #69

Open ivucica opened 3 years ago

ivucica commented 3 years ago

It would be immensely helpful if the current file's errors would be visible first in the errors list; or, only the current file's errors, as an option.

yyoncho commented 3 years ago

you know that there is flycheck version which shows only the errors for the current buffer? Indeed, it makes sense to have a command lsp-treemacs-errors-list-focus-file. Then user could configure that to happen automatically on buffer switch.

fgabolde commented 2 years ago

The flycheck version is indeed a workaround but IMHO it works better as a transient info buffer, especially since it tends to disappear on C-g. In my currently installed version of lsp-mode if I select a region (e.g. for lsp-format-region) I can't unselect it once I'm done because the flycheck buffer has "stolen" C-g so it can be closed, so I have to reopen the flycheck buffer after each lsp-format-region.

The treemacs buffers work more like permanent views on the project; at least that's how I use the symbols and errors lists. My main gripe with the errors buffer is that if I use it to discover errors in the project, switch to a file that's not the first in the list, and fix something, the whole errors buffer is redisplayed and I lose my spot in the list, even though I probably wanted to keep fixing issues in the same file.

Displaying the current file first in the errors list would go a long way towards making lsp-treemacs-errors-list more user-friendly.

nebkor commented 2 years ago

Just chiming in here that I searched for "lsp-treemacs-errors-list current buffer" and this was the first hit; needless to say, I'm very much in favor of providing an easy way to control which errors are displayed, and I would personally like the errors in my current buffer to be displayed always.

espbee commented 2 years ago

Everything is pretty great as is, but this would certainly be lovely.