Open dppascual opened 1 year ago
Hello,
Thanks for the effort in the report :)
I didn't thoroughly checked the preview code in consult, but it will also probably depend on whether lsp-mode is hooked to the major-mode hooks of the file you are previewing, the core issue is a little too vague as is.
(I think I had some issues with lsp-treemacs showing duplicate categories like that as well, but never bothered to look into it yet, I'll try to at some point.)
flycheck is probably always active because you probably activated the global minor mode, whereas lsp-mode might not be hooked everywhere in the same way, unsure though it depends a lot on your buffer hooks and your config
Thanks for your reply. I've reviewed the doc from consult repo and just found a function to enable modes during a preview. Another way to solve the problem is turning off global flycheck mode.
What do you mean with some issues with lsp-treemacs
? Does the problem comes from this repo https://github.com/emacs-lsp/lsp-treemacs?
What do you mean with
some issues with lsp-treemacs
? Does the problem comes from this repo https://github.com/emacs-lsp/lsp-treemacs?
I meant that you should probably not have main.go
twice in the lsp-treemacs window
I didn't forget (completely) about this, it's just that to fix that I'd need to go deep in consult inner workings again and I need to find a large enough "deep work" span to do this. I'll try to make preview work correctly
Bug description
I found out an odd behaviour and I don't know if it is expected or, on the other case, it should be categorized as a bug.
When running
consult-lsp-diagnostics
, it shows all errors reported by the lsp server; moving down between such errors, a preview of the file is loaded and the cursor is focused on the error. These preview doest not load any mode, neither column numbers, so flycheck starts checking with other checkers (like gofmt, etc) instead of lsp (which is normal because the lsp-mode is not actived yet); it causes the icon of the flycheck in the modeline reports a different number of errors when previewed than loaded.Example
An example that clarifies better the above explanation. When calling
consult-lsp-diagnostics
and selecting a file that has not been loaded previously,flycheck
starts running during the preview of such file and reports no errors (it can be seen in the modeline) because one of the linters has failed.Once the same file is loaded into a buffer,
flycheck
runs again but this time, the checker islsp
because the modelsp
has been enabled. Now,flycheck
reports errors.The preview should either activate
lsp
or avoid activating any other packages (e. g.flycheck
), shouldn't it? If possible both options, I would prefer to enable modes when a file is previewed instead of avoiding activating other packages.Also, I found that the errors reported by
consult-lsp-diagnostics
andlsp-treemacs-error-list
are not equal. The first one reports 71 errors and the second one 123 errors. Shouldn't they bring fromlsp
the same value?