Changed "Open PHP Declarartion" action in the PHP editor:
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpeclipse / builder / IdentifierIndexManager.java
index dd2672b..365620c 100644 (file)
@@ -98,6 +98,17 @@ public class IdentifierIndexManager {
               }
               parseDeclarations(buf, true);
             }
+          } else if (fToken == TokenNamedefine) {
+            getNextToken();
+            if (fToken == TokenNameLPAREN) {
+              getNextToken();
+              if (fToken == TokenNameStringLiteral) {
+                ident = fScanner.getCurrentStringLiteralSource();
+                buf.append("\td");
+                buf.append(ident);
+                getNextToken();
+              }
+            }
           } else if ((fToken == TokenNameLBRACE) || (fToken == TokenNameDOLLAR_LBRACE)) {
             getNextToken();
             counter++;
@@ -157,6 +168,17 @@ public class IdentifierIndexManager {
               parseDeclarations(buf, true);
 
             }
+          } else if (fToken == TokenNamedefine) {
+            getNextToken();
+            if (fToken == TokenNameLPAREN) {
+              getNextToken();
+              if (fToken == TokenNameStringLiteral) {
+                ident = fScanner.getCurrentStringLiteralSource();
+                buf.append("\td");
+                buf.append(ident);
+                getNextToken();
+              }
+            }
           } else {
             getNextToken();
           }
@@ -244,6 +266,10 @@ public class IdentifierIndexManager {
           classname = identifier;
           phpIdentifier = new PHPIdentifierLocation(identifier, PHPIdentifier.CLASS, phpFileName);
           break;
+        case 'd' : // define
+          identifier = token.substring(1);
+          phpIdentifier = new PHPIdentifierLocation(identifier, PHPIdentifier.DEFINE, phpFileName);
+          break;
         case 'f' : // function name
           identifier = token.substring(1);
           phpIdentifier = new PHPIdentifierLocation(identifier, PHPIdentifier.FUNCTION, phpFileName);
@@ -386,6 +412,10 @@ public class IdentifierIndexManager {
           classname = identifier;
           phpIdentifier = new PHPIdentifierLocation(identifier, PHPIdentifier.CLASS, phpFileName);
           break;
+        case 'd' : // define
+          identifier = token.substring(1);
+          phpIdentifier = new PHPIdentifierLocation(identifier, PHPIdentifier.DEFINE, phpFileName);
+          break;
         case 'f' : // function name
           identifier = token.substring(1);
           phpIdentifier = new PHPIdentifierLocation(identifier, PHPIdentifier.FUNCTION, phpFileName);