Tehnix / ide-haskell-hie

Atom LSP plugin for HIE (Haskell IDE Engine)
https://atom.io/packages/ide-haskell-hie
MIT License
26 stars 6 forks source link

How do I figure out if it's working? #8

Closed chris-martin closed 6 years ago

chris-martin commented 6 years ago

I enabled logging, and ide-haskell-hie seems to be outputting some stuff.

2017-12-19 00:36:12.364095224 [ThreadId 4] - ---> {"jsonrpc":"2.0","id":28,"method":"textDocument/documentHighlight","params":{"textDocument":{"uri":"file:///home/chris/haskell/partial-semigroup/partial-semigroup/src/Data/PartialSemigroup.hs"},"position":{"line":215,"character":24}}}
2017-12-19 00:36:12.739415898 [ThreadId 4] - ---> {"jsonrpc":"2.0","id":29,"method":"textDocument/documentHighlight","params":{"textDocument":{"uri":"file:///home/chris/haskell/partial-semigroup/partial-semigroup/src/Data/PartialSemigroup.hs"},"position":{"line":214,"character":17}}}
2017-12-19 00:36:13.559597478 [ThreadId 4] - ---> {"jsonrpc":"2.0","id":30,"method":"textDocument/documentHighlight","params":{"textDocument":{"uri":"file:///home/chris/haskell/partial-semigroup/partial-semigroup/src/Data/PartialSemigroup.hs"},"position":{"line":215,"character":24}}}
2017-12-19 00:47:32.457324589 [ThreadId 4] - ---> {"jsonrpc":"2.0","id":31,"method":"textDocument/documentHighlight","params":{"textDocument":{"uri":"file:///home/chris/haskell/partial-semigroup/partial-semigroup/src/Data/PartialSemigroup.hs"},"position":{"line":217,"character":0}}}
2017-12-19 00:49:01.36528982 [ThreadId 4] - ---> {"jsonrpc":"2.0","id":32,"method":"textDocument/hover","params":{"textDocument":{"uri":"file:///home/chris/haskell/partial-semigroup/partial-semigroup/src/Data/PartialSemigroup.hs"},"position":{"line":187,"character":30}}}
2017-12-19 00:49:01.904450306 [ThreadId 4] - ---> {"jsonrpc":"2.0","id":33,"method":"textDocument/documentHighlight","params":{"textDocument":{"uri":"file:///home/chris/haskell/partial-semigroup/partial-semigroup/src/Data/PartialSemigroup.hs"},"position":{"line":187,"character":35}}}
2017-12-19 00:49:02.447294477 [ThreadId 4] - ---> {"jsonrpc":"2.0","id":34,"method":"textDocument/hover","params":{"textDocument":{"uri":"file:///home/chris/haskell/partial-semigroup/partial-semigroup/src/Data/PartialSemigroup.hs"},"position":{"line":187,"character":57}}}

But I haven't seen any other effects of enabling the plugin. What can I do that will either show that it's working or give me an error message?

domenkozar commented 6 years ago

Hover over a type, you should see a tooltip.

be aware hie needs to compile with the same ghc as your project.

domenkozar commented 6 years ago

See https://github.com/haskell/haskell-ide-engine/issues/414 for the latter

chris-martin commented 6 years ago

If my project can be built by multiple versions of ghc, does hie just need to have been compiled with any of them?

chris-martin commented 6 years ago

Can I compile multiple versions of hie and use the appropriate one per project?

domenkozar commented 6 years ago

@chris-martin I gave a suggestion to hie developer @alanz to ship hie-8.0.2, hie-8.2.2, etc executables and then they could determine what ghc is the project using (for example in stack) and call appropriate hie.

nponeccop commented 6 years ago

Can I compile multiple versions of hie and use the appropriate one per project?

In vsCode we plan to have a per-project setting until the proper wrapping/detection logic is implemented: https://github.com/alanz/vscode-hie-server/issues/31

