meraymond2 / idris-vscode

Idris front-end for VS Code
MIT License
59 stars 10 forks source link

Show type of hole on hover #22

Closed michaelmesser closed 3 years ago

michaelmesser commented 3 years ago

This requires stripping the leading ?.

https://github.com/edwinb/idris2-vim/blob/964cebee493c85f75796e4f4e6bbb4ac54e2da9e/ftplugin/idris2.vim#L27-L29

meraymond2 commented 3 years ago

Cool, that's an easy fix :+1:

Do you prefer having the premises as well in the hover text, or just the type of the hole itself? For

imap : Vect n a -> Vect n b
imap xs = ?imap_rhs

the full type information it returns

 0 b : Type
 0 a : Type
 0 n : Nat
   xs : Vect n a
-------------------------------------
imap_rhs : Vect n b

but that might get annoying if there's a lot of locals.

michaelmesser commented 3 years ago

I think it would be best to show the locals at least until you can hover over the locals to see the types.

meraymond2 commented 3 years ago

This should work now in the latest release.

michaelmesser commented 3 years ago

I can confirm that it works.