Skip to content

C-u C-c C-t doesn't add type signature #900

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
gracjan opened this issue Sep 30, 2015 · 9 comments
Open

C-u C-c C-t doesn't add type signature #900

gracjan opened this issue Sep 30, 2015 · 9 comments

Comments

@gracjan
Copy link
Contributor

gracjan commented Sep 30, 2015

Redditor has a problem:

The correct type is displayed in the mini buffer (basically C-u doesn't do anything, and I just get the result of C-c C-t.) How can I debug this problem and get automatic type annotations working again? Thanks.

https://www.reddit.com/r/emacs/comments/2rbv11/haskell_mode_cu_cc_ct_doesnt_add_type_signature/

@PierreR
Copy link
Contributor

PierreR commented Oct 28, 2015

Is there a workaround for this issue ? I thought M-t would insert the type signature but for me it just prints "Nothing to be done".

As a note, C-c C-t does give me a proper type.

@bergey
Copy link
Contributor

bergey commented Dec 1, 2015

@PierreR Is this still a problem with current HEAD?

If so, is C-c C-t bound to inferior-haskell-type or haskell-process-do-type? Can you provide an example that produces the error?

@PierreR
Copy link
Contributor

PierreR commented Dec 1, 2015

@bergey I am using haskell-mode-20151126.1250 and yes it is still a problem.

c-c c-t is bound to ghc-show-type. The function that offers this feature comes from ghc-mod if I am not mistaken: ghc-insert-template-or-signature. Is there an equivalent not related to ghc-mod (it looks like ghc-mod is no so active these days) ?

Here is the ghc-mod issue : DanielG/ghc-mod#628

@bergey
Copy link
Contributor

bergey commented Dec 3, 2015

I believe the best-maintained equivalent now is haskell-process-do-type. It assumes there's already a connected ghci session, so I call haskell-process-load-file first (C-c C-l by default) and then haskell-process-do-type (which is the current default for C-c C-t).

I'll try to look into it, now that I know which function is being called. (In case it's fixable in hasell-mode; I can't help on the ghc-mod side.)

@gracjan Can you change the title of this issue to "ghc-show-type doesn't add type signature".

@geraldus
Copy link
Contributor

geraldus commented Mar 3, 2016

Due to ghc-show-type is not a part of haskell-mode I'll close this, haskell-process-do-type (and haskell-mode-show-type-at) inserts type signature in presence of universal prefix arg.

@geraldus geraldus closed this as completed Mar 3, 2016
@PierreR
Copy link
Contributor

PierreR commented Apr 21, 2016

@geraldus haskell-process-do-type shows the signature in the minibuffer but does not insert anything for me ...

Should you re-open the issue or shall I create an new one ?

@gracjan
Copy link
Contributor Author

gracjan commented Apr 21, 2016

Lets reopen this here.

@gracjan gracjan reopened this Apr 21, 2016
@novakboskov
Copy link

novakboskov commented Oct 27, 2016

With:
haskell-mode-20161027.139 and GNU Emacs 25.1.1
the issue is still here.

C-c C-t is boud to haskell-process-do-type and it works well but C-u C-c C-t does not even call haskell-process-do-type (when I instrument this function and type C-u C-c C-t it does not stop the debugger and prints C-u C-c C-t is undefined in minibuffer.)

It looks a bit strange to me since haskell-process-do-type declares (interactive "P") in its definition.

Is there some additional level of indirection when calling this function? Other functions declare (interactive "P") are called properly with prefix argument.

@PierreR
Copy link
Contributor

PierreR commented Oct 27, 2016

FWIW, I think it would be OK for haskell-mode to stop supporting this leaving it to external tools such as intero (it does work there) or ghc-mod (last time I checked it didn't work there).

The worst is to keep pretending that this feature works ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants