use of com.jetbrains.python.psi.PyClass in project intellij-community by JetBrains.
the class PyUserSkeletonsClassMembersProvider method resolveMember.
@Nullable
@Override
public PsiElement resolveMember(@NotNull PyClassType classType, @NotNull String name, @Nullable PsiElement location, TypeEvalContext context) {
final PyClass cls = classType.getPyClass();
final PyClass skeleton = PyUserSkeletonsUtil.getUserSkeletonWithContext(cls, context);
if (skeleton != null) {
return findClassMember(skeleton, name, classType.isDefinition());
}
return null;
}
use of com.jetbrains.python.psi.PyClass in project intellij-community by JetBrains.
the class PyUserSkeletonsClassMembersProvider method getMembers.
@NotNull
@Override
public Collection<PyCustomMember> getMembers(@NotNull PyClassType classType, PsiElement location, TypeEvalContext typeEvalContext) {
final PyClass cls = classType.getPyClass();
final PyClass skeleton = PyUserSkeletonsUtil.getUserSkeleton(cls);
if (skeleton != null) {
return getClassMembers(skeleton, classType.isDefinition());
}
return Collections.emptyList();
}
use of com.jetbrains.python.psi.PyClass in project intellij-community by JetBrains.
the class PySignatureCacheManagerImpl method getFunctionName.
private static String getFunctionName(PyFunction function) {
String name = function.getName();
if (name == null) {
return "";
}
PyClass cls = function.getContainingClass();
if (cls != null) {
name = cls.getName() + "." + name;
}
return name;
}
use of com.jetbrains.python.psi.PyClass in project intellij-community by JetBrains.
the class PyClassRefactoringTest method findField.
private PyElement findField(final String className, final String memberName) {
final PyClass aClass = findClass(className);
final PyTargetExpression attribute = aClass.findClassAttribute(memberName, false, null);
if (attribute != null) {
return attribute;
}
return aClass.findInstanceAttribute(memberName, false);
}
use of com.jetbrains.python.psi.PyClass in project intellij-community by JetBrains.
the class PyExtractSuperclassPresenterTest method configureByClass.
/**
* Configures presenter by class
*
* @param name name of class
* @return presenter
*/
@NotNull
private PyExtractSuperclassPresenterImpl configureByClass(@NotNull final String name) {
final PyClass childClass = getClassByName(name);
final PyMemberInfoStorage storage = new PyMemberInfoStorage(childClass);
return new PyExtractSuperclassPresenterImpl(myView, childClass, storage);
}
Aggregations