dotnet / roslynator

Roslynator is a set of code analysis tools for C#, powered by Roslyn.
https://josefpihrt.github.io/docs/roslynator
Other
3.04k stars 251 forks source link

Duplicated refactorings #371

Open ddobrev opened 6 years ago

ddobrev commented 6 years ago

Some of the refactorings in Roslynator repeat already existing ones. I can imagine how much effort it would be but I think Roslynator should be reviewed after each released VS version so that any repetitions are found and removed. The screen-shot below is just one example:

screen shot 2018-05-23 at 14 14 35
ddobrev commented 6 years ago

This bug is essentially a generalization of https://github.com/JosefPihrt/Roslynator/issues/227 since it occurs for many refactorings and each new VS version.

IanKemp commented 6 years ago

This is a problematic one. It's already possible for end-users to achieve this by tweaking the Code Analysis rules for their projects, but obviously that's a pain. It's probably more of a pain for Josef to have to do this every time there's a new Visual Studio update.

An option - a drastic one, but still an option - is to get Rosylnator's codebase merged into the official dotnet/roslyn repo. Not only would that prevent this overlap from happening, it would allow everyone who uses VS to get access to all the awesome work Josef has done - both on the additional analyzers, refactorings and code fixes that VS lacks, and the fact that Roslynator's versions are almost always superior to VS's.

Personally I think Microsoft should just hire Josef to do this stuff, then the problem goes away. :)

ddobrev commented 6 years ago

@JosefPihrt I think @IanKemp 's suggestion makes the most sense. Have you ever thought about contacting Microsoft to discuss the possibility of them adopting your code?

Danghor commented 5 years ago

Are the analyzers that are built into Visual Studio updated or are they pretty much set and new analyzers are only available in the next Visual Studio version? If every Visual Studio version has it's own set of analyzers, maybe an option would be to detect the version and then disable the analyzers in Roslynator that are already present in the current version. That way, no duplication occurs in newer versions, but people using older versions can still use the analyzers Microsoft did not provide back then.