From e9b77623e549b6f3968d1af631e9403624fcfd3f Mon Sep 17 00:00:00 2001 From: Fabio Zadrozny Date: Wed, 1 May 2024 08:07:26 -0300 Subject: [PATCH] A few improvements in the internal stubs. --- .../python/pydev/shared_core/resource_stubs/FileStub.java | 5 +++++ .../python/pydev/shared_core/resource_stubs/FolderStub.java | 5 +++++ .../python/pydev/shared_core/resource_stubs/ProjectStub.java | 5 +++++ 3 files changed, 15 insertions(+) diff --git a/plugins/org.python.pydev.shared_core/src/org/python/pydev/shared_core/resource_stubs/FileStub.java b/plugins/org.python.pydev.shared_core/src/org/python/pydev/shared_core/resource_stubs/FileStub.java index e0a24bee2d..a2cdfdd868 100644 --- a/plugins/org.python.pydev.shared_core/src/org/python/pydev/shared_core/resource_stubs/FileStub.java +++ b/plugins/org.python.pydev.shared_core/src/org/python/pydev/shared_core/resource_stubs/FileStub.java @@ -48,6 +48,11 @@ public URI getLocationURI() { return file.toURI(); } + @Override + public boolean isAccessible() { + return file.exists(); + } + @Override public IPath getLocation() { return Path.fromOSString(file.toString()); diff --git a/plugins/org.python.pydev.shared_core/src/org/python/pydev/shared_core/resource_stubs/FolderStub.java b/plugins/org.python.pydev.shared_core/src/org/python/pydev/shared_core/resource_stubs/FolderStub.java index 129b6be18a..18d6a53b31 100644 --- a/plugins/org.python.pydev.shared_core/src/org/python/pydev/shared_core/resource_stubs/FolderStub.java +++ b/plugins/org.python.pydev.shared_core/src/org/python/pydev/shared_core/resource_stubs/FolderStub.java @@ -40,6 +40,11 @@ public FolderStub(IProjectStub stub, IContainer parent, File parentFile, boolean this.parent = parent; } + @Override + public boolean isAccessible() { + return this.folder.exists(); + } + @Override public IContainer getParent() { if (parent != null) { diff --git a/plugins/org.python.pydev.shared_core/src/org/python/pydev/shared_core/resource_stubs/ProjectStub.java b/plugins/org.python.pydev.shared_core/src/org/python/pydev/shared_core/resource_stubs/ProjectStub.java index 4c40c8b6a9..793b8292a6 100644 --- a/plugins/org.python.pydev.shared_core/src/org/python/pydev/shared_core/resource_stubs/ProjectStub.java +++ b/plugins/org.python.pydev.shared_core/src/org/python/pydev/shared_core/resource_stubs/ProjectStub.java @@ -108,6 +108,11 @@ public boolean isOpen() { } + @Override + public boolean isAccessible() { + return this.projectRoot.exists(); + } + @Override public void deleteMarkers(String type, boolean includeSubtypes, int depth) throws CoreException {