haskell / haskell/haskell-language-server

dont propose to restart ghc when not available

Open
#4,006 6 comments 0 reactions 0 assignees View on GitHub
type: enhancement
Dominant language
Haskell
Stars
3k
Forks
455
Avg merge
3d 21h
Merged PRs (30d)
13

Description

## Is your enhancement request related to a problem?

I have almost nothing in my global PATH and configure tooling on a per-project basis.
Only when entering a development shell (via `nix develop`), I get my LSP, compilers etc. available.

My current issue is that whenever I open my haskell projects with neovim for a quick look/edit without entering the nix-shell, I get this annoying popup "Failed to find the GHC version of this Cabal project.". This takes the focus and thus I first have to escape the prompt before doing anything. Restarting is bound to fail as there is no ghc in PATH

![image](https://github.com/haskell/haskell-language-server/assets/886074/ba66143d-cb0b-4806-951e-d37660a9f73e)

## Describe the solution you'd like

I would like to be able to disable the prompt but still get the error. If there is a LSP knob for that, it should be in hls but maybe it's something to configure in neovim, I am not sure yet.

## Describe alternatives you've considered

None

## Additional context

First (wrongly) reported at
https://github.com/mrcjkb/haskell-tools.nvim/issues/338#issuecomment-1903928432

https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#initializeError

Contributor guide

No contributing guide indexed for this repository

Research direction

The payload names no implementation files or tests. Start by tracing the HLS handling for a missing GHC version and its restart prompt, then check the LSP initialize-error reference; done means a configuration can suppress the prompt while retaining the error.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell
Domain
tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.