haskell-vim-now icon indicating copy to clipboard operation
haskell-vim-now copied to clipboard

Feature request: display TH splices

Open schell opened this issue 9 years ago • 4 comments

This is a pipe dream feature request but what the heck - it would be great to see TH splices for a given TH call in a quickview window!

schell avatar Sep 16 '16 17:09 schell

That would be very cool. Do you know if there's a command line tool that will show the splices for a given file? If so we could investigate how to shell out to that program and store the results in a new buffer.

begriffs avatar Sep 19 '16 14:09 begriffs

As of 2015 the encantation ghc --ddump-splices {file} will print the splices of {file} to stdout. Before that it printed to stderr (source: http://stackoverflow.com/questions/15851060/ghc-ddump-splices-option-template-haskell#15851260). I use stack, however, so in my terminal I chant stack exec ghc -- -ddump-splices {file} which works wonders :)

schell avatar Sep 19 '16 15:09 schell

OK, I think this will do what we need. Just have to add a keybinding (,hs maybe) to run that command and then open the result in a new pane. I've created a reminder for myself to add this feature, but if you want to attempt a pull request that would be great as well.

begriffs avatar Sep 20 '16 14:09 begriffs

I think that by the time I learned enough VimL you would most likely have it done! I'll give it a shot tonight if can, though. :)

schell avatar Sep 20 '16 16:09 schell