Skip to content

Commit

Permalink
[GH-16] - scaffolding for VB version
Browse files Browse the repository at this point in the history
  • Loading branch information
tpodolak committed Jun 28, 2018
1 parent d508842 commit 183b5d1
Show file tree
Hide file tree
Showing 20 changed files with 7,486 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using System.Collections.Immutable;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.Diagnostics;
using Microsoft.CodeAnalysis.VisualBasic;
using Microsoft.CodeAnalysis.VisualBasic.Syntax;
using NSubstitute.Analyzers.Shared.DiagnosticAnalyzers;

namespace NSubstitute.Analyzers.VisualBasic.DiagnosticAnalyzers
{
[DiagnosticAnalyzer(LanguageNames.VisualBasic)]
internal class NonVirtualSetupReceivedAnalyzer : AbstractNonVirtualSetupReceivedAnalyzer<SyntaxKind>
{
protected override ImmutableArray<Parent> PossibleParents { get; } = ImmutableArray.Create(
Parent.Create<MemberAccessExpressionSyntax>(),
Parent.Create<InvocationExpressionSyntax>());

protected override SyntaxKind InvocationExpressionKind { get; } = SyntaxKind.InvocationExpression;

public NonVirtualSetupReceivedAnalyzer()
: base(new DiagnosticDescriptorsProvider())
{
}
}
}
33 changes: 30 additions & 3 deletions src/NSubstitute.Analyzers.VisualBasic/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions src/NSubstitute.Analyzers.VisualBasic/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -249,4 +249,16 @@
<value>Can not provide constructor arguments when substituting for a delegate.</value>
<comment>The title of the diagnostic.</comment>
</data>
<data name="NonVirtualReceivedSetupSpecificationDescription" xml:space="preserve">
<value>Non-virtual members can not be intercepted.</value>
<comment>An optional longer localizable description of the diagnostic.</comment>
</data>
<data name="NonVirtualReceivedSetupSpecificationMessageFormat" xml:space="preserve">
<value>Member {0} can not be intercepted. Only interface members and overrideable, overriding, and must override members can be intercepted.</value>
<comment>The format-able message the diagnostic displays.</comment>
</data>
<data name="NonVirtualReceivedSetupSpecificationTitle" xml:space="preserve">
<value>Non-virtual setup specification.</value>
<comment>The title of the diagnostic.</comment>
</data>
</root>
Loading

0 comments on commit 183b5d1

Please sign in to comment.