Don't suggest imports from deprecated modules #2949
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #2415
I tested this manually for now; but I will also try to come up with a regression test, will remove draft status when that is done.
Concerning the concrete changes in behavior, have a look at this project, specifically the file
src/B.hs
:It contains four things which are not in scope, so HLS shows code actions for adding imports for them.
hello
: A non-deprecated identifier from the moduleA
, but also reexported from the deprecated moduleAD
.hello
from bothA
andAD
.A
.foo
: A deprecated identifier from a deprecated module.AD
.AD
. My only guess it that this is due to HIE files not containing deprecation information? Also compare tooffsetTimeIncrease
.!?
: The motivation example from Import extension plugin: don't suggest imports from deprecated modules #2415, now works as expected.offsetTimeIncrease
: A deprecated identifier from the non-deprecated moduleSystem.Time.Extra
.Extra
andSystem.Time.Extra
.Any opinions on whether this behavior is fine?