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

Is it possible to use the HLS plugin for VS Code without ghcup? #630

Closed
houseofwealth opened this issue Jul 2, 2022 · 10 comments
Closed

Comments

@houseofwealth
Copy link

Your environment

Windows 10. I am having trouble installing ghcup. So I wanted to see if it would be possible to get the HLS plugin to work for VS Code without needing ghcup? I have both ghc 8.10.7 and the HLS server on my PATH. Yet when I start up VS Code i get a message saying HLS isn't installed which if i click on it, takes me to the ghcup installation page. Just out of curiousity why does this plugin need ghcup, assuming I am wiling to manage the installation of the various haskell pieces my self?

@houseofwealth houseofwealth added status: needs triage type: bug A bug or unintended effect labels Jul 2, 2022
@fendor
Copy link
Collaborator

fendor commented Jul 3, 2022

In the VSCode settings, set the option "Haskell: Manage HLS" to "PATH", then it should behave like you describe.

Just out of curiousity why does this plugin need ghcup, assuming I am wiling to manage the installation of the various haskell pieces my self?

You don't need, but it has been decided it is better to automatically install the HLS versions users need than users having to install HLS manually.

@fendor fendor transferred this issue from haskell/haskell-language-server Jul 3, 2022
@fendor fendor removed type: bug A bug or unintended effect status: needs triage labels Jul 3, 2022
@hasufell
Copy link
Member

hasufell commented Jul 3, 2022

@hasufell hasufell closed this as completed Jul 3, 2022
@houseofwealth
Copy link
Author

@fendor that's what I already have (Manage HLS is set to PATH). I agree that the automatic installation would be the better option, but as I mentioned I cannot get ghcup to install so I'm forced down this path.

@houseofwealth
Copy link
Author

@hasufell Yes I'd already been to that link you sent me - all it does is instruct me to set haskell.manageHLS to PATH and make sure HLS is in your PATH or set haskell.serverExecutablePath (overrides all other settings) to a valid executable, both of which I have already done. So I am out of ideas, willing to try any other ideas you may have

@hasufell
Copy link
Member

hasufell commented Jul 5, 2022

I don't understand what your issue is. You say you're successfully using the manual method now. So it seems it works?

@houseofwealth
Copy link
Author

@hasufell : It now finds the HLS (The name was just the name of the file that I downloaded, which has a version number appended, once I removed that part it was able to find HLS). However that didn't help much because I now get an error message

ghcide compiled against GHC 9.2.2 but currently using 8.6.5 
This is unsupported, ghcide must be compiled with the same GHC version as the project. 

Which has me stumped since the HLS page says that the current version of HLS (what I have) is supposedly compatible with 8.6.5. In fact there is no other version of HLS that even works with ghc 8.6.5. Any ideas?

@hasufell
Copy link
Member

hasufell commented Jul 5, 2022

@houseofwealth that's why it's easier to use ghcup (you need to build HLS with the GHC you're gonna use). Can you elaborate what doesn't work with ghcup?

@houseofwealth
Copy link
Author

houseofwealth commented Jul 5, 2022

@hasufell Powershell just closes without any error messages after (trying to?) execute the last command in this command sequence copied from the ghcup page: (Its supposed to execute that last command and then give you some install choices)
Set-ExecutionPolicy Bypass -Scope Process -Force;[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072;Invoke-Command -ScriptBlock ([ScriptBlock]::Create((Invoke-WebRequest https://www.haskell.org/ghcup/sh/bootstrap-haskell.ps1 -UseBasicParsing))) -ArgumentList $true

@hasufell
Copy link
Member

hasufell commented Jul 6, 2022

Did you disable antivirus and windows defender?

@houseofwealth
Copy link
Author

So it turns out it wasn't antivirus or windows defender but my company that was blocking the remote script execution b/c its whitelist based. I might have guessed. I tried it on a different machine and it worked. Sorry for the hassle.

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

3 participants