misc parser changes
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpeclipse / phpeditor / php / PHPCompletionProcessor.java
index 4d4acc5..de0473e 100644 (file)
@@ -32,7 +32,7 @@ import net.sourceforge.phpdt.internal.ui.text.template.IdentifierEngine;
 import net.sourceforge.phpdt.internal.ui.text.template.TemplateEngine;
 import net.sourceforge.phpeclipse.PHPeclipsePlugin;
 import net.sourceforge.phpeclipse.builder.IdentifierIndexManager;
-import net.sourceforge.phpeclipse.phpeditor.AbstractContentOutlinePage;
+import net.sourceforge.phpeclipse.phpeditor.JavaOutlinePage;
 import net.sourceforge.phpeclipse.phpeditor.PHPContentOutlinePage;
 import net.sourceforge.phpeclipse.phpeditor.PHPEditor;
 import net.sourceforge.phpeclipse.phpeditor.PHPSyntaxRdr;
@@ -224,8 +224,8 @@ public class PHPCompletionProcessor implements IContentAssistProcessor {
           case ITerminalSymbols.TokenNameMINUS_GREATER :
             // dereferencing operator '->' found
             lastSignificantToken = ITerminalSymbols.TokenNameMINUS_GREATER;
-            if (beforeLastToken == ITerminalSymbols.TokenNamethis) {
-              lastSignificantToken = ITerminalSymbols.TokenNamethis;
+            if (beforeLastToken == ITerminalSymbols.TokenNameVariable) {
+              lastSignificantToken = ITerminalSymbols.TokenNameVariable;
             }
             break;
           case ITerminalSymbols.TokenNamenew :
@@ -246,17 +246,18 @@ public class PHPCompletionProcessor implements IContentAssistProcessor {
     if (offset > 0) {
 
       PHPEditor editor = null;
-      AbstractContentOutlinePage outlinePage = null;
+//      JavaOutlinePage outlinePage = null;
 
       IEditorPart targetEditor = PHPeclipsePlugin.getActiveWorkbenchWindow().getActivePage().getActiveEditor();
       if (targetEditor != null && (targetEditor instanceof PHPEditor)) {
         editor = (PHPEditor) targetEditor;
         file = ((IFileEditorInput) editor.getEditorInput()).getFile();
         project = file.getProject();
-        outlinePage = editor.getfOutlinePage();
-        if (outlinePage instanceof PHPContentOutlinePage) {
-          identifiers = ((PHPContentOutlinePage) outlinePage).getVariables();
-        }
+//        outlinePage = editor.getfOutlinePage();
+        // TODO: get the identifiers from the new model
+//        if (outlinePage instanceof PHPContentOutlinePage) {
+//          identifiers = ((PHPContentOutlinePage) outlinePage).getVariables();
+//        }
       }
     }
 
@@ -269,7 +270,7 @@ public class PHPCompletionProcessor implements IContentAssistProcessor {
     int lastSignificantToken = getLastToken(viewer, offset, context);
     boolean useClassMembers =
       (lastSignificantToken == ITerminalSymbols.TokenNameMINUS_GREATER) || 
-      (lastSignificantToken == ITerminalSymbols.TokenNamethis) ||
+      (lastSignificantToken == ITerminalSymbols.TokenNameVariable) ||
                  (lastSignificantToken == ITerminalSymbols.TokenNamenew);
     boolean emptyPrefix = prefix == null || prefix.equals("");