Haskell-language-server: Case splitting features

Created on 16 Aug 2020  路  7Comments  路  Source: haskell/haskell-language-server

Original Twitter threads: https://twitter.com/Anka213/status/1289724597735063552

Case splitting an equation (in Idris):

idris

How this could be implemented in HLS:

  • A code action provider to split equations with an empty rhs
  • A completion provider with splitting suggestions for case [..] of

Tools that already do this:

plugins help wanted enhancement

Most helpful comment

Peek 2020-09-07 16-46

It's looking really good! We want to get a little more code automation in before opening a PR.

All 7 comments

Just in case the references can help, the feature was included in hie (afaik using ghc-mod underneath and using hare by @Avi-D-coder): https://github.com/haskell/haskell-ide-engine/issues/907

@TOTBWF and are tackling this (and other great things!)

Peek 2020-09-07 16-46

It's looking really good! We want to get a little more code automation in before opening a PR.

Wow, that looks fabulous!

Blocked by https://github.com/alanz/ghc-exactprint/issues/91, since it prevents us from to synthesize new terms that respect layout.

Blocked by alanz/ghc-exactprint#91, since it prevents us from to synthesize new terms that respect layout.

Oh no! Please share the ghcide/HLS branch and maybe someone can find a workaround.

@pepeiborra sure! I will be forever in your debt if you can. https://github.com/isovector/haskell-language-server/tree/tactics

Everything is hooked up and working, but TreeTransform (which uses ExactPrint) runs into this issue when trying to insert the generated terms back into the source.

Was this page helpful?
0 / 5 - 0 ratings