PY-27241: use django skeletons instead of java code

This commit is contained in:
Ilya.Kazakevich
2017-12-04 03:16:35 +03:00
parent fb39701de0
commit db1f9ce026
5 changed files with 9 additions and 7 deletions
@@ -28,7 +28,7 @@ public class PyUserSkeletonsClassMembersProvider extends PyClassMembersProviderB
@Override
public Collection<PyCustomMember> getMembers(@NotNull PyClassType classType, PsiElement location, @NotNull TypeEvalContext context) {
final PyClass cls = classType.getPyClass();
final PyClass skeleton = PyUserSkeletonsUtil.getUserSkeleton(cls);
final PyClass skeleton = PyUserSkeletonsUtil.getUserSkeletonWithContext(cls, context);
if (skeleton != null) {
return getClassMembers(skeleton, classType.isDefinition());
}
@@ -68,12 +68,14 @@ public class PythonMockSdk {
final LanguageLevel level = LanguageLevel.fromPythonVersion(version);
final VirtualFile typeShedDir = PyTypeShed.INSTANCE.getDirectory();
PyTypeShed.INSTANCE.findRootsForLanguageLevel(level).forEach(path -> {
final VirtualFile file = typeShedDir.findFileByRelativePath(path);
if (file != null) {
roots.putValue(OrderRootType.CLASSES, file);
}
});
if (typeShedDir != null) {
PyTypeShed.INSTANCE.findRootsForLanguageLevel(level).forEach(path -> {
final VirtualFile file = typeShedDir.findFileByRelativePath(path);
if (file != null) {
roots.putValue(OrderRootType.CLASSES, file);
}
});
}
String mock_stubs_path = mock_path + PythonSdkType.SKELETON_DIR_NAME;
roots.putValue(PythonSdkType.BUILTIN_ROOT_TYPE, LocalFileSystem.getInstance().refreshAndFindFileByPath(mock_stubs_path));