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

"parse error in ghcmod: Could not parse..." using ghc-mod >= 4.1.0 #47

Open
ghost opened this issue May 14, 2014 · 5 comments
Open

"parse error in ghcmod: Could not parse..." using ghc-mod >= 4.1.0 #47

ghost opened this issue May 14, 2014 · 5 comments

Comments

@ghost
Copy link

ghost commented May 14, 2014

When using ghc-mod 4.1.0 or newer (including current git HEAD), ghcmod-vim HEAD outputs the following on most files:

|| parse error in ghcmod! Could not parse the following ghc-mod output: (use -v for more information)

@ghost ghost changed the title "parse error in ghcmod: Could not parse..." using ghc-mod >= 4 "parse error in ghcmod: Could not parse..." using ghc-mod >= 4.1.0 May 14, 2014
@eagletmt
Copy link
Owner

Are you using the latest ghcmod-vim?
I think it was fixed in 89ba722 .

@ghost
Copy link
Author

ghost commented May 14, 2014

Yes, I am using HEAD at the moment.

It happens much more rarely now, so I suppose there's something else not being parsed correctly. A project I have handy where it always outputs this error for all src files is bweakfwu. If you clone it and run ghcmod-vim on e.g. this file: https://github.com/plaimi/bweakfwu/blob/master/src/Main.hs -- you should see the error.

@eagletmt
Copy link
Owner

It works for me.

git clone https://github.com/plaimi/bweakfwu
cd bweakfwu
vim bweakfwu.cabal  # Remove GLUT version constraint
cabal sandbox init
cabal install -j4 --only-dependencies --enable-tests
vim src/Main.hs
:GhcModCheck

Could you show me the output of ghc-mod check src/Main.hs from terminal?

@ghost
Copy link
Author

ghost commented May 14, 2014

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

On 14/05/14 14:16, Kohei Suzuki wrote:

Could you show me the output of ghc-mod check src/Main.hs from
terminal?
A-ha! If I do a clean clone, I get:

|| parse error in ghcmod! Could not parse the following ghc-mod
output:cabal: Could not resolve dependencies:

Which is a bit wonky, but hardly cryptic. However, if I run it on the
checkout I have on my computer, I get:

$ ghc-mod check src/Main.hs
src/Main.hs:0:0:Error:: cannot satisfy -package-id
gloss-1.8.1.2-b18cf0a4ac180df2e29f749fd1647fa8

And it is on this particular checkout I get the ghcmod-vim parse error:

Main.hs|| : cannot satisfy -package-id
gloss-1.8.1.2-b18cf0a4ac180df2e29f749fd1647fa8
|| parse error in ghcmod! Could not parse the following ghc-mod
output: (use -v for more information)

So the problem is elusive.


Alexander
[email protected]
https://secure.plaimi.net/~alexander
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iF4EAREIAAYFAlNzYdIACgkQRtClrXBQc7VYHwD/Qmj3zA7JQh6VltSrs89TQeof
HuvnMQIHOrv9Ip4BX10A/2OFO2oT6Yv5BC2P4EPArwToq35yyf/m74abtIgUrdxd
=DMGL
-----END PGP SIGNATURE-----

@eagletmt
Copy link
Owner

If I remove gloss package, I get the same error message from ghc-mod.

% cabal sandbox hc-pkg unregister gloss-1.8.2.1
% ghc-mod check src/Main.hs
src/Main.hs:0:0:Error:<command line>: cannot satisfy -package-id gloss-1.8.2.1-d98827a4646458cb2aafeebc1f757d1d
    (use -v for more information)

But I don't get any parse error from ghcmod-vim.
ghc-mod's error message is sent to stderr and ghcmod-vim just ignores it.

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

1 participant