mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-08 02:06:01 +02:00
Enhanced loops.
This commit is contained in:
parent
3f93fe42c4
commit
a07af9a6d4
1 changed files with 27 additions and 38 deletions
|
@ -60,6 +60,7 @@ public class CSourceLookupDirector extends AbstractSourceLookupDirector {
|
||||||
public void initializeParticipants() {
|
public void initializeParticipants() {
|
||||||
addParticipants(new ISourceLookupParticipant[]{ new CSourceLookupParticipant() });
|
addParticipants(new ISourceLookupParticipant[]{ new CSourceLookupParticipant() });
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.debug.core.sourcelookup.ISourceLookupDirector#supportsSourceContainerType(org.eclipse.debug.core.sourcelookup.ISourceContainerType)
|
* @see org.eclipse.debug.core.sourcelookup.ISourceLookupDirector#supportsSourceContainerType(org.eclipse.debug.core.sourcelookup.ISourceContainerType)
|
||||||
*/
|
*/
|
||||||
|
@ -69,9 +70,8 @@ public class CSourceLookupDirector extends AbstractSourceLookupDirector {
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean contains(String source) {
|
public boolean contains(String source) {
|
||||||
ISourceContainer[] containers = getSourceContainers();
|
for (ISourceContainer cont : getSourceContainers()) {
|
||||||
for (int i = 0; i < containers.length; ++i) {
|
if (contains(cont, source))
|
||||||
if (contains(containers[i], source))
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
@ -80,9 +80,8 @@ public class CSourceLookupDirector extends AbstractSourceLookupDirector {
|
||||||
public boolean contains(ICBreakpoint breakpoint) {
|
public boolean contains(ICBreakpoint breakpoint) {
|
||||||
try {
|
try {
|
||||||
String handle = breakpoint.getSourceHandle();
|
String handle = breakpoint.getSourceHandle();
|
||||||
ISourceContainer[] containers = getSourceContainers();
|
for (ISourceContainer cont : getSourceContainers()) {
|
||||||
for (int i = 0; i < containers.length; ++i) {
|
if (contains(cont, handle))
|
||||||
if (contains(containers[i], handle))
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
} catch (CoreException e) {
|
} catch (CoreException e) {
|
||||||
|
@ -91,9 +90,8 @@ public class CSourceLookupDirector extends AbstractSourceLookupDirector {
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean contains(IProject project) {
|
public boolean contains(IProject project) {
|
||||||
ISourceContainer[] containers = getSourceContainers();
|
for (ISourceContainer cont : getSourceContainers()) {
|
||||||
for (int i = 0; i < containers.length; ++i) {
|
if (contains(cont, project))
|
||||||
if (contains(containers[i], project))
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
@ -104,10 +102,8 @@ public class CSourceLookupDirector extends AbstractSourceLookupDirector {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
ISourceContainer[] containers;
|
for (ISourceContainer cont : container.getSourceContainers()) {
|
||||||
containers = container.getSourceContainers();
|
if (contains(cont, project))
|
||||||
for (int i = 0; i < containers.length; ++i) {
|
|
||||||
if (contains(containers[i], project))
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
} catch (CoreException e) {
|
} catch (CoreException e) {
|
||||||
|
@ -157,10 +153,8 @@ public class CSourceLookupDirector extends AbstractSourceLookupDirector {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
ISourceContainer[] containers;
|
for (ISourceContainer cont : container.getSourceContainers()) {
|
||||||
containers = container.getSourceContainers();
|
if (contains(cont, sourceName))
|
||||||
for (int i = 0; i < containers.length; ++i) {
|
|
||||||
if (contains(containers[i], sourceName))
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
} catch (CoreException e) {
|
} catch (CoreException e) {
|
||||||
|
@ -169,17 +163,14 @@ public class CSourceLookupDirector extends AbstractSourceLookupDirector {
|
||||||
}
|
}
|
||||||
|
|
||||||
public IPath getCompilationPath(String sourceName) {
|
public IPath getCompilationPath(String sourceName) {
|
||||||
IPath path = null;
|
for (ISourceContainer cont : getSourceContainers()) {
|
||||||
ISourceContainer[] containers = getSourceContainers();
|
IPath path = getCompilationPath(cont, sourceName);
|
||||||
for (int i = 0; i < containers.length; ++i) {
|
if (path != null) {
|
||||||
IPath cp = getCompilationPath(containers[i], sourceName);
|
|
||||||
if (cp != null) {
|
|
||||||
path = cp;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return path;
|
return path;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
private IPath getCompilationPath(ISourceContainer container, String sourceName) {
|
private IPath getCompilationPath(ISourceContainer container, String sourceName) {
|
||||||
if (container instanceof MappingSourceContainer) {
|
if (container instanceof MappingSourceContainer) {
|
||||||
|
@ -187,10 +178,8 @@ public class CSourceLookupDirector extends AbstractSourceLookupDirector {
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
ISourceContainer[] containers;
|
for (ISourceContainer cont : container.getSourceContainers()) {
|
||||||
containers = container.getSourceContainers();
|
IPath path = getCompilationPath(cont, sourceName);
|
||||||
for (int i = 0; i < containers.length; ++i) {
|
|
||||||
IPath path = getCompilationPath(containers[i], sourceName);
|
|
||||||
if (path != null)
|
if (path != null)
|
||||||
return path;
|
return path;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue