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;
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) {
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