haskell / haskell-ide-engine

The engine for haskell ide-integration. Not an IDE
BSD 3-Clause "New" or "Revised" License
2.38k stars 211 forks source link

Atom plugin doesn't work? #1734

Closed JasonSome closed 4 years ago

JasonSome commented 4 years ago

Hi, I am really at a complete loss as to why my Atom installation with ide-haskell-hie is not working. It is not displaying tooltips, it is not displaying linter on save, nothing. I got a working hie executable, I correctly set its path, it recognizes and right now Atom gives no errors (I just resolved the warning that Hoogle db cannot be found, I installed that too), but still my UI is as if there is no ide-haskell-hie! My GHC version is 8.8.3, all corrections (I am aware of the fixed issue of 8.8.3, been watching it) have done to compile hie, etc correctly. Why might that be? What's going on? (seems to be an Atom plugin problem, since hie is working??) The only suspicious thing, which I also do not fully understand, is the following line in my hie.log:

2020-04-12 17:41:38.118827922 [ThreadId 25] - Scheduler thread exited unexpectedly: panic! compileHelper': compiling helper failed! exit code ExitFailure 1

fendor commented 4 years ago

Hi! Please provide some more logs! You can obtain some logs by invoking hie-wrapper --debug . in the root of your project. Maybe we can see the problem then.

JasonSome commented 4 years ago

@fendor here is my log file, some directories & a file name removed, I believe the most interesting to be the last few lines:

/home/jason/.cache/cabal-helper/cabal-helper-1.0.0.0--Cabal-3.2.0.0--073bdc26fedf03aab13fa581aefdeccbc9647880499bbe0f6a4f32f859e8fcd1.build/CabalHelper/Runtime/Compat.hs:134:5: error:
    Module
    ‘Distribution.Types.GenericPackageDescription’
    does not export
    ‘unFlagAssignment’
    |
134 |   ( unFlagAssignment
    |     ^^^^^^^^^^^^^^^^
hie-8.8.3: panic! compileHelper': compiling helper failed! exit code ExitFailure 1
hie-wrapper: callProcess: /home/jason/.cabal/bin/hie-8.8.3 "--debug" "." (exit 1): failed
fendor commented 4 years ago

Looks like cabal-helper-1.0 does not support Cabal-3.2.0.0, yet. Do you depend on that Cabal version, in some way? As a work-around, you could specify a hie.yaml, some examples are here: https://github.com/haskell/haskell-ide-engine#project-configuration

JasonSome commented 4 years ago

@fendor 1) How can I learn if I depend on that Cabal version? I auto-installed most libraries, maybe some depend on it (?) 2) About that workaround, specify a hie.yaml to say what?

(note that I am also using Cabal for everything, no Stack anywhere in my system)

fendor commented 4 years ago
  1. How can I learn if I depend on that Cabal version? I auto-installed most libraries, maybe some depend on it (?)

Hm, maybe you have an explicit dependency on it in your project? GHC 8.8.3 ships with Cabal 3.0.1.0, at least on my platform, so I think that is the version that should actually be used? Posting the full output of cabal_helper_debug=2 hie-wrapper --debug . might be helpful, but I am not sure. This command only contains your project structure and the compilation flags, no file contents. If this is still to confidential, you could also try to see if you can reproduce the problem on a smaller project that is not confidential and that you can share with us.

  1. About that workaround, specify a hie.yaml to say what?

To tell HIE how to load your project. Assuming you have a trivial project setup, such as

app/
src/
project.cabal

you specify in hie.yaml a mapping from a filepath to the component to load. In this case:

cradle:
  cabal:
    - path: ./app
      component: "exe:project"
    - path: ./src
      component: "lib:project"

In cabal-install components, or sometimes also called Targets, have their syntax specified here: https://cabal.readthedocs.io/en/latest/cabal-commands.html#cabal-v2-build

As a rule of thumb for the component, if cabal repl exe:project succeeds, then this component can be loaded into HIE.

JasonSome commented 4 years ago

You were right, re-installing Cabal 3.0.2 totally fixed it. Thanks!

JasonSome commented 4 years ago

@fendor another question so that I don't have to open a new issue (I hope): how do I increase the font size for my datatips? They are way too small for me to read... I use the One Dark Atom UI. Have tried changing the Theme Font Size, no hie datatip font size change, have tried setting .sb-table.linter and .datatip-marked-container in style.less, none of them also worked...

fendor commented 4 years ago

Sorry, no idea. In vscode, you can press ctrl and + to increase the size of the font

freeman42x commented 4 years ago

What I had to do to fix this issue on Windows 10 when using Chocolatey: