1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-24 01:15:29 +02:00

Reopen when the file "found" is in the workspace.

This commit is contained in:
Ken Ryall 2008-08-14 15:31:25 +00:00
parent fb41f6daf8
commit 736c7a5e69

View file

@ -29,6 +29,7 @@ import org.eclipse.cdt.internal.core.model.ExternalTranslationUnit;
import org.eclipse.cdt.internal.ui.util.EditorUtility;
import org.eclipse.cdt.ui.CUIPlugin;
import org.eclipse.core.filesystem.URIUtil;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
@ -322,6 +323,12 @@ public class CSourceNotFoundEditor extends CommonSourceNotFoundEditor {
String filePath = tuPath.toOSString();
try {
Object[] foundElements = CDebugCorePlugin.getDefault().getCommonSourceLookupDirector().findSourceElements(filePath);
if (foundElements.length == 1 && foundElements[0] instanceof IFile)
{
EditorUtility.openInEditor(foundElements[0]);
return true;
}
else
if (foundElements.length == 1 && foundElements[0] instanceof LocalFileStorage)
{
LocalFileStorage newLocation = (LocalFileStorage) foundElements[0];