mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-09 18:56:02 +02:00
Fix for Bug 165877 - Open Definition does not resolve linked resources
This commit is contained in:
parent
2a787e7e66
commit
9516df9fb0
1 changed files with 1 additions and 7 deletions
|
@ -11,7 +11,6 @@
|
||||||
|
|
||||||
package org.eclipse.cdt.internal.ui.indexview;
|
package org.eclipse.cdt.internal.ui.indexview;
|
||||||
|
|
||||||
import org.eclipse.core.resources.ResourcesPlugin;
|
|
||||||
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;
|
||||||
|
@ -30,7 +29,6 @@ import org.eclipse.cdt.core.index.IIndexBinding;
|
||||||
import org.eclipse.cdt.core.index.IIndexName;
|
import org.eclipse.cdt.core.index.IIndexName;
|
||||||
import org.eclipse.cdt.core.model.CModelException;
|
import org.eclipse.cdt.core.model.CModelException;
|
||||||
import org.eclipse.cdt.core.model.CoreModel;
|
import org.eclipse.cdt.core.model.CoreModel;
|
||||||
import org.eclipse.cdt.core.resources.FileStorage;
|
|
||||||
import org.eclipse.cdt.ui.CUIPlugin;
|
import org.eclipse.cdt.ui.CUIPlugin;
|
||||||
|
|
||||||
import org.eclipse.cdt.internal.ui.util.EditorUtility;
|
import org.eclipse.cdt.internal.ui.util.EditorUtility;
|
||||||
|
@ -79,11 +77,7 @@ public class OpenDefinitionAction extends IndexAction {
|
||||||
|
|
||||||
private void showInEditor(IIndexName name) throws CModelException, PartInitException {
|
private void showInEditor(IIndexName name) throws CModelException, PartInitException {
|
||||||
IPath path = new Path(name.getFileName());
|
IPath path = new Path(name.getFileName());
|
||||||
Object input = ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(path);
|
IEditorPart editor = EditorUtility.openInEditor(path, null);
|
||||||
if (input == null)
|
|
||||||
input = new FileStorage(path);
|
|
||||||
|
|
||||||
IEditorPart editor = EditorUtility.openInEditor(input);
|
|
||||||
if (editor != null && editor instanceof ITextEditor) {
|
if (editor != null && editor instanceof ITextEditor) {
|
||||||
ITextEditor textEditor = (ITextEditor)editor;
|
ITextEditor textEditor = (ITextEditor)editor;
|
||||||
int nodeOffset = name.getNodeOffset();
|
int nodeOffset = name.getNodeOffset();
|
||||||
|
|
Loading…
Add table
Reference in a new issue