rikvdkleij / intellij-haskell

IntelliJ plugin for Haskell
https://rikvdkleij.github.io/intellij-haskell/
Apache License 2.0
1.32k stars 95 forks source link

Better progress reporting during initial tool setup #584

Open ForNeVeR opened 4 years ago

ForNeVeR commented 4 years ago

On my machine, initial Haskell tool setup (after I've opened my first Haskell project) has taken about half an hour, and during all this time the only thing I was able to see was this spinning progress bar: image

I do believe we could improve the initial experience by:

I use IntelliJ-Haskell 1.0.0.-beta74 build on Windows, with the latest release Stack version.

IntelliJ IDEA 2020.3 Snapshot (Ultimate Edition)
Build #IU-203.833, built on July 4, 2020
IntelliJ IDEA EAP User
Expiration date: August 3, 2020
Runtime version: 11.0.7+10-b974.1 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Windows 10 10.0
GC: ParNew, ConcurrentMarkSweep
Memory: 1450M
Cores: 8
Non-Bundled Plugins: Rider UI Theme Pack, com.jetbrains.embeddedProjectJdk, intellij.haskell, Jetbrains TeamCity Plugin, com.jetbrains.intellij.api.watcher
rikvdkleij commented 4 years ago

Thanks for reporting!

separating this progress into stages (e.g. if, say, 7 libraries should be installed β€” then it should have 7 stages)

This is completely up to Stack, the plugin has no control. The only thing that plugin can do is parse the output of Stack.... and from that draw more detailed stages.

providing more useful information on every stage (I saw that stack usually prints the total progress to the console; IntelliJ-Haskell could extract this information and draw more accurate progress)

I don't see how to implement this, see also previous point.

providing the real console output from the build tools (as I said, stack is pretty okay at reporting progress, and, as a user, I feel that I'm being "robbed" of this information by not providing me the standard console, and only utilizing this less informative progress spinner)

The information in the progress bar of the background task is directly from Stack. I don't remove information from the Stack output.

Btw, I accept pull requests πŸ˜‰

ForNeVeR commented 4 years ago

Btw, I accept pull requests πŸ˜‰

Which exactly was my intention. Thanks for answer!

rikvdkleij commented 3 years ago

@ForNeVeR Do you intend to work on this? Otherwise I would suggest to close this issue.

ForNeVeR commented 3 years ago

Why? Was the progress somehow improved? If not, it is still a big issue (I heard other users complaining about it), disregard if I intend to work on it or not.

(Though I still do.)

rikvdkleij commented 3 years ago

Well, I don't know how to improve this because currently the output of Stack is shown to the user. The plugin doesn't remove info from the Stack output.

The Background task shows the information from Stack.

To see the output in a better way, one has enable the Event log.

ForNeVeR commented 3 years ago

The plugin doesn't remove info from the Stack output.

That was already your point before, but I see better progress reporting if I run Stack in terminal than when I run it in the IntelliJ.

And I'm sure this should be improved. Initial installation can take hours on some machines. We definitely shouldn't leave the user without any clues on the progress for hours; this is nonsense.

Probably Stack either hides some useful information itself when it feels it's running in a non-interactive mode (which we should be able to beat e.g. by running it in a PTY), or interferes with the way IntelliJ-Haskell reads its optput (which would be the most positive, since is easy to fix), or has some command-line options for programmatic progress reporting (which we'll have to check).

If nothing else helps, we'll have to raise a feature request at Stack, at least.

rikvdkleij commented 3 years ago

@ForNeVeR Thanks for your feedback!

Initial installation can take hours on some machines.

An option is increase the number of cores of the Stack command which installs the tools, see here http://github.com/rikvdkleij/intellij-haskell/blob/49a015e267ff3d241c12fa21cca0258754027525/src/main/scala/intellij/haskell/external/execution/StackCommandLine.scala#L82-L82. But I don't know if it will have negative side-effects on all kind of machines in general (making e.g. IntelliJ unresponsive).

The user has also the option to install the Haskell tools himself. E.g. by using Nix.

rikvdkleij commented 3 years ago

but I see better progress reporting if I run Stack in terminal than when I run it in the IntelliJ.

That's weird. Also if you compare this output with the Event log? I never noticed this but I will pay attention to this.

rikvdkleij commented 3 years ago

Just tested this with HLint. I don't see a difference in output between stack install hlint on the command line and the output I see in the Event log when I delete the cache. I'm using Ubuntu.

declension commented 3 years ago

An option is increase the number of cores of the Stack command which installs the tools, see here http://github.com/rikvdkleij/intellij-haskell/blob/49a015e267ff3d241c12fa21cca0258754027525/src/main/scala/intellij/haskell/external/execution/StackCommandLine.scala#L82-L82. But I don't know if it will have negative side-effects on all kind of machines in general (making e.g. IntelliJ unresponsive).

:+1: :+1: Oh yes, please can we do this (or have it an option)? :pray:

e.g. my new(ish) CPU has 24 (virtual) cores and using only 2 for big builds seems a real shame.

rikvdkleij commented 3 years ago

@declension I can change the number of cores to use the half of the available cores?

declension commented 3 years ago

@declension I can change the number of cores to use the half of the available cores?

Yes this sounds like a great start! Probably 0.75 would be a safe number too, but let's start with half?

rikvdkleij commented 2 years ago

@declension done in beta88, https://github.com/rikvdkleij/intellij-haskell/releases/tag/v1.0.0-beta88