mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-10 09:45:39 +02:00
Reopen when the file "found" is in the workspace.
This commit is contained in:
parent
fb41f6daf8
commit
736c7a5e69
1 changed files with 7 additions and 0 deletions
|
@ -29,6 +29,7 @@ import org.eclipse.cdt.internal.core.model.ExternalTranslationUnit;
|
||||||
import org.eclipse.cdt.internal.ui.util.EditorUtility;
|
import org.eclipse.cdt.internal.ui.util.EditorUtility;
|
||||||
import org.eclipse.cdt.ui.CUIPlugin;
|
import org.eclipse.cdt.ui.CUIPlugin;
|
||||||
import org.eclipse.core.filesystem.URIUtil;
|
import org.eclipse.core.filesystem.URIUtil;
|
||||||
|
import org.eclipse.core.resources.IFile;
|
||||||
import org.eclipse.core.runtime.CoreException;
|
import org.eclipse.core.runtime.CoreException;
|
||||||
import org.eclipse.core.runtime.IPath;
|
import org.eclipse.core.runtime.IPath;
|
||||||
import org.eclipse.core.runtime.Path;
|
import org.eclipse.core.runtime.Path;
|
||||||
|
@ -322,6 +323,12 @@ public class CSourceNotFoundEditor extends CommonSourceNotFoundEditor {
|
||||||
String filePath = tuPath.toOSString();
|
String filePath = tuPath.toOSString();
|
||||||
try {
|
try {
|
||||||
Object[] foundElements = CDebugCorePlugin.getDefault().getCommonSourceLookupDirector().findSourceElements(filePath);
|
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)
|
if (foundElements.length == 1 && foundElements[0] instanceof LocalFileStorage)
|
||||||
{
|
{
|
||||||
LocalFileStorage newLocation = (LocalFileStorage) foundElements[0];
|
LocalFileStorage newLocation = (LocalFileStorage) foundElements[0];
|
||||||
|
|
Loading…
Add table
Reference in a new issue