parsonsmatt / intero-neovim

A neovim plugin for Intero, forked from ghcmod-vim
218 stars 28 forks source link

Insert types on let and where bindings #117

Closed owickstrom closed 6 years ago

owickstrom commented 6 years ago

This adds support for using :InteroTypeInsert not only at the top-level, but in any indented where or let bindings.

I recorded an asciinema cast of this when I had implemented it in neovim-ghci, so you can see it in action there:

asciicast

The code is a little involved in the s:paste_type, so I've tried to comment and explain what's going on.

parsonsmatt commented 6 years ago

Awesome, this should fix #16 :)

owickstrom commented 6 years ago

@parsonsmatt Cool! I have a refactoring and possible test coming up, maybe hold the merge a bit if that's ok?

owickstrom commented 6 years ago

@parsonsmatt tests added, and the bulk of the type insertion code is refactored as a pure function.

owickstrom commented 6 years ago

Removed the echo, thanks! :)