autocompletion putting space after method name

It seems like the autocompletion when pressing Tab for methods that take multiple parameter lambdas inserts a space after the method name before the parentheses even though the Advanced Setting for no space after method name is set. This does not happen for methods that take a single parameter lambda.

It also seems that methods that take parameters that are not lambdas don't get autocompletion of parentheses at all?

Comments

  • Any update on correcting this in the editor?

  • Can you give an example?

  • NetMage
    edited December 2024

    I couldn't find a (LINQ) built-in extension method that takes a multi-parameter Func as its first (or only argument) after this, so here is a short example:

    var ans = new[] { 1, 2, 3 }.Reduce ((x, y) => x+y);
    
    public static class IExt {
        public static T Reduce<T>(this IEnumerable<T> items, Func<T, T, T> aggregateFn) => items.Aggregate(aggregateFn);    
    }
    

    If you type in the var ans line after the extension method is defined in C# statements mode, and when your pick list while typing in Reduce becomes a single choice, press for completion, and you will get a space after Reduce even if (C#) Insert space after method name is false.

  • Thanks - there will be a fix for this in the next build.

  • Looks like it is working in the beta for me.

  • With the same example in LINQPad 9.7.13, a new issue appears: hitting tab after Reduce is the only choice types in Reduce(x, y) => which is missing an open parenthesis.

  • Sorry about that - it looks like a LINQPad 9 regression. This should now be fixed in 9.8.1.