dotnet / roslyn

The Roslyn .NET compiler provides C# and Visual Basic languages with rich code analysis APIs.
https://docs.microsoft.com/dotnet/csharp/roslyn-sdk/
MIT License
19.06k stars 4.04k forks source link

The pre-selected "Suggest Name" for parameters has inconistent casing and violates .editorconfig #59562

Closed Tragetaschen closed 2 years ago

Tragetaschen commented 2 years ago

Version Used: 17.0.6

Steps to Reproduce:

public class Test
{
    public void M(/* add Parameters here**)
    { }
}

and an .editorconfig with this https://github.com/dotnet/roslyn/blob/main/.editorconfig#L120-L127 (I have "warning" instead of suggestion)

The first parameter is of type Test and the suggested name is Test with a capital T. This violates the .editorconfig and gets a squiggle. The second parameter is of type IEnumerable<Test> and the suggested name is tests - great! The third parameter is of type IComparable and the suggested name is comparable - great! The fourth parameter is of type CancellationToken and the suggested name is CancellationToken - squiggle.

Expected Behavior: All suggested names should start with a lower case letter.

Actual Behavior: As described above, but what's worse is that any kind muscle memory is currently worthless here. It used to be that I could very quickly complete parameters, but as it is now I continuously have to check, go back to fix, or choose the first (correct) list entry manually.

suggested-name-inconsistent

Youssef1313 commented 2 years ago

Probably already fixed in https://github.com/dotnet/roslyn/pull/59401.

Tragetaschen commented 2 years ago

I agree

sharwell commented 2 years ago

Duplicate of #36248

sharwell commented 2 years ago

In case it wasn't obvious from the pull request, here's the conflicting rule that was generating the unwanted names:

https://github.com/dotnet/roslyn/blob/0098764330d1e22c43ead6065e4ed5f8aae09195/.editorconfig#L138-L145