From: toshihiro Date: Wed, 13 Jun 2007 07:38:26 +0000 (+0000) Subject: Fixed: 1493208 - Linked resources break code assist / includes X-Git-Url: http://secure.phpeclipse.com?hp=a973dae537453b16d7046c86cf111d8bff102515 Fixed: 1493208 - Linked resources break code assist / includes --- diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/ui/util/PHPFileUtil.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/ui/util/PHPFileUtil.java index d17c8e4..9e8563e 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/ui/util/PHPFileUtil.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/ui/util/PHPFileUtil.java @@ -10,9 +10,11 @@ import java.util.List; import net.sourceforge.phpeclipse.PHPeclipsePlugin; import net.sourceforge.phpeclipse.ui.overlaypages.ProjectPrefUtil; +import org.eclipse.core.filebuffers.FileBuffers; import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IResource; +import org.eclipse.core.resources.ResourcesPlugin; import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.Path; import org.eclipse.ui.IEditorDescriptor; @@ -182,7 +184,15 @@ public class PHPFileUtil { if (file.exists()) { return path; } - // } + + // check if linked resource + IFile ifile = FileBuffers.getWorkspaceFileAtLocation(path); + if (ifile != null) { + file = ifile.getLocation().toFile(); + if (file.exists()) { + return path; + } + } List includePaths = ProjectPrefUtil.getIncludePaths(project); if (includePaths.size() > 0) { diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/actions/OpenDeclarationEditorAction.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/actions/OpenDeclarationEditorAction.java index 6d4e18b..9c35add 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/actions/OpenDeclarationEditorAction.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/actions/OpenDeclarationEditorAction.java @@ -82,12 +82,15 @@ public class OpenDeclarationEditorAction { IPath path = PHPFileUtil.determineFilePath(filename, currentFile, fProject); if (path != null) { - IFile file = PHPFileUtil.createFile(path, fProject); - if (file != null && file.exists()) { - PHPeclipsePlugin.getDefault().openFileInTextEditor( - file.getLocation().toString()); - return; - } + //IFile file = PHPFileUtil.createFile(path, fProject); + //if (file != null && file.exists()) { + // PHPeclipsePlugin.getDefault().openFileInTextEditor( + // file.getLocation().toString()); + // return; + //} + PHPeclipsePlugin.getDefault().openFileInTextEditor( + path.toString()); + return; } } catch (Exception e) { // ignore