Skip to content
This repository has been archived by the owner on Oct 7, 2020. It is now read-only.

[WIP] Generate an "Apply all hints" hlint code action #1450

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

alanz
Copy link
Collaborator

@alanz alanz commented Nov 11, 2019

This commit generates it all the time, without checking if we actually have any hints.

This is a possible alternative to haskell/vscode-haskell#168

But it may be better to update the CodeActionProvider interface to provide all the diagnostics for the given Uri/plugin combo, which can then be checked. Except that it may be too much processing, given the frequency of request.

This commit generates it all the time, without checking if we actually
have any hints.
@lukel97
Copy link
Collaborator

lukel97 commented Nov 12, 2019

This seems to be affecting stand alone hints? Just from looking at the diff it’s not obvious how exactly though

src/Haskell/Ide/Engine/Plugin/ApplyRefact.hs Show resolved Hide resolved
hlintActions = do
actions <- mapM mkHlintAction (filter validCommand diags)
applyAll <- mkApplyAllAction
return (catMaybes $ applyAll:actions)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some clients like coc.vim have keybindings to apply the first code action, so would it make sense to return this last?

Suggested change
return (catMaybes $ applyAll:actions)
return (catMaybes $ actions ++ [applyAll])

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants