Skip to content

Introduce Local should look for naming patterns in ForEachStatementSyntax.Expression #56

@rchande

Description

@rchande
class Program
{
    static void Main(string[] args)
    {
        foreach (var num in GetNumbers())
        {

        }
    }

    static IEnumerable<int> GetNumbers()
    {
        return new[] { 1, 2, 3 };
    }
}

Highlight "GetNumbers()" in the foreach statement and use Ctrl+. to get the light bulb. Invoke "Introduce Local". Observe that the new local is named "enumerable".

Since we have code to detect known patterns like "GetBlah", it would be nice if we could notice that the Expression of the ForEachStatementSyntax was an InvocationExpression and try to recognize that pattern.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-IDEhelp wantedThe issue is "up for grabs" - add a comment if you are interested in working on it

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions