-
Notifications
You must be signed in to change notification settings - Fork 90
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
Show progress bar when getting GHC version to avoid freezing GUI #412
Comments
Many thanks for opening the issue here, i hope it would not too difficult |
@runeksvendsen after investigating the code a little bit i've found the code getting ghc already tries to do it creating a progress notification: vscode-haskell/src/hlsBinaries.ts Line 105 in a09c9be
have you come to see that message at some point? |
ok, trying to open stack project without the appropiate ghc installed to trigger the slow ghc install, i' ve observed that:
|
.. and if the wrapper is already downloaded, the code dont show the |
No, I don't recall ever seeing this message. I have recorded a video of what the problem looks like when opening up VS Code for the project in question. See below. It takes one minute and 10 seconds before the language server is started, without any indication of what's going on before that. vs-code-haskell-slow.mov |
Thanks for checking it out, it seems the code tries to show a progress notificacion in the status bar but it is not working (maybe it did with older versions of vscode? i dont remember see it) |
@jneira I only see a progress notification two places in the code, both of which are related to downloading HLS: vscode-haskell/src/hlsBinaries.ts Line 105 in a09c9be
Line 95 in b14b373
But in my video above HLS isn't downloaded, it's hanging while starting up. When I run the below command (in this repo)
it hangs for about a minute with the following output:
It looks like this is the reason VS Code is hanging: since Perhaps we need to add a progress dialog for Starting HLS? |
The process is:
So the key is making |
This comment explains the issue: haskell/haskell-language-server#2010 (comment)
In short, the process of getting a project's GHC version when using cabal is as slow as resolving dependencies, which can be really slow (in the provided example it takes a minute). The result is that the user gets no feedback on what is going on, because HLS can't start until we know which GHC version the project uses. Also, the GUI may freeze, and prevent other extensions from starting.
The solution is to display a VS Code "progress popup" while we're trying to get the project's GHC version.
This issue is for tracking the required changes to
vscode-haskell
while the linked issue tracks the potential changes tohaskell-language-server
.The text was updated successfully, but these errors were encountered: