use of com.jetbrains.python.psi.resolve.PyQualifiedNameResolveContext in project intellij-community by JetBrains.
the class NumpyModuleMembersProvider method addTestingModule.
private static void addTestingModule(PyFile module, List<PyCustomMember> members) {
final PyQualifiedNameResolveContext context = PyResolveImportUtil.fromFoothold(module).copyWithPlainDirectories();
final PsiElement resolved = PyResolveImportUtil.resolveQualifiedName(QualifiedName.fromDottedString("numpy.testing"), context).stream().findFirst().orElse(null);
final PsiElement testingModule = PyUtil.turnDirIntoInit(resolved);
members.add(new PyCustomMember("testing", testingModule));
}
Aggregations