diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/EditorUtility.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/EditorUtility.java index 9ffdc4c28f5..c813c36a8b6 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/EditorUtility.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/EditorUtility.java @@ -307,14 +307,10 @@ public class EditorUtility { } // no translation unit - still try to get a sensible marker resource // from the associated element - if (context instanceof IWorkingCopy && ((IWorkingCopy) context).isWorkingCopy()) { - context= ((IWorkingCopy) context).getOriginalElement(); + if (cproject != null) { + IResource markerResource= cproject.getProject(); + return new ExternalEditorInput(new FileStorage(location), markerResource); } - IResource markerResource= null; - if (context != null) { - markerResource= context.getUnderlyingResource(); - } - return new ExternalEditorInput(new FileStorage(location), markerResource); } return new ExternalEditorInput(new FileStorage(location)); } diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/ExternalEditorInput.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/ExternalEditorInput.java index 9d62176468f..cccbfa4d116 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/ExternalEditorInput.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/ExternalEditorInput.java @@ -135,7 +135,7 @@ public class ExternalEditorInput implements ITranslationUnitEditorInput { * and a reference to a resource which holds the markers for the external file. */ public ExternalEditorInput(IStorage exFile, IResource markerResource) { - this.externalFile = exFile ; + this(exFile, exFile.getFullPath()); this.markerResource = markerResource ; }