vscode-haskell icon indicating copy to clipboard operation
vscode-haskell copied to clipboard

HLS wants to install Stack

Open AlexeyRaga opened this issue 3 years ago • 9 comments

Every time I open (or reload) a project it asks me to install Stack. Not even asks, it informs me that it needs to. Which isn't true, because I don't use Stack and when I say "no" then it works just fine.

For projects that don't use Stack, can this notification be not shown? Or, at least, has "No, don't ask again" button for parity?

It is a bit annoying because if I don't click "No" in time then the notification disappears, but HLS doesn't work for the project until I re-open it and click "No" in that notification popup.

Your environment

Which OS do you use:

MacOS

Steps to reproduce

Open any project that doesn't use Stack

Expected behaviour

Project opens, Stack isn't mentioned

Actual behaviour

image

AlexeyRaga avatar Aug 06 '22 03:08 AlexeyRaga

This popup was suggested by @wz1000

I was initially against it, because I find it questionable ergonomics.

You can disable it easily, see https://github.com/haskell/vscode-haskell#setting-a-specific-toolchain

Detecting whether a project uses stack or cabal is not as simple as it seems. We could parse hie.yaml however and derive from there. Wdyt @fendor ?

hasufell avatar Aug 06 '22 04:08 hasufell

Most projects don't use a hie.yaml, afaik, and ideally we shouldn't have to write it for the IDE to function as we intend.

Maybe a global option to never install stack is an option? E.g., add a fourth button saying "No, never install Stack"

fendor avatar Aug 06 '22 07:08 fendor

Maybe a global option to never install stack is an option? E.g., add a fourth button saying "No, never install Stack"

I think more popups just make it worse.

hasufell avatar Aug 06 '22 07:08 hasufell

Absolutely, we already have too many pop-ups, I meant re-using this one, though.

fendor avatar Aug 06 '22 07:08 fendor

Absolutely, we already have too many pop-ups, I meant re-using this one, though.

And then another button: "never install cabal"? :sweat_smile:

hasufell avatar Aug 06 '22 07:08 hasufell

In the same pop-up that currently asks you whether it should install cabal, yeah. Probably even for the ghc installation, since maybe people want to use stack provided ghc bindists.

I am, as you may notice, also not convinced this is the best approach since we just have half a dozen of pop-ups...

fendor avatar Aug 06 '22 07:08 fendor

And then another button: "never install cabal"? sweat_smile

@hasufell but that is in a different Cabal popup, right?

If clicking the Never button added "haskell.toolchain": ["XYZ": null] to the configuration then you would only have to deal with it once per project.

That seems more ergonomic to me than discovering this Issue and through trial and error settling on:

{
    "haskell.toolchain": {
        "stack": null
    }
}

(HLS docs recommendation gave me the Cabal popup for recommended Cabal, so deleting autodetect just fine.)

Previously I was using hardcoded PATH in options instead of GHCup, so apologies that I am late to the party. :sweat_smile:

xsebek avatar Jan 08 '23 23:01 xsebek

That seems more ergonomic to me

Only at a glance. Changing user configuration is hard. Do we just destructively overwrite? Prompt another time?

No, I think the popups will have to go. It's not good UX.

hasufell avatar Jan 09 '23 02:01 hasufell

While you're at it, I'd really appreciate if you could disable the "no cradle found" popup, too. I'm brand-new to Haskell and all I wanted was to explore the language itself first, before learning about any more professional-level build tools. The proper AST-based syntax highlighting + the inferred type notations are really helpful for learning, so I'd still love to use this extension, but without any Cabal/Stack/Cradle expectations until I gradually opt in to each one.

twome avatar Dec 09 '23 03:12 twome