haskell-language-server/plugins/hls-gadt-plugin
hololeap c422cf373a
Add source-repository to all cabal files (#3219)
Add a source-repository stanza to any .cabal files in the project that
are missing it.

This metadata can be useful for package maintainers.

See: https://cabal.readthedocs.io/en/stable/cabal-package.html#source-repositories

Signed-off-by: hololeap <hololeap@users.noreply.github.com>

Signed-off-by: hololeap <hololeap@users.noreply.github.com>
2022-09-24 02:50:25 +00:00
..
src/Ide/Plugin Remove exactprint dependencies from ghcide by introducing hls-refactor-plugin. 2022-08-31 00:56:35 +05:30
test fixup refactor onlyWorkForGhcVersions 2022-09-06 20:36:24 +05:30
gadt.gif A plugin for GADT syntax converter (#2899) 2022-05-26 17:13:09 +08:00
hls-gadt-plugin.cabal Add source-repository to all cabal files (#3219) 2022-09-24 02:50:25 +00:00
LICENSE A plugin for GADT syntax converter (#2899) 2022-05-26 17:13:09 +08:00
README.md A plugin for GADT syntax converter (#2899) 2022-05-26 17:13:09 +08:00

GADT Converter Plugin

The hls-gadt-plugin provides a code action that converts a datatype to GADT syntax.

Demo

GADT

Design

The plugin works in the following steps:

  1. Get data declarations and enabled pragmas from parsed source.
  2. Response a code action with a command to convert to GADT syntax if given position is a H98 data declaration.
  3. Convert every part of H98 declaration to corresponding GADT's.
  4. Print converted declaration. (See prettyGADTDecl source code for details)
  5. Send edit request to LSP, the edit includes replacing origin data declaration to GADT and inserting a GADTs pragma if necessary.

Known limitations

  • Currently all comments missed while converting to GADT syntax.

Change log

1.0.0.0

  • Release