Fix Request #1431769: Support Context assistance when entering functions arguments
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / internal / ui / text / template / BuiltInProposal.java
index daafd3d..a0e1bda 100644 (file)
@@ -104,9 +104,6 @@ public class BuiltInProposal extends AbstractProposal {
                // }
        }
 
-       /*
-        * @see ICompletionProposal#getAdditionalProposalInfo()
-        */
        public String getAdditionalProposalInfo() {
                return fFunction.getHoverText();
        }
@@ -117,10 +114,11 @@ public class BuiltInProposal extends AbstractProposal {
                        if (contextInfoString != null && contextInfoString.length() > 0) {
                                // extract the parameter context information for the function:
                                int i0 = contextInfoString.indexOf('(');
-                               if (i0 >= 0) {
+                               int newline = contextInfoString.indexOf('\n');
+                               if (i0 >= 0 && (i0 < newline || newline < 0)) {
                                        int i1 = contextInfoString.indexOf(')', i0 + 1);
                                        if (i1 > 0) {
-                                               fContextInfo = new ContextInformation(null, contextInfoString.substring(i0, i1+1));
+                                               fContextInfo = new ContextInformation(null, contextInfoString.substring(i0+1, i1));
                                        } else {
                                                fContextInfo = new ContextInformation(null, contextInfoString);
                                        }