Improved auto completion
authorkhartlage <khartlage>
Fri, 27 Dec 2002 15:47:18 +0000 (15:47 +0000)
committerkhartlage <khartlage>
Fri, 27 Dec 2002 15:47:18 +0000 (15:47 +0000)
net.sourceforge.phpeclipse/icons/obj16/builtin_obj.gif [new file with mode: 0644]
net.sourceforge.phpeclipse/icons/obj16/template_obj.gif [new file with mode: 0644]
net.sourceforge.phpeclipse/icons/obj16/var_obj.gif [new file with mode: 0644]
net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/ui/PHPUiImages.java
net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/ui/text/template/IdentifierEngine.java
net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/ui/text/template/IdentifierProposal.java
net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/ui/text/template/TemplateEngine.java
net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/ui/text/template/TemplateProposal.java
net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/PHPSyntaxPreferencePage.java
net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/php/PHPCompletionProcessor.java

diff --git a/net.sourceforge.phpeclipse/icons/obj16/builtin_obj.gif b/net.sourceforge.phpeclipse/icons/obj16/builtin_obj.gif
new file mode 100644 (file)
index 0000000..190e86d
Binary files /dev/null and b/net.sourceforge.phpeclipse/icons/obj16/builtin_obj.gif differ
diff --git a/net.sourceforge.phpeclipse/icons/obj16/template_obj.gif b/net.sourceforge.phpeclipse/icons/obj16/template_obj.gif
new file mode 100644 (file)
index 0000000..65c2632
Binary files /dev/null and b/net.sourceforge.phpeclipse/icons/obj16/template_obj.gif differ
diff --git a/net.sourceforge.phpeclipse/icons/obj16/var_obj.gif b/net.sourceforge.phpeclipse/icons/obj16/var_obj.gif
new file mode 100644 (file)
index 0000000..b1b194e
Binary files /dev/null and b/net.sourceforge.phpeclipse/icons/obj16/var_obj.gif differ
index 4cc1713..0729160 100644 (file)
@@ -32,21 +32,29 @@ public class PHPUiImages {
        protected static final String CTOOL_PREFIX = "ctool16";
 
   public static final String IMG_CLASS = NAME_PREFIX + "class_obj.gif";
+  public static final String IMG_BUILTIN = NAME_PREFIX + "builtin_obj.gif";
   public static final String IMG_FUN = NAME_PREFIX + "fun_obj.gif";
+  public static final String IMG_VAR = NAME_PREFIX + "var_obj.gif";
        public static final String IMG_OBJS_ERROR = NAME_PREFIX + "error_obj.gif";
        public static final String IMG_OBJS_WARNING = NAME_PREFIX + "warning_obj.gif";
        public static final String IMG_OBJS_INFO = NAME_PREFIX + "info_obj.gif";
        public static final String IMG_CTOOLS_PHP_PAGE = NAME_PREFIX + "php_page.gif";
        public static final String IMG_CTOOLS_PHP = NAME_PREFIX + "php.gif";
+  
+  public static final String IMG_OBJS_TEMPLATE= NAME_PREFIX + "template_obj.gif";   
 
   public static final ImageDescriptor DESC_CLASS = createManaged(OBJ_PREFIX, IMG_CLASS);
+  public static final ImageDescriptor DESC_BUILTIN = createManaged(OBJ_PREFIX, IMG_BUILTIN);
   public static final ImageDescriptor DESC_FUN = createManaged(OBJ_PREFIX, IMG_FUN);
-       public static final ImageDescriptor DESC_OBJS_ERROR = createManaged(OBJ_PREFIX, IMG_OBJS_ERROR);
+       public static final ImageDescriptor DESC_VAR = createManaged(OBJ_PREFIX, IMG_VAR);
+  public static final ImageDescriptor DESC_OBJS_ERROR = createManaged(OBJ_PREFIX, IMG_OBJS_ERROR);
        public static final ImageDescriptor DESC_OBJS_WARNING = createManaged(OBJ_PREFIX, IMG_OBJS_WARNING);
        public static final ImageDescriptor DESC_OBJS_INFO = createManaged(OBJ_PREFIX, IMG_OBJS_INFO);
        public static final ImageDescriptor DESC_CTOOL_PHP_PAGE = createManaged(CTOOL_PREFIX, IMG_CTOOLS_PHP_PAGE);
        public static final ImageDescriptor DESC_CTOOL_PHP = createManaged(CTOOL_PREFIX, IMG_CTOOLS_PHP);
 
+  public static final ImageDescriptor DESC_OBJS_TEMPLATE= createManaged(OBJ_PREFIX, IMG_OBJS_TEMPLATE);
+
        /**
         * Returns the image managed under the given key in this registry.
         * 
index 66a315c..6c4e62a 100644 (file)
@@ -6,22 +6,15 @@ package net.sourceforge.phpdt.internal.ui.text.template;
 
 import java.util.ArrayList;
 
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.Region;
-
-//import org.eclipse.jdt.core.ICompilationUnit;
-//import org.eclipse.jdt.core.JavaModelException;
-
-//import org.eclipse.jdt.internal.corext.Assert;
 import net.sourceforge.phpdt.internal.corext.template.ContextType;
-import net.sourceforge.phpdt.internal.corext.template.Template;
-import net.sourceforge.phpdt.internal.corext.template.Templates;
 import net.sourceforge.phpdt.internal.corext.template.java.CompilationUnitContext;
 import net.sourceforge.phpdt.internal.corext.template.java.CompilationUnitContextType;
-//import org.eclipse.jdt.internal.ui.JavaPluginImages;
+import net.sourceforge.phpdt.internal.ui.PHPUiImages;
 import net.sourceforge.phpdt.internal.ui.text.java.IJavaCompletionProposal;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.jface.text.Region;
 //import org.eclipse.jdt.internal.ui.text.link.LinkedPositionManager;
 
 public class IdentifierEngine {
@@ -88,7 +81,7 @@ public class IdentifierEngine {
                for (int i= 0; i != identifiers.length; i++) {
       identifier = (String) identifiers[i];
                        if (context.canEvaluate(identifier)) {
-                               fProposals.add(new IdentifierProposal(identifier, context, region, viewer)); //luginImages.get(JavaPluginImages.IMG_OBJS_TEMPLATE)));
+                               fProposals.add(new IdentifierProposal(identifier, context, region, viewer, PHPUiImages.get(PHPUiImages.IMG_FUN), PHPUiImages.get(PHPUiImages.IMG_VAR))); 
       }
     }
        }
index 39b98e3..8e7502e 100644 (file)
@@ -37,7 +37,8 @@ public class IdentifierProposal implements IJavaCompletionProposal {
   private final String fTemplate;
   private final TemplateContext fContext;
   private final ITextViewer fViewer;
-  //   private final Image fImage;
+  private final Image fImage_fun;
+  private final Image fImage_var;
   private final IRegion fRegion;
 
   //private TemplateBuffer fTemplateBuffer;
@@ -50,7 +51,7 @@ public class IdentifierProposal implements IJavaCompletionProposal {
    * @param context   the context in which the template was requested.
    * @param image     the icon of the proposal.
    */
-  public IdentifierProposal(String template, TemplateContext context, IRegion region, ITextViewer viewer) { //, Image image) {
+  public IdentifierProposal(String template, TemplateContext context, IRegion region, ITextViewer viewer, Image image_fun, Image image_var) {
     //         Assert.isNotNull(template);
     //         Assert.isNotNull(context);
     //         Assert.isNotNull(region);
@@ -59,7 +60,8 @@ public class IdentifierProposal implements IJavaCompletionProposal {
     fTemplate = template;
     fContext = context;
     fViewer = viewer;
-    //         fImage= image;
+       fImage_fun= image_fun;
+    fImage_var= image_var;
     fRegion = region;
   }
 
@@ -159,8 +161,10 @@ public class IdentifierProposal implements IJavaCompletionProposal {
    * @see ICompletionProposal#getImage()
    */
   public Image getImage() {
-    //         return fImage;
-    return null;
+    if (fTemplate.charAt(0)=='$') {
+      return fImage_var;
+    }
+               return fImage_fun;
   }
 
   /*
index d14b31e..5990e83 100644 (file)
@@ -6,22 +6,17 @@ package net.sourceforge.phpdt.internal.ui.text.template;
 
 import java.util.ArrayList;
 
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.Region;
-
-//import org.eclipse.jdt.core.ICompilationUnit;
-//import org.eclipse.jdt.core.JavaModelException;
-
-//import org.eclipse.jdt.internal.corext.Assert;
 import net.sourceforge.phpdt.internal.corext.template.ContextType;
 import net.sourceforge.phpdt.internal.corext.template.Template;
 import net.sourceforge.phpdt.internal.corext.template.Templates;
 import net.sourceforge.phpdt.internal.corext.template.java.CompilationUnitContext;
 import net.sourceforge.phpdt.internal.corext.template.java.CompilationUnitContextType;
-//import org.eclipse.jdt.internal.ui.JavaPluginImages;
+import net.sourceforge.phpdt.internal.ui.PHPUiImages;
 import net.sourceforge.phpdt.internal.ui.text.java.IJavaCompletionProposal;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.jface.text.Region;
 //import org.eclipse.jdt.internal.ui.text.link.LinkedPositionManager;
 
 public class TemplateEngine {
@@ -86,7 +81,7 @@ public class TemplateEngine {
                Template[] templates= Templates.getInstance().getTemplates();
                for (int i= 0; i != templates.length; i++)
                        if (context.canEvaluate(templates[i]))
-                               fProposals.add(new TemplateProposal(templates[i], context, region, viewer)); //luginImages.get(JavaPluginImages.IMG_OBJS_TEMPLATE)));
+                               fProposals.add(new TemplateProposal(templates[i], context, region, viewer, PHPUiImages.get(PHPUiImages.IMG_OBJS_TEMPLATE))); 
        }
 
 }
index ca3ac38..c97c29a 100644 (file)
@@ -37,7 +37,7 @@ public class TemplateProposal implements IJavaCompletionProposal {
        private final Template fTemplate;
        private final TemplateContext fContext;
        private final ITextViewer fViewer;
-//     private final Image fImage;
+       private final Image fImage;
        private final IRegion fRegion;
 
        private TemplateBuffer fTemplateBuffer;
@@ -50,7 +50,7 @@ public class TemplateProposal implements IJavaCompletionProposal {
         * @param context   the context in which the template was requested.
         * @param image     the icon of the proposal.
         */     
-       public TemplateProposal(Template template, TemplateContext context, IRegion region, ITextViewer viewer){ //, Image image) {
+       public TemplateProposal(Template template, TemplateContext context, IRegion region, ITextViewer viewer, Image image) {
 //             Assert.isNotNull(template);
 //             Assert.isNotNull(context);
 //             Assert.isNotNull(region);
@@ -59,7 +59,7 @@ public class TemplateProposal implements IJavaCompletionProposal {
                fTemplate= template;
                fContext= context;
                fViewer= viewer;
-//             fImage= image;
+               fImage= image;
                fRegion= region;
        }
 
@@ -156,8 +156,7 @@ public class TemplateProposal implements IJavaCompletionProposal {
         * @see ICompletionProposal#getImage()
         */
        public Image getImage() {
-//             return fImage;
-     return null;
+               return fImage;
        }
 
        /*
index eb7c7c0..a182244 100644 (file)
@@ -47,7 +47,7 @@ public class PHPSyntaxPreferencePage extends FieldEditorPreferencePage implement
     this.addField(keyWords);
     ColorFieldEditor variables = new ColorFieldEditor(PHP_VARIABLE, "Variables:", this.getFieldEditorParent());
     this.addField(variables);
-    ColorFieldEditor types = new ColorFieldEditor(PHP_FUNCTIONNAME, "Types:", this.getFieldEditorParent());
+    ColorFieldEditor types = new ColorFieldEditor(PHP_FUNCTIONNAME, "Built-in functions:", this.getFieldEditorParent());
     this.addField(types);
     ColorFieldEditor strings = new ColorFieldEditor(PHP_STRING, "Strings:", this.getFieldEditorParent());
     this.addField(strings);
index 159d8fc..a96712b 100644 (file)
@@ -11,7 +11,6 @@ Contributors:
 **********************************************************************/
 package net.sourceforge.phpeclipse.phpeditor.php;
 
-import java.text.MessageFormat;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
@@ -20,16 +19,15 @@ import net.sourceforge.phpdt.internal.corext.template.ContextType;
 import net.sourceforge.phpdt.internal.corext.template.ContextTypeRegistry;
 import net.sourceforge.phpdt.internal.ui.text.java.IJavaCompletionProposal;
 import net.sourceforge.phpdt.internal.ui.text.java.JavaCompletionProposalComparator;
+import net.sourceforge.phpdt.internal.ui.text.template.BuiltInEngine;
 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.phpeditor.PHPContentOutlinePage;
 import net.sourceforge.phpeclipse.phpeditor.PHPEditor;
-import org.eclipse.jface.text.BadLocationException;
 import org.eclipse.jface.text.IDocument;
 import org.eclipse.jface.text.ITextViewer;
 import org.eclipse.jface.text.TextPresentation;
-import org.eclipse.jface.text.contentassist.ContextInformation;
 import org.eclipse.jface.text.contentassist.ICompletionProposal;
 import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
 import org.eclipse.jface.text.contentassist.IContextInformation;
@@ -37,7 +35,6 @@ import org.eclipse.jface.text.contentassist.IContextInformationExtension;
 import org.eclipse.jface.text.contentassist.IContextInformationPresenter;
 import org.eclipse.jface.text.contentassist.IContextInformationValidator;
 import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Point;
 import org.eclipse.ui.IEditorPart;
 
 /**
@@ -117,123 +114,123 @@ public class PHPCompletionProcessor implements IContentAssistProcessor {
     }
   };
 
-//  public final class VariablesCompletionProposal implements IJavaCompletionProposal {
-//    private String fDisplayString;
-//    private String fReplacementString;
-//    private int fReplacementOffset;
-//    private int fReplacementLength;
-//    private int fCursorPosition;
-//    private Image fImage;
-//    private IContextInformation fContextInformation;
-//    private String fAdditionalProposalInfo;
-//
-//    /**
-//     * Creates a new completion proposal based on the provided information.  The replacement string is
-//     * considered being the display string too. All remaining fields are set to <code>null</code>.
-//     *
-//     * @param replacementString the actual string to be inserted into the document
-//     * @param replacementOffset the offset of the text to be replaced
-//     * @param replacementLength the length of the text to be replaced
-//     * @param cursorPosition the position of the cursor following the insert relative to replacementOffset
-//     */
-//    public VariablesCompletionProposal(
-//      String replacementString,
-//      int replacementOffset,
-//      int replacementLength,
-//      int cursorPosition) {
-//      this(replacementString, replacementOffset, replacementLength, cursorPosition, null, null, null, null);
-//    }
-//
-//    /**
-//     * Creates a new completion proposal. All fields are initialized based on the provided information.
-//     *
-//     * @param replacementString the actual string to be inserted into the document
-//     * @param replacementOffset the offset of the text to be replaced
-//     * @param replacementLength the length of the text to be replaced
-//     * @param cursorPosition the position of the cursor following the insert relative to replacementOffset
-//     * @param image the image to display for this proposal
-//     * @param displayString the string to be displayed for the proposal
-//     * @param contentInformation the context information associated with this proposal
-//     * @param additionalProposalInfo the additional information associated with this proposal
-//     */
-//    public VariablesCompletionProposal(
-//      String replacementString,
-//      int replacementOffset,
-//      int replacementLength,
-//      int cursorPosition,
-//      Image image,
-//      String displayString,
-//      IContextInformation contextInformation,
-//      String additionalProposalInfo) {
-//      //      Assert.isNotNull(replacementString);
-//      //      Assert.isTrue(replacementOffset >= 0);
-//      //      Assert.isTrue(replacementLength >= 0);
-//      //      Assert.isTrue(cursorPosition >= 0);
-//
-//      fReplacementString = replacementString;
-//      fReplacementOffset = replacementOffset;
-//      fReplacementLength = replacementLength;
-//      fCursorPosition = cursorPosition;
-//      fImage = image;
-//      fDisplayString = displayString;
-//      fContextInformation = contextInformation;
-//      fAdditionalProposalInfo = additionalProposalInfo;
-//    }
-//
-//    /*
-//     * @see ICompletionProposal#apply
-//     */
-//    public void apply(IDocument document) {
-//      try {
-//        document.replace(fReplacementOffset, fReplacementLength, fReplacementString);
-//      } catch (BadLocationException x) {
-//        // ignore
-//      }
-//    }
-//
-//    /*
-//     * @see ICompletionProposal#getSelection
-//     */
-//    public Point getSelection(IDocument document) {
-//      return new Point(fReplacementOffset + fCursorPosition, 0);
-//    }
-//
-//    /*
-//     * @see ICompletionProposal#getContextInformation()
-//     */
-//    public IContextInformation getContextInformation() {
-//      return fContextInformation;
-//    }
-//
-//    /*
-//     * @see ICompletionProposal#getImage()
-//     */
-//    public Image getImage() {
-//      return fImage;
-//    }
-//
-//    /*
-//     * @see ICompletionProposal#getDisplayString()
-//     */
-//    public String getDisplayString() {
-//      if (fDisplayString != null)
-//        return fDisplayString;
-//      return fReplacementString;
-//    }
-//
-//    /*
-//     * @see ICompletionProposal#getAdditionalProposalInfo()
-//     */
-//    public String getAdditionalProposalInfo() {
-//      return fAdditionalProposalInfo;
-//    }
-//    /**
-//    * Returns the relevance of the proposal.
-//    */
-//    public int getRelevance() {
-//      return 0;
-//    }
-//  }
+  //  public final class VariablesCompletionProposal implements IJavaCompletionProposal {
+  //    private String fDisplayString;
+  //    private String fReplacementString;
+  //    private int fReplacementOffset;
+  //    private int fReplacementLength;
+  //    private int fCursorPosition;
+  //    private Image fImage;
+  //    private IContextInformation fContextInformation;
+  //    private String fAdditionalProposalInfo;
+  //
+  //    /**
+  //     * Creates a new completion proposal based on the provided information.  The replacement string is
+  //     * considered being the display string too. All remaining fields are set to <code>null</code>.
+  //     *
+  //     * @param replacementString the actual string to be inserted into the document
+  //     * @param replacementOffset the offset of the text to be replaced
+  //     * @param replacementLength the length of the text to be replaced
+  //     * @param cursorPosition the position of the cursor following the insert relative to replacementOffset
+  //     */
+  //    public VariablesCompletionProposal(
+  //      String replacementString,
+  //      int replacementOffset,
+  //      int replacementLength,
+  //      int cursorPosition) {
+  //      this(replacementString, replacementOffset, replacementLength, cursorPosition, null, null, null, null);
+  //    }
+  //
+  //    /**
+  //     * Creates a new completion proposal. All fields are initialized based on the provided information.
+  //     *
+  //     * @param replacementString the actual string to be inserted into the document
+  //     * @param replacementOffset the offset of the text to be replaced
+  //     * @param replacementLength the length of the text to be replaced
+  //     * @param cursorPosition the position of the cursor following the insert relative to replacementOffset
+  //     * @param image the image to display for this proposal
+  //     * @param displayString the string to be displayed for the proposal
+  //     * @param contentInformation the context information associated with this proposal
+  //     * @param additionalProposalInfo the additional information associated with this proposal
+  //     */
+  //    public VariablesCompletionProposal(
+  //      String replacementString,
+  //      int replacementOffset,
+  //      int replacementLength,
+  //      int cursorPosition,
+  //      Image image,
+  //      String displayString,
+  //      IContextInformation contextInformation,
+  //      String additionalProposalInfo) {
+  //      //      Assert.isNotNull(replacementString);
+  //      //      Assert.isTrue(replacementOffset >= 0);
+  //      //      Assert.isTrue(replacementLength >= 0);
+  //      //      Assert.isTrue(cursorPosition >= 0);
+  //
+  //      fReplacementString = replacementString;
+  //      fReplacementOffset = replacementOffset;
+  //      fReplacementLength = replacementLength;
+  //      fCursorPosition = cursorPosition;
+  //      fImage = image;
+  //      fDisplayString = displayString;
+  //      fContextInformation = contextInformation;
+  //      fAdditionalProposalInfo = additionalProposalInfo;
+  //    }
+  //
+  //    /*
+  //     * @see ICompletionProposal#apply
+  //     */
+  //    public void apply(IDocument document) {
+  //      try {
+  //        document.replace(fReplacementOffset, fReplacementLength, fReplacementString);
+  //      } catch (BadLocationException x) {
+  //        // ignore
+  //      }
+  //    }
+  //
+  //    /*
+  //     * @see ICompletionProposal#getSelection
+  //     */
+  //    public Point getSelection(IDocument document) {
+  //      return new Point(fReplacementOffset + fCursorPosition, 0);
+  //    }
+  //
+  //    /*
+  //     * @see ICompletionProposal#getContextInformation()
+  //     */
+  //    public IContextInformation getContextInformation() {
+  //      return fContextInformation;
+  //    }
+  //
+  //    /*
+  //     * @see ICompletionProposal#getImage()
+  //     */
+  //    public Image getImage() {
+  //      return fImage;
+  //    }
+  //
+  //    /*
+  //     * @see ICompletionProposal#getDisplayString()
+  //     */
+  //    public String getDisplayString() {
+  //      if (fDisplayString != null)
+  //        return fDisplayString;
+  //      return fReplacementString;
+  //    }
+  //
+  //    /*
+  //     * @see ICompletionProposal#getAdditionalProposalInfo()
+  //     */
+  //    public String getAdditionalProposalInfo() {
+  //      return fAdditionalProposalInfo;
+  //    }
+  //    /**
+  //    * Returns the relevance of the proposal.
+  //    */
+  //    public int getRelevance() {
+  //      return 0;
+  //    }
+  //  }
 
   protected final static String[] fgProposals = PHPFunctionNames.FUNCTION_NAMES;
 
@@ -288,7 +285,7 @@ public class PHPCompletionProcessor implements IContentAssistProcessor {
     IDocument document = viewer.getDocument();
     Object[] identifiers = null;
     if (offset > 0) {
-   
+
       PHPEditor editor = null;
       PHPContentOutlinePage outlinePage = null;
 
@@ -299,6 +296,7 @@ public class PHPCompletionProcessor implements IContentAssistProcessor {
         identifiers = outlinePage.getVariables();
       }
     }
+
     if (fTemplateEngine != null) {
       ICompletionProposal[] results;
       //      try {
@@ -329,12 +327,26 @@ public class PHPCompletionProcessor implements IContentAssistProcessor {
           identifierResults = identifierEngine.getResults();
         }
       }
-      
+
+      IJavaCompletionProposal[] builtinResults = new IJavaCompletionProposal[0];
+      if (PHPFunctionNames.FUNCTION_NAMES != null) {
+        BuiltInEngine builtinEngine;
+        String proposal;
+
+        ContextType contextType = ContextTypeRegistry.getInstance().getContextType("php"); //$NON-NLS-1$
+        if (contextType != null) {
+          builtinEngine = new BuiltInEngine(contextType);
+          builtinEngine.complete(viewer, offset, PHPFunctionNames.FUNCTION_NAMES);
+          builtinResults = builtinEngine.getResults();
+        }
+      }
+
       // concatenate arrays
       IJavaCompletionProposal[] total;
-      total = new IJavaCompletionProposal[templateResults.length + identifierResults.length];
+      total = new IJavaCompletionProposal[templateResults.length + identifierResults.length + builtinResults.length];
       System.arraycopy(templateResults, 0, total, 0, templateResults.length);
       System.arraycopy(identifierResults, 0, total, templateResults.length, identifierResults.length);
+      System.arraycopy(builtinResults, 0, total, templateResults.length + identifierResults.length, builtinResults.length);
       results = total;
 
       fNumberOfComputedResults = (results == null ? 0 : results.length);