Merged "Open PHP Declaration" and "Open Include File" into one action "Open Declarati...
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpeclipse / phpeditor / PHPTextHover.java
index 7be2787..81b66fe 100644 (file)
@@ -7,7 +7,7 @@
 
  Contributors:
  IBM Corporation - Initial implementation
- Klaus Hartlage - www.eclipseproject.de
+ www.phpeclipse.de
  **********************************************************************/
 package net.sourceforge.phpeclipse.phpeditor;
 import java.io.FileReader;
@@ -70,7 +70,8 @@ public class PHPTextHover implements ITextHover {
             // elbuffer.getHoverText());
             //            }
           }
-          String hoverInfo = (String) functionDescriptions.get(word);
+          String hoverInfo = 
+            (String) functionDescriptions.get(word);
           if (hoverInfo == null && fProject != null) {
             // get the possible PHPDoc information from the index file
             IdentifierIndexManager indexManager = PHPeclipsePlugin.getDefault()
@@ -82,8 +83,14 @@ public class PHPTextHover implements ITextHover {
                 String filename;
                 FileReader phpdocFileReader;
                 StringBuffer hoverInfoBuffer = new StringBuffer();
-                String workspaceLocation = PHPeclipsePlugin.getWorkspace()
-                    .getRoot().getLocation().toString();
+                String workspaceLocation;
+                if (fProject!=null) {
+                  workspaceLocation = fProject.getLocation().toString()+'/';
+                } else {
+                  // should never happen?
+                  workspaceLocation = PHPeclipsePlugin.getWorkspace()
+                  .getRoot().getLocation().toString();
+                }
                 //                boolean foundPHPdoc = false;
                 for (int i = 0; i < list.size(); i++) {
                   location = (PHPIdentifierLocation) list.get(i);