pylance-release icon indicating copy to clipboard operation
pylance-release copied to clipboard

grey out unused imports transitively

Open alok opened this issue 1 year ago • 4 comments

2024-01-28-13-10-03

Since none of the subimports are used, it would be nice if the "copy" in from copy was greyed out. Ditto 'dataclasses'.

alok avatar Jan 28 '24 21:01 alok

image

it does grey them out. I assume you are using pylance not jedi?

if it still repro, can you provide us full logs as described in the troubleshooting guide?

heejaechang avatar Jan 29 '24 18:01 heejaechang

2024-02-05-19-29-10

The word copy doesn't look any dimmer than the word typing, though it has an unused import.

alok avatar Feb 06 '24 03:02 alok

I believe technically copy is used. deepcopy is not, and that's why it's greyed out. But because you imported something from copy it's in use.

rchiodo avatar Feb 06 '24 16:02 rchiodo

This is what I meant by transitive. It would be nice to grey out copy too since looking at its “uses” we see none of them are actually used and so the whole module essentially isn’t.

alok avatar Feb 06 '24 17:02 alok