Coder Social home page Coder Social logo

Comments (10)

winpat avatar winpat commented on August 24, 2024

I do have the same issue.

I'm using:

  • lsp-mode 20190113.1050
  • lsp-haskell 20190602.825
  • emacs 26.1
  • hie 0.11.0.0
  • NixOS 19.03

Here is the hie log:

2019-07-13 18:35:41.014912492 [ThreadId 4] - run entered for hie-wrapper(hie-wrapper) Version 0.11.0.0 x86_64 ghc-8.6.4
2019-07-13 18:35:41.015122289 [ThreadId 4] - Current directory:/home/patrick/vcs/bkp
2019-07-13 18:35:42.297005785 [ThreadId 4] - Cradle directory:/home/patrick/vcs/bkp
2019-07-13 18:35:42.297223256 [ThreadId 4] - Using stack GHC version
2019-07-13 18:35:43.526792138 [ThreadId 4] - Project GHC version:8.6.5
2019-07-13 18:35:43.526901252 [ThreadId 4] - hie exe candidates :["hie-8.6.5","hie-8.6","hie"]
2019-07-13 18:35:43.527206213 [ThreadId 4] - found hie exe at:/nix/store/vvbm3f10ysrqqjgba966s9j38hds45ni-haskell-ide-engine-combined/libexec/bin/hie
2019-07-13 18:35:43.527262112 [ThreadId 4] - args:["--lsp","-d","-l","/tmp/hie.log"]
2019-07-13 18:35:43.527311266 [ThreadId 4] - launching ....

And the *Messages* buffer:

LSP :: Connected to [hie:13296 status:starting].
LSP :: hie has exited (exited abnormally with code 1)
Server hie:13296 status:starting exited with status exit. Do you want to restart it? (y or n) n

Is there something I can do to debug this further?

from lsp-haskell.

winpat avatar winpat commented on August 24, 2024

@Krantz-XRF there should be an hie and hie::stderr buffer that may contain further information about your problem.

In my case hie was built with GHC 8.6.4 and I was working on an 8.6.5 project. Once I switched to the 8.6.5 build of hie it worked.

from lsp-haskell.

Krantz-XRF avatar Krantz-XRF commented on August 24, 2024

Unfortunately, the hie and hie::stderr buffer are both empty. I tested in a stack project using GHC 8.6.5, this time no prompt at all, only an LSP(Disconnected) on the status bar. I guess that this error has something to do with the hie executable, but strangely enough, VSCode managed to work pretty well.

I have hie-8.6.4.exe, hie-8.6.5.exe and hie-wrapper.exe (from HIE-8.6.5) all in PATH.

from lsp-haskell.

bitmappergit avatar bitmappergit commented on August 24, 2024

I had this issue, emacs wasn't using the correct path. I renamed hie-wrapper to hie-wrapper-int and replaced hie-wrapper with a script that contained this:

#!/bin/bash
export PATH=$PATH:/Users/bitmapper/.ghcup/bin:/Users/bitmapper/.local/bin
hie-wrapper-int $@

adjust as needed.

from lsp-haskell.

hanmoi-choi avatar hanmoi-choi commented on August 24, 2024

This fixed the same issue for me

 (setenv "PATH" (concat (getenv "PATH") ":/home/dc/.local/bin"))

from lsp-haskell.

Cmdv avatar Cmdv commented on August 24, 2024

same deal I'm trying lsp-haskell on spacemacs

my config:

(haskell :variables
              haskell-enable-hindent-style "johan-tibell"
              haskell-completion-backend 'lsp
              haskell-enable-shm-support t
              haskell-process-type 'stack-ghci)

....
(defun dotspacemacs/user-config ()
(add-to-list 'exec-path "/Users/cmdv/.local/bin/")
(setq lsp-haskell-process-path-hie "/Users/cmdv/.local/bin/hie-wrapper")
(require 'lsp-haskell)
(add-hook 'haskell-mode-hook #'lsp)
)

I have a mass amount of hie in /Users/cmdv/.local/bin/

Screenshot 2019-09-05 at 17 06 50

error:

LSP :: Connected to [hie:1670 status:starting]. [2 times]
LSP :: hie has exited (finished)
Server hie:1670 status:starting exited with status exit. Do you want to restart it? (y or n) y

I found that I can start the server directly in the terminal which is odd!!

from lsp-haskell.

mohkale avatar mohkale commented on August 24, 2024

I had the same issue, tried running the server outside of emacs (just hie.exe) & it worked fine. Note if you find the process crashes after hitting return, that's normal. I'm not sure why stdin is used, but that's to be expected. If you think it's not, try running hie-wrapper.exe with -d flag and it'll be more verbose on crash.

Getting to the main point, I found that for me, hie.exe crashed because the log file /tmp/hie.log doesn't exist... and more importantly, can't exist because I'm on windows. The default value for lsp-haskell-process-args-hie is ("-d" "-l" "/tmp/hie.log") a hardcoded unix filename was the problem. We should probably keep it system agnostic if we can, but otherwise adding this to my config fixed it (setq lsp-haskell-process-args-hie (list "-d" "-l" (make-temp-file "hie." nil ".log")))

from lsp-haskell.

bitmappergit avatar bitmappergit commented on August 24, 2024

This error occurs not because it can't find hie, but because it can't find the correct version of Haskell. It was quite annoying to debug this.

from lsp-haskell.

Krantz-XRF avatar Krantz-XRF commented on August 24, 2024

I managed to fix my problem thanks to @mohkale's advice. I suggest the hard-coded temp file path should be warned in the README for Windows users.

For me, this issue is ready to be closed, but I noticed some other people here suffering from similar problems. (Though it seems that their problems happen on UNIX-like systems instead of Windows.) Should I keep this issue open for now?

from lsp-haskell.

AshamedConsequence avatar AshamedConsequence commented on August 24, 2024

I also had this problem, but was able to hack through it by creating a symlink from /usr/bin/hie-xxx, to /usr/bin/hie

Hope this helps anyone who needs it.

from lsp-haskell.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.