parsonsmatt / intero-neovim

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

Expand type information selection #8

Open parsonsmatt opened 8 years ago

parsonsmatt commented 8 years ago

intero is able to provide more information to the :type-at depending on the name given to the identifier. For instance, getting the type of show in show 3 using the name it gives Integer -> String, while :type-at Main x y x y show returns Show a => a -> String.

Additionally, it'd be nice if it would expand the selection, like ghcmod-vim does.

parsonsmatt commented 8 years ago

The capturing of the first name is implemented thanks to code reuse from ghcmod-vim.

parsonsmatt commented 8 years ago

Currently, there is :InteroType which is the specific type at point, and InteroGenericType which gets the name and finds the more general type.

gilligan commented 6 years ago

Being able to expand the expression to get type information for would indeed be fantastic. That is something I am missing from ghc-mod ;)

jez commented 6 years ago

@gilligan I’m guessing that you’ve already noticed this, but if you’re using the mappings from the README (namely, using map instead of nmap), you should be able to manually select an entire expression in visual mode and get its type. It’s not quite as good as a single key to walk up to the next largest expression, but its close.