mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-09-10 12:03:16 +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:
parent
690d999a7c
commit
597791a3c7
3 changed files with 17 additions and 4 deletions
|
@ -216,9 +216,9 @@ class CTagEntry{
|
||||||
private char[][] getFunctionSignature() {
|
private char[][] getFunctionSignature() {
|
||||||
String signature = (String) tagExtensionField.get(CTagsConsoleParser.SIGNATURE);
|
String signature = (String) tagExtensionField.get(CTagsConsoleParser.SIGNATURE);
|
||||||
|
|
||||||
if (signature.equals("()")){
|
if (signature.equals("()")){ //$NON-NLS-1$
|
||||||
char[][] voidSignature = new char[1][];
|
char[][] voidSignature = new char[1][];
|
||||||
voidSignature[0] = "void".toCharArray();
|
voidSignature[0] = "void".toCharArray(); //$NON-NLS-1$
|
||||||
return voidSignature;
|
return voidSignature;
|
||||||
}
|
}
|
||||||
return CSearchPattern.scanForParameters(signature);
|
return CSearchPattern.scanForParameters(signature);
|
||||||
|
|
|
@ -69,11 +69,15 @@ public class CSearchScope implements ICSearchScope {
|
||||||
IProject project = cProject.getProject();
|
IProject project = cProject.getProject();
|
||||||
if (!project.isAccessible() || !visitedProjects.add(project)) return;
|
if (!project.isAccessible() || !visitedProjects.add(project)) return;
|
||||||
this.addEnclosingProject(project.getFullPath());
|
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();
|
ICElement[] projChildren = cProject.getChildren();
|
||||||
for (int i=0; i< projChildren.length; i++){
|
for (int i=0; i< projChildren.length; i++){
|
||||||
this.add(projChildren[i]);
|
this.add(projChildren[i]);
|
||||||
}
|
}*/
|
||||||
|
|
||||||
//Add the include paths to the scope
|
//Add the include paths to the scope
|
||||||
IIncludeReference[] includeRefs = cProject.getIncludeReferences();
|
IIncludeReference[] includeRefs = cProject.getIncludeReferences();
|
||||||
for (int i=0; i<includeRefs.length; i++){
|
for (int i=0; i<includeRefs.length; i++){
|
||||||
|
|
|
@ -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.IASTName;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTNode;
|
import org.eclipse.cdt.core.dom.ast.IASTNode;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit;
|
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.ICElement;
|
||||||
import org.eclipse.cdt.core.model.ICProject;
|
import org.eclipse.cdt.core.model.ICProject;
|
||||||
import org.eclipse.cdt.core.parser.ParseError;
|
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();
|
LimitTo limitTo = getLimitTo();
|
||||||
ICSearchScope searchScope = null;
|
ICSearchScope searchScope = null;
|
||||||
searchScope = getScope();
|
searchScope = getScope();
|
||||||
|
|
Loading…
Add table
Reference in a new issue