haskell / haskell/vscode-haskell

haskell.manageHLS = "PATH" ignored on initial startup

Open Beginner friendly
#1,332 2 comments 0 reactions 0 assignees View on GitHub
type: bug
Dominant language
TypeScript
Stars
597
Forks
98
PR merge metrics
No merged PRs in 30d

Description

### Your environment

MacOS

### Steps to reproduce

run vscode with
```
code --user-data-dir {empty_dir} --extensions-dir {empty_dir} .
```
with devcontainer.json having
```
"settings": {
"haskell.manageHLS": "PATH",
```

### Expected behaviour

The "How do you want the extension to manage/discover HLS and the relevant toolchain?" popup window should not appear.

### Actual behaviour

The popup window will appear.

### Include debug information

According to:
https://github.com/haskell/vscode-haskell/blob/3a8d51f0b15b0a49e98ce47a7786e4bf71c6fbbc/src/hlsBinaries.ts#L350

```
async function promptUserForManagingHls(context: ExtensionContext, manageHlsSetting: ManageHLS): Promise {
if (manageHlsSetting !== 'GHCup' && (!context.globalState.get('pluginInitialized') as boolean | null)) {
const promptMessage = `How do you want the extension to manage/discover HLS and the relevant toolchain?

Choose "Automatically" if you're in doubt.
`;
```
I have set manageHlsSetting to "PATH" in the devcontainer.json.
It does not equal to "GHCup", so the first part of the condition is true.
The plugin has not been initialized, so the second part of the condition is also true.
Hence the popup window will appear.

Workaround:
Set manageHlsSetting to "GHCup" in the devcontainer.json,
and set all the keys in "haskell.toolchain" to null to mimic the "PATH" behavior.

Contributor guide

Open the contributing guide

Research direction

Start in src/hlsBinaries.ts at promptUserForManagingHls and reproduce with an empty user-data and extensions directory using the provided devcontainer.json setting. Done means an initial startup with haskell.manageHLS set to PATH does not show the management/discovery popup; verify the existing workaround behavior is no longer required.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell, typescript, vscode
Domain
developer-experience, devtools
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
65/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.