mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-06 17:26:01 +02:00
fix for bug 64986 - handle containers in CSearchScope
This commit is contained in:
parent
2a7ee92a8a
commit
7858f60f7e
2 changed files with 21 additions and 5 deletions
|
@ -1,3 +1,6 @@
|
|||
2004-06-10 Andrew Niefer
|
||||
fix bug 64986 - handle Containers in CSearchScope
|
||||
|
||||
2004-05-26 Andrew Niefer
|
||||
Modified search to use ASTUtil.getFunctionParameterTypes to get the strings to search for
|
||||
functions with specific parameters.
|
||||
|
|
|
@ -16,6 +16,7 @@ import java.util.HashSet;
|
|||
|
||||
import org.eclipse.cdt.core.CProjectNature;
|
||||
import org.eclipse.cdt.core.model.CModelException;
|
||||
import org.eclipse.cdt.core.model.ICContainer;
|
||||
import org.eclipse.cdt.core.model.ICElement;
|
||||
import org.eclipse.cdt.core.model.ICProject;
|
||||
import org.eclipse.cdt.core.model.IMember;
|
||||
|
@ -191,15 +192,13 @@ public class CSearchScope implements ICSearchScope {
|
|||
while (searchedElement != null) {
|
||||
if (searchedElement.equals(scopeElement)) {
|
||||
return true;
|
||||
} else {
|
||||
searchedElement = searchedElement.getParent();
|
||||
}
|
||||
}
|
||||
searchedElement = searchedElement.getParent();
|
||||
}
|
||||
}
|
||||
return false;
|
||||
} else {
|
||||
return this.encloses(this.fullPath(element));
|
||||
}
|
||||
return this.encloses(this.fullPath(element));
|
||||
}
|
||||
|
||||
public IPath[] enclosingProjects() {
|
||||
|
@ -215,6 +214,9 @@ public class CSearchScope implements ICSearchScope {
|
|||
case ICElement.C_PROJECT:
|
||||
// a workspace scope should be used
|
||||
break;
|
||||
case ICElement.C_CCONTAINER:
|
||||
add( (ICContainer) element );
|
||||
break;
|
||||
default:
|
||||
if (element instanceof IMember) {
|
||||
if (this.elements == null) {
|
||||
|
@ -235,6 +237,17 @@ public class CSearchScope implements ICSearchScope {
|
|||
}
|
||||
}
|
||||
|
||||
public void add( ICContainer container ){
|
||||
ICElement [] children = null;
|
||||
try {
|
||||
children = container.getChildren();
|
||||
} catch (CModelException e) {
|
||||
return;
|
||||
}
|
||||
for( int i = 0; i < children.length; i++ ){
|
||||
add( children[i] );
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @param finalPath
|
||||
*/
|
||||
|
|
Loading…
Add table
Reference in a new issue