mirror of
https://github.com/haskell/haskell-language-server.git
synced 2024-09-11 08:45:35 +03:00
c422cf373a
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> |
||
---|---|---|
.. | ||
src/Ide/Plugin | ||
test | ||
gadt.gif | ||
hls-gadt-plugin.cabal | ||
LICENSE | ||
README.md |
GADT Converter Plugin
The hls-gadt-plugin provides a code action that converts a datatype to GADT syntax.
Demo
Design
The plugin works in the following steps:
- Get data declarations and enabled pragmas from parsed source.
- Response a code action with a command to convert to GADT syntax if given position is a H98 data declaration.
- Convert every part of H98 declaration to corresponding GADT's.
- Print converted declaration. (See
prettyGADTDecl
source code for details) - 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