Add a code action provider for the eval plugin (existing code lens)
At the moment it's only a code lens, but it could be a code action too.
In lsp-mode this means it shows up when you explicitly show code lenses, but not in the sideline that shows code actions. So I actually thought it was broken (although arguably this just shows that I don't know lsp-mode well enough :sweat_smile:).
https://github.com/emacs-lsp/lsp-haskell/issues/89
This also means that the eval plugin doesn't work with emacs lsp-mode
It does work, it just only works as a code lens. So you need to run lsp-lens-show to make the lenses show up. That's the way lsp-mode does code lenses vs code actions. Maybe we should open an issue there about improving the discoverability of code lenses.
When I click the code lens, it doesn't insert the value of the evaluation, it just crashes with
(error "BadDependency "GhcSessionDeps"")
LSP :: Please open an issue in lsp-mode for implementing `21444:eval:evalCommand'.
@michaelpj does it insert the evaluation for you?
Yes, it works fine. I think you have a server issue that's unrelated to this one, I suggest opening another issue with the reproduction instructions.
There is other issue asking to have code lenses as code actions: #550
I think it would be nice if all code lens providers also provided equivalent code actions.
we could do it generically in hls-plugin-api, i hope
This would be a great thing to have.
I have chosen to disable code lenses since I find it clutters the code (granularity of settings for enabling code lenses in various contexts is limited, so electing to turn them off completely for the moment), however, this currently means I can't use the eval plugin.