Closed ironcev closed 5 years ago
Hi Shubham,
commands are Sharpen's Visual Studio UI Commands that can be found in the Commands folder.
Precisely, those are the classes the derive directly or indirectly from BaseSharpenCommand
They have to be internal and sealed like e.g. AnalyzeSolutionCommand:
internal sealed class AnalyzeSolutionCommand : BaseAnalyzeCommand<AnalyzeSolutionCommand>
This coded guideline checks if a non-abstract command class (means a class that derives directly or indirectly from BaseSharpenCommand<TSharpenCommand>
) is sealed. This means, in this case, the Roslyn analyzer should show error and underline the whole class definition with a red line:
internal class MySolutionCommand : BaseAnalyzeCommand<AnalyzeSolutionCommand>
In this case of course not because the class is abstract:
internal abstract class MySolutionCommand : BaseAnalyzeCommand<AnalyzeSolutionCommand>
For additional info see the implementation of all the commands in the Commands folder.
For implementing a Roslyn analyzer that checks these tutorials.
Please keep in mind that the Sharpen.CodedGuidelines project does not exist at the moment. That project has to be created as well and added to the solution before you start working on this concrete analyzer.
Please let me know if this helps and if you need any additional info.
And yes, thanks for taking a look at the issue :-) I'm looking forward to a pull request down the road ;-)
See #7.
Hi Igor,
Could you please provide more details or perhaps an example on the same?
Thanks, Shubham Bahuguna Quovantis