Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBogdan Gheorghe2005-07-08 16:57:48 -0400
committerBogdan Gheorghe2005-07-08 16:57:48 -0400
commit597791a3c72540c72b12eff105c4c8e9f156dd20 (patch)
tree8708fc3e6c353c8e94fe107fa5510f0691647014
parent690d999a7cc54b2776623c281fdf2a5edc9bf01b (diff)
downloadorg.eclipse.cdt-597791a3c72540c72b12eff105c4c8e9f156dd20.tar.gz
org.eclipse.cdt-597791a3c72540c72b12eff105c4c8e9f156dd20.tar.xz
org.eclipse.cdt-597791a3c72540c72b12eff105c4c8e9f156dd20.zip
Fix for 93127: [Search] we do not have an icon for searching for labels
Fix for 99161: Open Declaration's CSearchScope takes too long to create
-rw-r--r--core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/ctagsindexer/CTagEntry.java4
-rw-r--r--core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/CSearchScope.java8
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/actions/FindAction.java9
3 files changed, 17 insertions, 4 deletions
diff --git a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/ctagsindexer/CTagEntry.java b/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/ctagsindexer/CTagEntry.java
index 76e78ffe0e..f8b448ccb6 100644
--- a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/ctagsindexer/CTagEntry.java
+++ b/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/ctagsindexer/CTagEntry.java
@@ -216,9 +216,9 @@ class CTagEntry{
private char[][] getFunctionSignature() {
String signature = (String) tagExtensionField.get(CTagsConsoleParser.SIGNATURE);
- if (signature.equals("()")){
+ if (signature.equals("()")){ //$NON-NLS-1$
char[][] voidSignature = new char[1][];
- voidSignature[0] = "void".toCharArray();
+ voidSignature[0] = "void".toCharArray(); //$NON-NLS-1$
return voidSignature;
}
return CSearchPattern.scanForParameters(signature);
diff --git a/core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/CSearchScope.java b/core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/CSearchScope.java
index 0b8ff6b73b..fea32b038c 100644
--- a/core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/CSearchScope.java
+++ b/core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/CSearchScope.java
@@ -69,11 +69,15 @@ public class CSearchScope implements ICSearchScope {
IProject project = cProject.getProject();
if (!project.isAccessible() || !visitedProjects.add(project)) return;
this.addEnclosingProject(project.getFullPath());
- //Add the children of the project to the scope
+
+ this.add(project.getFullPath(),true);
+
+ /*//Add the children of the project to the scope
ICElement[] projChildren = cProject.getChildren();
for (int i=0; i< projChildren.length; i++){
this.add(projChildren[i]);
- }
+ }*/
+
//Add the include paths to the scope
IIncludeReference[] includeRefs = cProject.getIncludeReferences();
for (int i=0; i<includeRefs.length; i++){
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/actions/FindAction.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/actions/FindAction.java
index ebd66e2050..bf7dc5ec91 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/actions/FindAction.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/actions/FindAction.java
@@ -24,6 +24,7 @@ import org.eclipse.cdt.core.dom.ast.ASTVisitor;
import org.eclipse.cdt.core.dom.ast.IASTName;
import org.eclipse.cdt.core.dom.ast.IASTNode;
import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit;
+import org.eclipse.cdt.core.dom.ast.ILabel;
import org.eclipse.cdt.core.model.ICElement;
import org.eclipse.cdt.core.model.ICProject;
import org.eclipse.cdt.core.parser.ParseError;
@@ -214,6 +215,14 @@ public abstract class FindAction extends SelectionParseAction {
}
}
+ //Don't allow searches for labels since i)there is no corresponding ICElement
+ //and thus no label provider and ii) it doesn't make sense to do a global search
+ //for a local element
+ if (foundName != null && foundName.resolveBinding() instanceof ILabel) {
+ operationNotAvailable(CSEARCH_OPERATION_OPERATION_UNAVAILABLE_MESSAGE);
+ return;
+ }
+
LimitTo limitTo = getLimitTo();
ICSearchScope searchScope = null;
searchScope = getScope();

Back to the top