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

Refactor Code Actions #701

@lukel97

Description

@lukel97

Code actions and plugins

At the moment, we have one big module CodeActions.hs that does all the logic for taking in diagnostics and spitting out code actions. Ideally, all of this logic should be done inside the plugins so that CodeActions.hs can gather them up without having to deal the specifics of each plugin.
As a rough idea, the PluginDescriptor could take on another field to help produce code actions:

data PluginDescriptor =
  PluginDescriptor { pluginName :: T.Text
                   , pluginDesc :: T.Text
                   , pluginCommands :: [PluginCommand]
                   , pluginCodeActions :: [Diagnostic] -> IdeM [CodeAction]
                   }

Command identifiers

Currently command identifiers are passed around as strings, and have a lot of dodgy logic for converting to and from their unique, PID prepended counterparts. This should be refactored so that they are strongly typed, and the PID-ifying is done behind the scenes.

Todo

  • Add new field to PluginDescriptor
  • Migrate existing plugins over
  • Refactor command identifiers

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: refactorRefactor and tidy up internals.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions