Haskell-language-server: Add code-action to fill in functions required for implementing a type-class

Created on 7 Dec 2020  路  3Comments  路  Source: haskell/haskell-language-server

E.g. on a code-snippet:

data Bar = Bar

instance Show Bar where

The code-action should offer (semantically):

data Bar = Bar

instance Show Bar where
  showsPrec = undefined

and

data Bar = Bar

instance Show Bar where
  show = undefined

This could explode exponentially if there are complex Minimal pragmas, but I guess that is fine.
The stub-definition could be implemented with snippets.

plugins enhancement

Most helpful comment

I'd suggest holes instead of undefined

All 3 comments

I don't know how easy/difficult it would be to implement something like that.

I'd suggest holes instead of undefined

I will try this using a similar idea with the AddPragma plugin (NVM, I took a different pathway)

Was this page helpful?
0 / 5 - 0 ratings