haskell / haskell-language-server

Official haskell ide support via language server (LSP). Successor of ghcide & haskell-ide-engine.
Apache License 2.0
2.71k stars 368 forks source link

Haskell extension problems #3455

Closed joy0516 closed 1 year ago

joy0516 commented 1 year ago

ERROR Error: ghcup --no-verbose run --hls 1.9.0.0 --cabal 3.6.2.0 --stack 2.7.5 --ghc 8.10.7 --install exited with exit code 27.

what does it mean?

jhrcek commented 1 year ago

Seems like you might be able to get more info by running this command on cli and replacing --no-verbose with --verbose?

joy0516 commented 1 year ago

Seems like you might be able to get more info by running this command on cli and replacing --no-verbose with --verbose?

I ran the command in the terminal and got error:Unable to find a download for the requested version/distro.

joy0516 commented 1 year ago

There are two possible reasons for the issue.

  1. the vs studio requires hls 1.9.0.0 but i have installed hls 1.7.0.0. I was trying to download hls 1.9.0.0, but it says Unable to find a download for the requested version/distro. (weird)
  2. vs studio does not find my installed hls. I paste "haskell.serverExecutablePath": "~/.local/bin/haskell-language-server" to Haskell server execution path. But it still does not work. did I paste to wrong place? should server execution path be the path where my hls installed?
joy0516 commented 1 year ago

For the second one, when I restart vs studio, it shows Could not find a HLS binary at "haskell.serverExecutablePath": "~/.local/bin/haskell-language-server"! Consider installing HLS via ghcup or change "haskell.manageHLS" in your settings.

fendor commented 1 year ago

Thank you for your bug report, for more detailed bug reports in VSCode, please follow the instructions here https://github.com/haskell/vscode-haskell#investigating-and-reporting-problems.

  1. Where does ~/.local/bin/haskell-language-server come from? Can you run this HLS on the CLI, eg. cd <root-of-your-project> && ~/.local/bin/haskell-language-server --debug <some-file-in-your-project>
  2. Please include your OS as info, e.g. ubuntu-22.05, or something like that. If possible, also include the output uname -a
joy0516 commented 1 year ago

Thank you for your bug report, for more detailed bug reports in VSCode, please follow the instructions here https://github.com/haskell/vscode-haskell#investigating-and-reporting-problems.

  1. Where does ~/.local/bin/haskell-language-server come from? Can you run this HLS on the CLI, eg. cd <root-of-your-project> && ~/.local/bin/haskell-language-server --debug <some-file-in-your-project>
  2. Please include your OS as info, e.g. ubuntu-22.05, or something like that. If possible, also include the output uname -a

~/.local/bin/haskell-language-server came from Configure Option/Path to Server Executable in the link https://github.com/haskell/vscode-haskell#investigating-and-reporting-problems.

Actually there is no path called ~/.local/bin/haskell-language-server in my computer. So it must be wrong. what input should be for "haskell.serverExecutablePath"?

fendor commented 1 year ago

So it must be wrong. what input should be for "haskell.serverExecutablePath"?

It is an example value for when you have not used ghcup for installing HLS. In other words, not just the correct value you have to fill in. Read https://github.com/haskell/vscode-haskell#path-to-server-executable where it states that you only have to fill in that value if you have a custom installation of HLS.

Can you make sure, ghcup installed HLS correctly? If you are not on windows, use ghcup tui and make sure HLS is installed. If it is, it should be on your PATH and you should be ale to run haskell-language-server --debug <some-file-in-your-project> from the root of your project. If you are on windows (again, please state your OS and Arch), use ghcup list and ghcup install hls as appropriate.

joy0516 commented 1 year ago

I can see that there is a hls folder in ~/.ghcup and version is 1.7.0.0. I thought it should be installed correctly. I am on MacOS.

joy0516 commented 1 year ago

i tried ghcup tui and tried to install hls again, but i got the warning: [ Warn ] Could not get download info, trying cached version (this may not be recent!) [ ... ] If this problem persists, consider switching downloader via: [ ... ] ghcup config set downloader Wget

fendor commented 1 year ago

ping @hasufell for details

Did you try ghcup config set downloader Wget? Maybe that works better?

hasufell commented 1 year ago

Seems like you might be able to get more info by running this command on cli and replacing --no-verbose with --verbose?

I ran the command in the terminal and got error:Unable to find a download for the requested version/distro.

That error is documented here: https://errors.haskell.org/messages/GHCup-00010/index.html

Please follow the suggested instructions there.

i tried ghcup tui and tried to install hls again, but i got the warning: [ Warn ] Could not get download info, trying cached version (this may not be recent!) [ ... ] If this problem persists, consider switching downloader via: [ ... ] ghcup config set downloader Wget

Try running ghcup --metadata-caching=0 --metadata-fetching-mode=Strict tui.

Also kindly report your distro and distroversion.

joy0516 commented 1 year ago

Try running ghcup --metadata-caching=0 --metadata-fetching-mode=Strict tui.

I got msg : Invalid option `--metadata-fetching-mode=Strict'

hasufell commented 1 year ago

Try running ghcup --metadata-caching=0 --metadata-fetching-mode=Strict tui.

I got msg : Invalid option `--metadata-fetching-mode=Strict'

Update your installation via ghcup upgrade.

joy0516 commented 1 year ago

Update your installation via ghcup upgrade.

It returns No GHCup update available.

joy0516 commented 1 year ago

In the path ~/.gucup/tmp/ghcup-ghc-8.10.7_cabal-3.6.2.0_hls-1.7.0.0, I can see that there exists haskell-language-server file. I think hls should be installed on my computer. But I have no idea why VS code could not use it.

joy0516 commented 1 year ago

If you are not on windows, use ghcup tui and make sure HLS is installed. If it is, it should be on your PATH and you should be ale to run haskell-language-server --debug from the root of your project.

What does PATH mean here?

hasufell commented 1 year ago

Update your installation via ghcup upgrade.

It returns No GHCup update available.

What is the ghcup version? Run ghcup --version.

joy0516 commented 1 year ago

Update your installation via ghcup upgrade.

It returns No GHCup update available.

What is the ghcup version? Run ghcup --version.

The GHCup Haskell installer, version v0.1.18.0

hasufell commented 1 year ago

Please follow the instructions here: https://errors.haskell.org/messages/GHCup-00160/index.html

michaelpj commented 1 year ago

No activity for a while, closing as stale.