SonarSource / sonar-dotnet

Code analyzer for C# and VB.NET projects
https://redirect.sonarsource.com/plugins/csharp.html
GNU Lesser General Public License v3.0
770 stars 226 forks source link

Update S2234: improve secondary locations and add a message #3679

Open nicolas-harraudeau-sonarsource opened 3 years ago

nicolas-harraudeau-sonarsource commented 3 years ago

RSPEC-2234 creates a secondary location on the function definition. This location can be quite far from the primary location and developers will expect to navigate to it in SonarLint. Thus we need to add a message to this secondary location.

As the secondary location is designed right now I would use the message "Method definition."

If it is possible we can also improve secondary locations a bit and create them directly on parameters which are misplaced, just as it is done for java:

Screenshot 2020-10-27 at 14 57 05
nicolas-harraudeau-sonarsource commented 3 years ago

For now this is a nice to have as SonarLint for Visual Studio does not support secondary locations on dotnet issues.