Skip to content
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

Can't get ",ht" working. #266

Open
capn-freako opened this issue Aug 7, 2017 · 5 comments
Open

Can't get ",ht" working. #266

capn-freako opened this issue Aug 7, 2017 · 5 comments

Comments

@capn-freako
Copy link

Using this simple example:

outFile :: String -> String
outFile name = outDir++"/"++name++".v"

and with my cursor positioned on the 'n' at the beginning of the first occurrence of the word "name" in the second line, I tried ",ht" in normal mode, but got:

ghcmod#command#type: Cannot guess type.

I'd previously rebuilt, using the --enable-test Cabal flag:

stack build :hardware-examples --flag *:enable-test

but, apparently, that wasn't the problem.

Does anyone know how I can get ",ht" working?

@begriffs
Copy link
Owner

begriffs commented Sep 1, 2017

Ghc-mod has trouble working with projects which use a different version of cabal than that which was used to build ghc-mod. You could check where haskell-vim-now installed ghc-mod (perhaps ~/.local/bin), and turn ghc-mod into a symlink which you can point at versions that you build with different versions of cabal.

@capn-freako
Copy link
Author

So, I did: stack install ghc-mod.
And that overwrote the existing executables in ~/.local/bin.
However, I'm still getting the same error, when I try to use ",ht".
Curiously, using ghc-mod explicitly, from the MacVim command prompt, works:

:!ghc-mod type /CNN.hs 168 1
168 1 175 67 "CNNParams Double -> BoxedImage Word8 -> Lbl Double"

@capn-freako
Copy link
Author

Okay, I was able to get ',ht' working, by following the advice given here:
Issue 88

However, there's a caveat:

You must be in the directory containing your stack.yaml file, before opening the file in which you wish to use ',ht'.

Note that ':cd'ing into that directory, after opening the file will not work!

@begriffs
Copy link
Owner

Interesting, so it's a pathing issue? Maybe we could tweak https://github.com/begriffs/haskell-vim-now/blob/master/vimrc.haskell#L1-L7 ?

Thanks a lot for continuing to research this, I've been missing the ,ht functionality which has been broken for a while.

@capn-freako
Copy link
Author

Hi Joe,

I looked at that code, but don't understand it; sorry.
I'm happy to chat anytime about this (or, anything else):
(408)829-3037

Thanks,
-db

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

No branches or pull requests

2 participants