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

VsCode under OSX - hie not working #36

Closed
tittoassini opened this issue Dec 20, 2017 · 9 comments
Closed

VsCode under OSX - hie not working #36

tittoassini opened this issue Dec 20, 2017 · 9 comments

Comments

@tittoassini
Copy link
Contributor

Hi,

I would like to help debug vscode-hie-server under osx.

The behaviour I observe is that vscode/hie seems to work correctly, for example by detecting hlint issues, only on the first haskell file that it opens.

Afterwards, when I hover on some symbol or some hlint issue I see a 'Loading' message and nothing happens. Also code formatting does not seem to do anything.

I have installed the latest hie and vscode-hie-server from github.

I have modified hie-vscode.sh to run hie in log writing mode:
hie --lsp -d -l /tmp/hie.log | tee /tmp/hie-wire.log

I can see by the hie.log that hie continues to receive commands but the output in hie-wire.log stops shortly after startup.

The log files:
hie.log
hie-wire.log

@AlexeyRaga
Copy link
Contributor

This happens to me too, but only on just a couple of projects: https://github.com/haskell-works/hw-haskell-avro is one of them.
HIE on MacOS doesn't work consistently with this project. However, I haven't (yet) investigated or looked into logs.

@k0aaa
Copy link
Contributor

k0aaa commented Dec 20, 2017

Did you delete the build directory after installing HIE?

@tittoassini
Copy link
Contributor Author

tittoassini commented Dec 20, 2017 via email

@tittoassini
Copy link
Contributor Author

tittoassini commented Dec 20, 2017 via email

@tittoassini
Copy link
Contributor Author

OK, so the issue was definitely due to a GHC version mismatch.
Compiling both hie and my project with GHC 8.2.2., things are fine.

All the features now seem to work, I just found this minor issue:

  • hint "use newtype instead of data" is not applied when clicking on the lightbulb

However, I get a lot of these:
Got error while processing diagnostics: These modules are needed for compilation but not listed in your .cabal file's other-modules: ...

Now my cabal file is actually fine.

I guess that this is due to the fact that I have test source files in a separate test directory and that hie tries to compile them and cannot locate the src files?

Is this the issue?

How much hie actually understand of the structure of the cabal file and its different targets?

If this is actually an hie issue and not a vscode-hie-server problem, I will report it there.

@dpren
Copy link

dpren commented Dec 29, 2017

Got error while processing diagnostics: These modules are needed for compilation but not listed in your .cabal file's other-modules: ...

👉 haskell/haskell-ide-engine#391

@nponeccop
Copy link

How much hie actually understand of the structure of the cabal file and its different targets?

Different parts of hie have different understanding. The compilation is performed by ghc-mod library which has fairly complete understanding. But for example hlint part has no understanding, so it has problems with some {-# LANGUAGE pragmas and infix operators.

I vote for closing this bug as a duplicate of haskell/haskell-ide-engine#391

@Tehnix
Copy link
Contributor

Tehnix commented Feb 21, 2018

@nponeccop I'll second that.

I think we can close this issue, since the original problem (mismatch between hie's GHC version and the project's) has been resolved. If you still have other issues, let's open some new specific issues for those :) (the current one being tracked in haskell/haskell-ide-engine#391)

@Tehnix Tehnix closed this as completed Feb 21, 2018
@Rhywun
Copy link

Rhywun commented May 27, 2018

Did you delete the build directory after installing HIE?

I was having the same problem (features like tooltips and reformatting stopped working) until I restored the build directory that I had deleted after some time. Is there some reason I have to keep the build directory around? That doesn't seem right.

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

7 participants