fix #774 infinite loop in net.sourceforge.phpeclipse.builder.IdentifierIndexManager...
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpeclipse / phpeditor / PHPEditor.java
index d144789..ae728e1 100644 (file)
@@ -61,6 +61,7 @@ import net.sourceforge.phpdt.ui.text.JavaTextTools;
 import net.sourceforge.phpdt.ui.text.PHPSourceViewerConfiguration;
 import net.sourceforge.phpdt.ui.text.folding.IJavaFoldingStructureProvider;
 import net.sourceforge.phpeclipse.PHPeclipsePlugin;
+import net.sourceforge.phpeclipse.builder.ExternalEditorInput;
 import net.sourceforge.phpeclipse.ui.editor.BrowserUtil;
 import net.sourceforge.phpeclipse.webbrowser.views.BrowserView;
 
@@ -3063,12 +3064,6 @@ public abstract class PHPEditor extends AbstractDecoratedTextEditor implements
         */
        private boolean fStickyOccurrenceAnnotations;
 
-       /** Preference key for showing the line number ruler */
-       // private final static String LINE_NUMBER_RULER =
-       // PreferenceConstants.EDITOR_LINE_NUMBER_RULER;
-       /** Preference key for the foreground color of the line numbers */
-       // private final static String LINE_NUMBER_COLOR =
-       // PreferenceConstants.EDITOR_LINE_NUMBER_RULER_COLOR;
        /** Preference key for the link color */
        private final static String LINK_COLOR = PreferenceConstants.EDITOR_LINK_COLOR;
 
@@ -5876,14 +5871,19 @@ public abstract class PHPEditor extends AbstractDecoratedTextEditor implements
        }
 
        public ShowInContext getShowInContext() {
-               IFile file;
+               IFile file = null;
                if(getEditorInput() instanceof FileStoreEditorInput){
                        FileStoreEditorInput fei = (FileStoreEditorInput) getEditorInput();
                        file = ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(fei.getURI().getPath()));
-               } else {
+               } else if (getEditorInput() instanceof FileEditorInput) {
                        FileEditorInput fei = (FileEditorInput) getEditorInput();
-                       file = ResourcesPlugin.getWorkspace().getRoot().getFile(fei.getPath());
+                       // added to fix ticket 637
+                       file = ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(fei.getURI().getPath()));
+               } else if (getEditorInput() instanceof ExternalEditorInput) {
+                       ExternalEditorInput fei = (ExternalEditorInput) getEditorInput();
+                       file = ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(fei.getFullPath()/* .getURI().getPath()*/));
                }
+
                ShowInContext context = BrowserUtil.getShowInContext(file,
                                false, "");
                if (context != null) {