-
-
Notifications
You must be signed in to change notification settings - Fork 389
Don't suggest imports from deprecated modules #2949
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
b211bc5
to
16270c2
Compare
This is a bit tricky, I think your behaviour seems reasonable, but we should capture the design in a comment somewhere. Things are nicer for completion items, where you can explicitly tag them as deprecated... |
I'd prefer to mark deprecated items as |
This PR is only about code actions (despite the branch name), so that doesn't apply. For completions, yeah, we should do that if we don't already. |
Thanks for pointing that out, I agree. Right now, this PR works by completely forgetting that deprecated identifiers exist, so I am now changing that such that the completion code can take that into account (right now, e.g. deprecated are not marked as such in the completions). Also, nice touch that the |
Is this ready for review? |
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?