CleanCode icon indicating copy to clipboard operation
CleanCode copied to clipboard

VB.NET support for several rules

Open wolfgang-janz opened this issue 8 years ago • 5 comments

I started to add vb.net support to one of the rules. If you like the approach i am going to add mor vb.net support.

A design question: Is it possiple to share one TooManyArgumentsHighlighting for c# and vb.net by adding an array to the languages of ConfigurableSeverityHighlighting?

wolfgang-janz avatar Sep 08 '16 18:09 wolfgang-janz

This is awesome, thanks!

As you suggest, you can share a highlight between languages, by adding VBASIC to the languages parameter. Something like:

// The same as "CSHARP,VBASIC"
[ConfigurableSeverityHighlighting(SeverityID, CSharpLanguage.Name + "," + VBLanguage.Name)]
public class TooManyArgumentsHighlighting : Highlighting
{
  // ...
}

If you update the PR with this, I'd be thrilled to merge it :)

I think the approach of effectively duplicating the analyser is probably the best, unfortunately. You could register another interface in the ElementProblemAnalyzer (e.g. (typeof(CSharp.IMethodDeclaration), typeof(VB.IMethodDeclaration)), but then you'd need to take in a base class, (override void Run(ITreeNode …,)) and downcast, and I'm not sure if that would be worth the effort.

Thanks for the PR! I'd love to see more :)

citizenmatt avatar Sep 09 '16 08:09 citizenmatt

Hi matt, thank you for thepositive response. I updated my PR. Didn't update the readme this time. I am planning to add some more support from time to time :)

wolfgang-janz avatar Sep 09 '16 11:09 wolfgang-janz

In the meanwhile vb.net support for some more inspections

wolfgang-janz avatar Sep 21 '16 13:09 wolfgang-janz

If someone need both vb.net and the new support for resharper 2017.2, come and see my fork

MO2k4 avatar Oct 04 '17 16:10 MO2k4

i just released my fork to the resharper gallery, because this project seems dead, feel free to contribute to my fork link

i added your request and added some rules myself

MO2k4 avatar Mar 05 '18 06:03 MO2k4