Skip to content

Extract ghcide completions and code actions into HLS plugins #724

Closed
@pepeiborra

Description

@pepeiborra

The completions code in ghcide is structured as a single provider that serves multiple contexts (pragmas, imports, types, values, etc.). The static set of dependencies is particularly suboptimal: no completions for pragmas unless the file type checks (haskell/ghcide#631)! It would be advisable to break this down into a family of providers that can all contribute completions depending on the context.

Haskell-language-server has a plugin model that solves exactly this problem. Rather than duplicating this model in ghcide, it would make sense to extract HLS plugins instead. It would constitute a loss of functionality for ghcide users, but note that we are considering to remove the ghcide executable (#935). If that doesn't go ahead, we could always extend the current executable with the ability to run HLS plugins as discussed in #380

Similarly, the code actions code in ghcide should be properly extracted out as HLS plugins, although this seems lower priority. The code is already loosely structured as a bunch of providers, 16 in total, and does not have the shortcomings listed above for completions. Still, an HLS plugin translation would bring certain benefits -decoupling, parallelism and isolation- and hopefully no downsides.

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