Skip to content

All-Red after creation of new module with inconsistent name #866

Closed
@laura-dietz

Description

@laura-dietz

While I think there are multiple issues that are visible in the issue below, the main problem is that ghcide is not trying to recompile the all-red file even after the bug is fixed. This was also getting in my way on other occasions, where there was a mistake in a different component that the all-red file was relying on.


I commonly run into "all red" issues when I create a new module with disagreeing filename and the module name.

Sure, this is 100% my fault -- but it would be great to get an error message such as "module name and filename disagree".

The actual faulty line (the module statement in the new file), is not marked as faulty.

Instead I get all-reds in a large number of source files, and one of the following cryptic error messages:

Failed to parse result of calling cabal
Resolving dependencies...
[...]
[scroll several pages down]

[...]
 File name does not match module name:

Or (if I was messing with the hie.yaml file)

AesonException "Error in $.cradle: Expected an object with path and component keys"

(this error message persists even if I revert the hie.yaml file to its original state)

Even when I fix my mistake, the all-reds and error messages persist. It is as if ghcide would have given up on trying to compile my code. (see screenshot below) At this point only killall ghcide seems to reset things.

all-red-on-new-module-file

My interpretation is that since ghcide has never seen the new module, it does not know which source file to blame --- although cabal's error message is pretty clear.

Ghcide version 0.2.0 (commit 4149ab5)
GHC version ghc-8.8.3.20200530 (custom version with allred fix)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions