Closed welf closed 7 years ago
The info for C-c C-t
comes from elm-oracle
, which doesn't know how to parse the user's Elm code, so it only supports functions/types in imported libraries. The type sig for C-c C-a
is obtained by running the Elm compiler, which then complains about the missing type signature: that complaint is parsed in order to insert the type.
So in summary, there's not really any backend machinery to request this information of, sorry.
It is a feature request.
Show the type of the function at point in the minibuffer currently works only with functions and values defined in imported libraries. If the user defines his own function or variable
C-c C-t
gives us a messageUnknown type
.C-c C-a
inserts the right type signature, so I think it will be not difficult to addshow type at point
function to user-defined functions and variables.It is sometimes also useful to see the type of the highlighted expression. In Haskell, I frequently use it to see which type the expression has because it helps to write complex functions.