mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
PY-27241: use django skeletons instead of java code
This commit is contained in:
+1
-1
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user