Open sethladd opened 8 years ago
@scheglov, is something like this already handled by the analysis server - and something I need to wire up - or would this be a feature request?
If the library package:flutter/widget.dart
is know to the analysis context, i.e. it is analyzer because any other library (implicit or explicit) imports it, then the Analysis Server will produce the import quick fix. If it not used, and exists only as an imported package in pubspec.yaml
- we know nothing about it, and don't produce the quick fix.
Hi @scheglov it comes from a package in my pubspec.yaml. The analyzer doesn't scan all dependencies to make them potentially available?
No, analyzer does not look at code which is not in the project and is not referenced from a project library.
@sethladd I had a prototype a while back that would use a service to index the places you might have got this from. So you could write a type and it would offer the various packages that export it. It this is important enough, and there is agreement to from the other folks, I can fairly easily bring it back to life and productionise...
The baby step here might be "look in all packages referenced by .packages/pubspec.lock". Don't wait for the library to be manually imported (even transitively). I've already done the work to run pub get
... the library is sitting right there to be imported :)
cc @kevmoo FYI
I tried Control-1 on a name that wasn't imported, but is available from a library provided by a package.
I saw these options:
Could we add an option, like "Import package:flutter/widget.dart" ?
Atom 1.4.1, dartlang 0.5.3, SDK 1.14.0-dev.7.2 running on macos.