commercialhaskell / stack-ide

Stack-based JSON interface to ide-backend
98 stars 23 forks source link

Contents are null #31

Closed cocreature closed 9 years ago

cocreature commented 9 years ago

For some reason I can't seem to get stack ide working on some repositories. E.g. take the cabal repo which has a stack.yaml file. However if I try to run stack ide cabal-install I get the message:

{"tag":"ResponseWelcome","contents":[0,1,0]}
{"tag":"ResponseUpdateSession","contents":null}

After that nothing happens and stack ide just stays silent and keeps running. I have run stack build before and that works just fine.

This happens on some repositories but other repositories like the stack-ide repo itself work just fine. So far I couldn't find a pattern.

rvion commented 9 years ago

Same for me: in most repositories, stack ide only print

{"tag":"ResponseWelcome","contents":[0,1,0]}
{"tag":"ResponseUpdateSession","contents":null}

then remains silent. For some other repo like the stack-ide one, it works

$ stack --version
Version 0.1.1.0, Git revision 112e8c281d73fb3b34a00073b9150c239172ce15

On a macbook air

CRogers commented 9 years ago

I'm also seeing this. I've never got anything other than null.

On Sun, 19 Jul 2015 09:33 Rémi Vion notifications@github.com wrote:

Same for me: most repository do not work, but some does like the stack-ide one

— Reply to this email directly or view it on GitHub https://github.com/commercialhaskell/stack-ide/issues/31#issuecomment-122640045 .

lukexi commented 9 years ago

Hi guys! This was a problem with ide-backend (https://github.com/fpco/ide-backend/issues/289, where you'd need to have the internal ide-backend-rts package available in each project's package database for ide-backend to work correctly).

That's been fixed now — can you try again with the newest (i.e. from git — I don't think all the releases have been made yet) stack, ide-backend and stack-ide? Basically following the installation instructions from https://github.com/commercialhaskell/stack-ide/blob/master/README.md

cocreature commented 9 years ago

@lukexi Sorry I forgot to mention it, but I am already using it. Still it doesn't always work. stack ide cabal-install still doesn't do anything. Interestingly stack ide Cabal works. I also have some other projects that don't work, but they are not yet online so I can't link to them.

Edit: Other examples that don't work are

rvion commented 9 years ago

same for me, I was using git versions from yesterday for both stack and stack ide

cocreature commented 9 years ago

@rvion You also need to have the git version of ide-backend.

rvion commented 9 years ago

I now do but:

➜  ide-backend git:(master) $ stack ide ide-backend
{"tag":"ResponseWelcome","contents":[0,1,0]}
{"tag":"ResponseUpdateSession","contents":null}

or

➜  test22  $ stack ide test22
{"tag":"ResponseWelcome","contents":[0,1,0]}
{"tag":"ResponseUpdateSession","contents":null}
lukexi commented 9 years ago

(see my reply to @rvion's newer "not enough bytes" issue #33 if you are having that problem)

I can confirm that stack ide ide-backend doesn't work here either...

Aha, this should help. Try pasting this into the terminal window after running stack ide <someproject>:

{"tag":"RequestGetSourceErrors","contents":[]}

That should force a more descriptive error.

cocreature commented 9 years ago

Allright, the problem is not using stackage nightly because old ghcs/cabals need to be patched. Once I switched my projects to nightly everything works. cabal-install is an exception, but that seems to do some very weird stuff that seems to be unrelated. Thanks for your help @lukexi

mgsloan commented 9 years ago

While stack ide not working on some projects is definitely a bug, right now the {"tag":"ResponseUpdateSession","contents":null} is expected - see https://github.com/commercialhaskell/stack/issues/640