@domenkozar it's not possible to ship prebuilt executables at the moment because of https://github.com/haskell/haskell-ide-engine/issues/400 . cabal-helper-wrapper is version-independent, so we can ship it as well, but we need to put the hlint.yaml somewhere.

Tehnix commented 6 years ago

I just released an update, version 0.8.0 of ide-haskell-hie, with a wrapper script to support multiple versions of hie. You can follow from here https://github.com/haskell/haskell-ide-engine/issues/439.

Basically,

You should now be good to go (if you're not on windows at least). Let me know if this helps out, then I'll close this issue :) (VSCode support has been added too, just don't know when releases are built)

alanz commented 6 years ago

vscode support is live now.

alanz commented 6 years ago

Including the funky new hie logo.

Tehnix commented 6 years ago

@alanz awesome!

@chris-martin if you have time to provide any feedback (if you are still using this), it would be awesome :) Else I'll close this after a few days has past

domenkozar commented 6 years ago

Nice, I'll use this for nix as well. Thank you!

Tehnix commented 6 years ago

If the script is in effect (after enabling it in settings), you can see in /tmp/hie-wrapper.log some output, like the project root and what version it found.

EDIT: Wups, think I mistook the title of the email notification for the content, lol.

chris-martin commented 6 years ago

I'm not entirely sure what's going on anymore, and I get C compile errors when I run make in haskell-ide-engine. A Nix package would be extremely helpful here.

alanz commented 6 years ago

Can you post a log somewhere? What o/s are you using?

chris-martin commented 6 years ago

https://gist.github.com/chris-martin/a5fd7756f4517d549295c444f50fe268

NixOS 17.09

alanz commented 6 years ago

nixos is the thing. That Makefile was tested on Linux only. It will need some nix wizards to make something equivalent.

chris-martin commented 6 years ago

I can probably do it, if there's a list of the dependencies somewhere?

alanz commented 6 years ago

well, all the makefile does is serially call stack install with each of the stack yaml files, and then copy the exe to a name that includes the compiler version.

So hie -> hie-8.0.2 etc

chris-martin commented 6 years ago

Yeah, I mean what are the native dependencies of the Haskell project?

alanz commented 6 years ago

I know @domenkozar is close to having a derivation for hie, perhaps wait for that and then just adapt it slightly.

On 24 January 2018 at 20:50, Chris Martin notifications@github.com wrote:

Yeah, I mean what are the native dependencies of the Haskell project?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Tehnix/ide-haskell-hie/issues/8#issuecomment-360235251, or mute the thread https://github.com/notifications/unsubscribe-auth/AAZAB620TMm5DohF_v2TxS-lhSS-IEHvks5tN3uEgaJpZM4RGePC .

Tehnix commented 6 years ago

The Makefile should work on any unixy thing (I did it on macOS).

As for NixOS, I'm afraid I'm a bit out of depth here :x Hopefully, as Alan mentions, @domenkozar will have some luck with a derivation.

@chris-martin is it safe to assume that normal shell scripts should still work on NixOS? Nothing amazing, you can see how the wrapper functions here.

chris-martin commented 6 years ago

@Tehnix Yes, we can run shell scripts, but if they have environmental dependencies, we need to know so we can set them up; we don't keep the whole kitchen sink on the PATH at all times.

When I run hie-wrapper.sh, it prints "Cannot find hie in the path".

Tehnix commented 6 years ago

@chris-martin I've just pushed an update that lets you specify your own wrapper entirely (read more at https://github.com/Tehnix/ide-haskell-hie#configuration).

Hopefully this should let you toy around with nix, and various setups. Unfortunately an actual script for nix is a bit out of the scope here (and IMO belongs more in https://github.com/haskell/haskell-ide-engine), although I'll certainly welcome a PR with one, which we could then switch to with a config flag.

I'll close this, and then we can reopen new issues with specific problems :)