Skip to content

Unused imports hint misses an unused import #39434

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

Closed
jwren opened this issue Nov 18, 2019 · 2 comments
Closed

Unused imports hint misses an unused import #39434

jwren opened this issue Nov 18, 2019 · 2 comments
Labels
devexp-server Issues related to some aspect of the analysis server legacy-area-analyzer Use area-devexp instead.

Comments

@jwren
Copy link
Member

jwren commented Nov 18, 2019

Missing verification in unused imports hint:

if some file is imported using 2 different URIs, the second one should be flagged as unused. Example: in the analyzer workspace.dart file, include

import 'package:analyzer/src/workspace/bazel.dart';
import 'bazel.dart';
@jwren jwren added the devexp-server Issues related to some aspect of the analysis server label Nov 18, 2019
@srawlins
Copy link
Member

Duplicate of #24073

@srawlins srawlins marked this as a duplicate of #24073 Nov 19, 2019
@mit-mit mit-mit added the legacy-area-analyzer Use area-devexp instead. label Nov 20, 2019
@srawlins
Copy link
Member

srawlins commented Dec 7, 2019

Oops, this is actually more a duplicate of #23788 or #32601; @lrhn 's explanation here is a good explanation:

That is the expected behavior. A library is identified by the URI used to point to it (after resolution and nomalization). If you use two different URIs to import what ends up being the same file, it's still treated as two different libraries...

@srawlins srawlins closed this as completed Dec 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
devexp-server Issues related to some aspect of the analysis server legacy-area-analyzer Use area-devexp instead.
Projects
None yet
Development

No branches or pull requests

3 participants