Skip to content
This repository was archived by the owner on Jan 2, 2021. It is now read-only.

Deduplicate module not found diagnostics #952

Merged
merged 8 commits into from
Dec 14, 2020
Merged

Deduplicate module not found diagnostics #952

merged 8 commits into from
Dec 14, 2020

Conversation

pepeiborra
Copy link
Collaborator

Reworked version of #943. The root problem was in the use of stale data in rules - after adding a missing import the GetDependencies rule would fail, but TypeCheck would go ahead anyway with the last successful result of GetDependencies and generate a missing module diagnostic which duplicates the one already generated by GetDependencies.

In general it seems a very bad idea to use stale data in core rules, if only because it makes it very difficult to reason about diagnostics. I have removed all other uses I've seen.

While I was debugging this with the command line driver, I found the default options to check all targets very noisy, and I changed the defaults (for the command line driver only). Moreover, I added tracing of rule failures.

Fixes haskell/haskell-language-server#630

@pepeiborra pepeiborra merged commit 6365d3c into master Dec 14, 2020
@pepeiborra pepeiborra deleted the locate-module branch December 14, 2020 13:37
pepeiborra added a commit to pepeiborra/ide that referenced this pull request Dec 29, 2020
* Trace rule errors

* Disable check parents in command line script

* Fix expectDiagnostics []

* Add a test

* remove uses of stale info within rules

The use of stale information should be limited to the leaves of the processing
tree, otherwise it becomes impossible to reason about the semantics of diagnostics

* Use stale info in the NeedsCompilation rule

* Use stale data in GetDocMap

* Fix tests that relied on unsupported behaviour of expectDiagnostics
pepeiborra added a commit to pepeiborra/ide that referenced this pull request Dec 29, 2020
* Trace rule errors

* Disable check parents in command line script

* Fix expectDiagnostics []

* Add a test

* remove uses of stale info within rules

The use of stale information should be limited to the leaves of the processing
tree, otherwise it becomes impossible to reason about the semantics of diagnostics

* Use stale info in the NeedsCompilation rule

* Use stale data in GetDocMap

* Fix tests that relied on unsupported behaviour of expectDiagnostics
pepeiborra added a commit to pepeiborra/ide that referenced this pull request Dec 29, 2020
* Trace rule errors

* Disable check parents in command line script

* Fix expectDiagnostics []

* Add a test

* remove uses of stale info within rules

The use of stale information should be limited to the leaves of the processing
tree, otherwise it becomes impossible to reason about the semantics of diagnostics

* Use stale info in the NeedsCompilation rule

* Use stale data in GetDocMap

* Fix tests that relied on unsupported behaviour of expectDiagnostics
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Two code actions for import module name; one of them is broken
2 participants