Add custom code action kinds for import related code actions#1570
Conversation
|
Just a minor nitpick, I would prefer |
|
This is marvelous, thanks so much! |
|
@berberman we should document these names in the read me and add instructions on how to use them |
|
Yeah, and I think we should document all ghcide code actions in some place |
|
👍 for documenting all these as they come up. One thing that occurs to me with the naming: it would be nice if the kind and the message sort of had the same structure and terminology? Let me show what I mean:
etc. At the moment there's a sort of implicit translation of terminology that users have to do: "add to import list" -> "extend"; "" -> "create a new import"; "top-level" and "withParent" aren't used in those ways. |
|
@berberman we are very close to having full import management on save, the main thing missing is "remove redundant import", which did not get a custom kind in this PR. |
Closes #1556
Suggestions are welcome! /cc @isovector
Several examples:
import ModuleA (stuffB)import ModuleA (stuffB, stuffA)quickfix.import.extend.thing.topLevelimport ModuleA ()import ModuleA (A)quickfix.import.extend.thing.topLevelimport ModuleA (A)import ModuleA (A (Constructor))quickfix.import.extend.thing.withParentimport Bar (Bar)quickfix.import.new.thing.topLevelimport Bar (Bar(Bar))quickfix.import.new.thing.withParentimport Numeric.Naturalquickfix.import.new.allimport qualified Data.List.NonEmpty as NEquickfix.import.new.qualified