Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Poganski2021-04-22 11:58:46 +0000
committerMickael Istria2021-04-26 15:15:32 +0000
commitb69cdd5ca42f04ce587a0be08da2b269d45a3475 (patch)
tree40c5ed498ca90dafbaee198407ec81c6dcc79ea2
parent34b30bce9608a8fab1e06c12fe14e609c0ccb660 (diff)
downloadeclipse.platform.text-b69cdd5ca42f04ce587a0be08da2b269d45a3475.tar.gz
eclipse.platform.text-b69cdd5ca42f04ce587a0be08da2b269d45a3475.tar.xz
eclipse.platform.text-b69cdd5ca42f04ce587a0be08da2b269d45a3475.zip
Bug 572871 - Quick Search ignores virtual folders
Makes sure virtual folders are not ignored. As a result Quick Search will visit linked folders contained in virtual folders. So we can get search results from the linked location. This is desired when we have no 'overlapping projects'. Change-Id: Iffbcfe9b73f7726818935a4fe12451fb59da5388 Signed-off-by: Jan Poganski <jan.poganski+eclipse@outlook.com> Reviewed-on: https://git.eclipse.org/r/c/platform/eclipse.platform.text/+/179717 Tested-by: Platform Bot <platform-bot@eclipse.org> Reviewed-by: Mickael Istria <mistria@redhat.com>
-rw-r--r--org.eclipse.text.quicksearch.tests/META-INF/MANIFEST.MF2
-rw-r--r--org.eclipse.text.quicksearch.tests/pom.xml2
-rw-r--r--org.eclipse.text.quicksearch.tests/src/org/eclipse/text/quicksearch/tests/DefaultPriorityFunctionTest.java15
-rw-r--r--org.eclipse.text.quicksearch/src/org/eclipse/text/quicksearch/internal/core/priority/DefaultPriorityFunction.java2
4 files changed, 18 insertions, 3 deletions
diff --git a/org.eclipse.text.quicksearch.tests/META-INF/MANIFEST.MF b/org.eclipse.text.quicksearch.tests/META-INF/MANIFEST.MF
index fc4e88daddb..ff643aee02f 100644
--- a/org.eclipse.text.quicksearch.tests/META-INF/MANIFEST.MF
+++ b/org.eclipse.text.quicksearch.tests/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.text.quicksearch.tests
-Bundle-Version: 1.1.0.qualifier
+Bundle-Version: 1.1.100.qualifier
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.text.quicksearch;bundle-version="1.0.300",
org.eclipse.core.resources,
diff --git a/org.eclipse.text.quicksearch.tests/pom.xml b/org.eclipse.text.quicksearch.tests/pom.xml
index 72050064e16..51f42ba0903 100644
--- a/org.eclipse.text.quicksearch.tests/pom.xml
+++ b/org.eclipse.text.quicksearch.tests/pom.xml
@@ -24,7 +24,7 @@
</parent>
<groupId>org.eclipse.text</groupId>
<artifactId>org.eclipse.text.quicksearch.tests</artifactId>
- <version>1.1.0-SNAPSHOT</version>
+ <version>1.1.100-SNAPSHOT</version>
<packaging>eclipse-test-plugin</packaging>
<properties>
<testSuite>${project.artifactId}</testSuite>
diff --git a/org.eclipse.text.quicksearch.tests/src/org/eclipse/text/quicksearch/tests/DefaultPriorityFunctionTest.java b/org.eclipse.text.quicksearch.tests/src/org/eclipse/text/quicksearch/tests/DefaultPriorityFunctionTest.java
index b3a52e42102..4c7afc93a4d 100644
--- a/org.eclipse.text.quicksearch.tests/src/org/eclipse/text/quicksearch/tests/DefaultPriorityFunctionTest.java
+++ b/org.eclipse.text.quicksearch.tests/src/org/eclipse/text/quicksearch/tests/DefaultPriorityFunctionTest.java
@@ -18,6 +18,7 @@ import static org.junit.Assert.assertNotEquals;
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.text.quicksearch.internal.core.priority.DefaultPriorityFunction;
@@ -61,4 +62,18 @@ public class DefaultPriorityFunctionTest {
assertNotEquals(PriorityFunction.PRIORITY_IGNORE, fPriorityFunction.priority(f1), 1.0);
}
+ @Test
+ public void testDoNotIgnoreVirtualFolder() throws Exception {
+ IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
+
+ IProject p3 = root.getProject("p3");
+ p3.create(null);
+ p3.open(null);
+
+ IFolder f2 = p3.getFolder("f2");
+ f2.create(IResource.VIRTUAL, true, null);
+
+ assertNotEquals(PriorityFunction.PRIORITY_IGNORE, fPriorityFunction.priority(f2), 1.0);
+ }
+
}
diff --git a/org.eclipse.text.quicksearch/src/org/eclipse/text/quicksearch/internal/core/priority/DefaultPriorityFunction.java b/org.eclipse.text.quicksearch/src/org/eclipse/text/quicksearch/internal/core/priority/DefaultPriorityFunction.java
index c30fac403c1..4648b79bb06 100644
--- a/org.eclipse.text.quicksearch/src/org/eclipse/text/quicksearch/internal/core/priority/DefaultPriorityFunction.java
+++ b/org.eclipse.text.quicksearch/src/org/eclipse/text/quicksearch/internal/core/priority/DefaultPriorityFunction.java
@@ -99,7 +99,7 @@ public class DefaultPriorityFunction extends PriorityFunction {
* See https://issuetracker.springsource.com/browse/STS-3783
*/
private boolean isIgnoredLinkedContainer(IResource resource) {
- if (!(resource instanceof IContainer) || !resource.isLinked(IResource.NONE)) {
+ if (!(resource instanceof IContainer) || !resource.isLinked(IResource.NONE) || resource.isVirtual()) {
return false;
}

Back to the top