lsp-haskell
lsp-haskell copied to clipboard
Add interactive command for case splitting
Description
This PR adds an interactive function for performing case splits. To use it, simply place your cursor over a typed hole, and call lsp-haskell-case-split
. You should be prompted for a list of identifiers, and selecting one from that list will case split on it.
Notes
It would be nice if lsp-mode
provided a version of lsp--select-action
that offered the ability to have a custom prompt/transformation function. If such a function is written, this code should be updated to use it.
Build failures are unrelated to this change. Looks like something is up with the spinner
package.
Dumb question, since I haven't used any of this yet, but what does this offer over just using the normal methods to trigger the code action? Is it that this is a particular combination that you want to trigger a lot, and so it's nice to have a specific function or keybinding for it?
FWIW, this is now implemented directly in HLS, under a code action with kind refactor.wingman.caseSplit