1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-24 09:25:31 +02:00

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
This commit is contained in:
Bogdan Gheorghe 2005-07-08 20:57:48 +00:00
parent 690d999a7c
commit 597791a3c7
3 changed files with 17 additions and 4 deletions

View file

@ -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);

View file

@ -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++){

View file

@ -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();