Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Schorn2008-03-17 16:37:07 +0000
committerMarkus Schorn2008-03-17 16:37:07 +0000
commitd82d0c2245013b4c4f4d7ea9187be0feda5120be (patch)
tree96119f81c4f15305c586b185085d26bab1a58d19 /core/org.eclipse.cdt.core/parser
parent83c44162bff608902bb036f5a97008fdf86a4ac0 (diff)
downloadorg.eclipse.cdt-d82d0c2245013b4c4f4d7ea9187be0feda5120be.tar.gz
org.eclipse.cdt-d82d0c2245013b4c4f4d7ea9187be0feda5120be.tar.xz
org.eclipse.cdt-d82d0c2245013b4c4f4d7ea9187be0feda5120be.zip
Improves the navigation fallback, bug 102643.
Diffstat (limited to 'core/org.eclipse.cdt.core/parser')
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/index/IIndex.java16
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/EmptyCIndex.java4
2 files changed, 19 insertions, 1 deletions
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/index/IIndex.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/index/IIndex.java
index 9ec6ba390c2..75c482b6d6a 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/index/IIndex.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/index/IIndex.java
@@ -279,7 +279,7 @@ public interface IIndex {
*
* This is fully equivalent to
* <pre>
- * findBindings(new char[][]{name}, filter, monitor);
+ * findBindings(name, true, filter, monitor);
* </pre>
* @param name a name, which has to be matched by the qualified name of the bindings.
* @param filter a filter that allows for skipping parts of the index
@@ -290,6 +290,20 @@ public interface IIndex {
public IIndexBinding[] findBindings(char[] name, IndexFilter filter, IProgressMonitor monitor) throws CoreException;
/**
+ * Searches the global scope and optionally all other scopes for bindings with a given name.
+ * In case a binding exists in multiple projects, no duplicate bindings are returned.
+ * This method makes use of the BTree and is faster than the methods using patterns.
+ *
+ * @param name a name, which has to be matched by the qualified name of the bindings.
+ * @param fileScopeOnly if true, only bindings at file scope are returned
+ * @param filter a filter that allows for skipping parts of the index
+ * @param monitor a monitor to report progress, may be <code>null</code>.
+ * @return an array of bindings matching the pattern
+ * @throws CoreException
+ */
+ public IIndexBinding[] findBindings(char[] name, boolean fileScopeOnly, IndexFilter filter, IProgressMonitor monitor) throws CoreException;
+
+ /**
* Searches for all bindings with names that start with the given prefix.
* @param prefix the prefix with which all returned bindings must start
* @param fileScopeOnly if true, only bindings at file scope are returned
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/EmptyCIndex.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/EmptyCIndex.java
index d42b9b36330..71e2039001b 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/EmptyCIndex.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/EmptyCIndex.java
@@ -134,4 +134,8 @@ final public class EmptyCIndex implements IIndex {
public IIndexFile[] getAllFiles() {
return IIndexFile.EMPTY_FILE_ARRAY;
}
+
+ public IIndexBinding[] findBindings(char[] name, boolean fileScopeOnly, IndexFilter filter, IProgressMonitor monitor) {
+ return IIndexBinding.EMPTY_INDEX_BINDING_ARRAY;
+ }
} \ No newline at end of file

Back to the top