Skip to content

Invalid import is not reported and it breaks the eval plugin #4487

Open
@noughtmare

Description

@noughtmare

My environment

OS: MacOS
GHC 9.10.1 from ghcup
Project: https://github.com/noughtmare/tmp.oYnk68xwKl
LSP client: VS Codium+vscode-haskell
HLS: 2.9.0.1 from ghcup
No special configuration

Steps to reproduce

  1. open app/Main.hs
  2. wait until HLS finishes loading
  3. (optional) click the Evaluate... action

Expected behaviour

First of all, of course there is an obvious error in the project: the Foo module is not listed in the cabal file. This issue is about how HLS functions in spite of that error.

I expect an error on the line import Foo in app/Main.hs, because that module is not valid in the cabal package. Furthermore, clicking the Evaluate... action should either work without problems or it would also be acceptable if the action was not shown in the first place.

Actual behaviour

HLS reports no errors in app/Main.hs. Clicking the Evaluate... action results in a cryptic error:

eval: Internal Error: BadDependency "GhcSessionDeps"

Debug information

2025-02-05T09:27:43.927413Z | Error | eval: Internal Error: BadDependency "GhcSessionDeps"
[Error - 10:27:43] Request workspace/executeCommand failed.
  Message: eval: Internal Error: BadDependency "GhcSessionDeps"
  Code: -32603 

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions