use of com.jetbrains.python.codeInsight.imports.PyImportCandidateProvider in project intellij by bazelbuild.
the class PyImportResolverStrategyTestCase method getImportQuickFix.
static AutoImportQuickFix getImportQuickFix(PyElement unresolvedSymbol) {
PsiReference ref = unresolvedSymbol.getReference();
assertThat(ref).isNotNull();
String text = ref.getElement().getText();
AutoImportQuickFix fix = new AutoImportQuickFix(unresolvedSymbol, ref.getClass(), text, false);
for (PyImportCandidateProvider provider : Extensions.getExtensions(PyImportCandidateProvider.EP_NAME)) {
provider.addImportCandidates(ref, text, fix);
}
fix.sortCandidates();
return fix;
}
Aggregations