haskell-vim-now icon indicating copy to clipboard operation
haskell-vim-now copied to clipboard

Can't get ",ht" working.

Open capn-freako opened this issue 8 years ago • 5 comments

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?

capn-freako avatar Aug 07 '17 00:08 capn-freako

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.

begriffs avatar Sep 01 '17 20:09 begriffs

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 avatar Nov 16 '17 00:11 capn-freako

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!

capn-freako avatar Nov 16 '17 14:11 capn-freako

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.

begriffs avatar Nov 16 '17 15:11 begriffs

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

capn-freako avatar Nov 16 '17 16:11 capn-freako