mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Fix 221858: [Project Explorer] Link with editor does not work
This commit is contained in:
parent
e25731ec26
commit
c9dbba10e8
1 changed files with 3 additions and 0 deletions
|
@ -22,6 +22,7 @@ import org.eclipse.ui.navigator.ILinkHelper;
|
|||
import org.eclipse.cdt.core.model.CoreModel;
|
||||
import org.eclipse.cdt.core.model.ICElement;
|
||||
import org.eclipse.cdt.core.model.ITranslationUnit;
|
||||
import org.eclipse.cdt.core.model.IWorkingCopy;
|
||||
import org.eclipse.cdt.ui.CUIPlugin;
|
||||
import org.eclipse.cdt.ui.IWorkingCopyManager;
|
||||
|
||||
|
@ -62,6 +63,8 @@ public class CNavigatorLinkHelper implements ILinkHelper {
|
|||
if (file != null && CoreModel.hasCNature(file.getProject())) {
|
||||
element= CoreModel.getDefault().create(file);
|
||||
}
|
||||
} else {
|
||||
element= ((IWorkingCopy) element).getOriginalElement();
|
||||
}
|
||||
return (element != null) ? new StructuredSelection(element) : StructuredSelection.EMPTY;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue