private Descriptor CreateFdoFunctionSignatureDescriptor(IFdoFunctionDefintion func, IFdoFunctionDefintionSignature sig)
        {
            var           desc = new Descriptor();
            List <string> args = new List <string>();

            foreach (var argDef in sig.Arguments)
            {
                args.Add(argDef.Name.Trim());
            }
            string argsStr = StringifyFunctionArgs(args);
            string argDesc = DescribeSignature(sig);
            string expr    = $"{func.Name}({argsStr})"; //NOXLAT

            desc.Name        = expr;
            desc.Description = string.Format(Strings.ExprEditorFunctionDesc, expr, func.Description, argDesc, sig.ReturnType, Environment.NewLine);
            desc.AppendText  = string.Empty;
            return(desc);
        }
Example #2
0
        internal static IFdoFunctionDefintionSignature[] MakeUniqueSignatures(IFdoFunctionDefintion func)
        {
            var dict = new Dictionary <string, IFdoFunctionDefintionSignature>();

            foreach (var sig in func.Signatures)
            {
                List <string> args = new List <string>();
                foreach (var argDef in sig.Arguments)
                {
                    args.Add(argDef.Name.Trim());
                }
                string expr = $"{func.Name}({FdoExpressionCompletionDataProvider.StringifyFunctionArgs(args)})"; //NOXLATE
                if (!dict.ContainsKey(expr))
                {
                    dict[expr] = sig;
                }
            }
            return(dict.Values.ToArray());
        }
 public FunctionItem(IFdoFunctionDefintion fd, IFdoFunctionDefintionSignature sig, string insertExpr)
     : this(fd, sig)
 {
     _insertExpr = insertExpr;
 }
 private FunctionItem(IFdoFunctionDefintion fd, IFdoFunctionDefintionSignature sig)
 {
     _func = fd;
     _sig  = sig;
 }