eagletmt / ghcmod-vim

Happy Haskell programming on Vim, powered by ghc-mod
http://www.vim.org/scripts/script.php?script_id=4473
433 stars 59 forks source link

Using ghcmod-vim with neocomplete and ghc-mod-5.0.1 causes errors #56

Closed wraithm closed 9 years ago

wraithm commented 10 years ago

When I start up vim with a haskell file, I get the following:

Error detected while processing function ghcmod#util#check_version..ghcmod#util#ghc_mod_version..vimp
roc#system..<SNR>94_system:
line   89:
E605: Exception not caught: vimproc: vp_pipe_read: *hex*
Error detected while processing function ghcmod#util#check_version..ghcmod#util#ghc_mod_version:
line    2:
E171: Missing :endif
Error detected while processing ~/.vim/bundle/ghcmod-vim/after/ftplugin/haskell/ghcmod.vim:
line   31:
E171: Missing :endif
Error detected while processing function neocomplete#init#enable..neocomplete#init#_sources..neocompl
ete#sources#ghc#define..necoghc#ghc_mod_version..<SNR>130_system..vimproc#system..<SNR>94_system:
line   89:
E605: Exception not caught: vimproc: vp_pipe_read: *hex*
Error detected while processing function neocomplete#init#enable..neocomplete#init#_sources:
line   32:
E170: Missing :endfor
Press ENTER or type command to continue
alex404 commented 10 years ago

I'm getting this as well.

wraithm commented 10 years ago

I think some of the issue is related to the text that gets printed out when ghc-mod can't build a project. ghcmod-vim can't parse it. I've found that I no longer get errors after I successfully get a project to build. Try running ghc-mod from the command line in your project and getting the project to build.

alex404 commented 10 years ago

Indeed, when things build properly it's fine. It would be nice if that didn't happen, but I guess that's more of a problem for vimproc?

evansb commented 10 years ago

The parsing is fine, I think this is a vimproc problem. Try invoking this on vim manually.

call vimproc#system(['ghc-mod'])
evansb commented 10 years ago

Err, so I run make on my vimproc and it resolves the problem.

See : https://github.com/eagletmt/neco-ghc/issues/33

wraithm commented 10 years ago

I had looked into that. I still have some issues after updating vimproc. Especially when I haven't run cabal build in my project. It definitely seems to be a problem with ghc-mod creating unexpected input for ghcmod-vim.

On Sun, Aug 31, 2014 at 4:43 AM, Evan Sebastian notifications@github.com wrote:

Err, so I run make on my vimproc and it resolves the problem.

See : eagletmt/neco-ghc#33 https://github.com/eagletmt/neco-ghc/issues/33

— Reply to this email directly or view it on GitHub https://github.com/eagletmt/ghcmod-vim/issues/56#issuecomment-53982860.

eagletmt commented 10 years ago

I tried ghc-mod 5.0.1.1 compiled by GHC 7.8.3 and it seems working for me except for :echo ghcmod#util#ghc_mod_version() shows [5, 0, 1].

@WraithM @alex404 Could you paste the Haskell code that causes ghcmod-vim errors?

evansb commented 10 years ago

@eagletmt

It ignores the last number "1" because the regex that follows captures 3 instead of 4 digits, but as far as I'm concerned, it shouldn't been any problem.

@WraithM @alex404

Maybe you can try playing with the regex below, like changing it more specific to ghc-mod version \(\d\+\)\.\(\d\+\)\.\(\d\+\)\.\(\d\+\)

eagletmt commented 10 years ago

Yeah, the minor bug of version extraction doesn't cause any problems. I won't fix it.

eagletmt commented 9 years ago

Fixed in #57 .