Skip to content

Code action order could prefer fixes over disabling warnings #2057

Closed
@andys8

Description

@andys8

TL;DR

Code actions are ordered in a way where the most likely option is on the bottom.

Issue

I'm often using code actions to organize imports and remove the ones that aren't necessary. The option that is use the most often ("Remove all redundant imports") is the last option of the menu. And I think most of the time "Disable ... warnings" is the first option. "Make all imports implicit" seems not relevant here.

One issue is that one needs to move to the end of the list each time. But for example in CoC (Vim) coc-fix-current defines the top code action as default and will execute it. So changing the order could be an improvement.

image

Potential Improvement

Change the order of code actions to (try to) match the most likely behavior. E.g. move "disable warnings" to the bottom of the suggested code actions by default.

Probe Tools

haskell-language-server version: 1.3.0.0 (GHC: 8.6.5) (PATH: /home/andreas/.local/bin/haskell-language-server-wrapper) (GIT hash: e7c5e90b6df5dff2760d76169eddaea3bdd6a831)
Tool versions found on the $PATH
cabal:          3.2.0.0
stack:          2.7.3
ghc:            8.10.4

Config

https://github.com/andys8/dotfiles/blob/3c1d32349ffaf4c1ab840f7b340746846fb5e522/coc-settings.json#L34-L55

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions