Skip to content

Commit

Permalink
Remove VB support from analyzer (#22211)
Browse files Browse the repository at this point in the history
Fixes #22177
  • Loading branch information
roji authored Aug 25, 2020
1 parent ff60c29 commit 7cfa858
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
1 change: 0 additions & 1 deletion src/EFCore.Analyzers/EFCore.Analyzers.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
<ItemGroup>
<!-- NB: Version affects the minimum required Visual Studio version -->
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="$(MicrosoftCodeAnalysisVersion)" PrivateAssets="all" />
<PackageReference Include="Microsoft.CodeAnalysis.VisualBasic" Version="$(MicrosoftCodeAnalysisVersion)" PrivateAssets="all" />
<PackageReference Update="NETStandard.Library" PrivateAssets="all" />
</ItemGroup>

Expand Down
10 changes: 2 additions & 8 deletions src/EFCore.Analyzers/InternalUsageDiagnosticAnalyzer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@
using Microsoft.CodeAnalysis.Diagnostics;
using Microsoft.CodeAnalysis.Operations;
using CSharpSyntax = Microsoft.CodeAnalysis.CSharp.Syntax;
using VBSyntax = Microsoft.CodeAnalysis.VisualBasic.Syntax;

namespace Microsoft.EntityFrameworkCore
{
[DiagnosticAnalyzer(LanguageNames.CSharp, LanguageNames.VisualBasic)]
[DiagnosticAnalyzer(LanguageNames.CSharp)]
public class InternalUsageDiagnosticAnalyzer : DiagnosticAnalyzer
{
public const string Id = "EF1001";
Expand Down Expand Up @@ -300,12 +299,7 @@ CSharpSyntax.VariableDeclaratorSyntax declarator
: (SyntaxNode)declarator,
CSharpSyntax.TypeOfExpressionSyntax s => s.Type,

VBSyntax.InvocationExpressionSyntax s
when s.Expression is VBSyntax.MemberAccessExpressionSyntax memberAccessSyntax
=> memberAccessSyntax.Name,
VBSyntax.MemberAccessExpressionSyntax s => s.Name,
VBSyntax.ObjectCreationExpressionSyntax s => s.Type,
VBSyntax.TypeOfExpressionSyntax s => s.Type,
// TODO: VB syntax narrowing (#22085)

_ => syntax
};
Expand Down

0 comments on commit 7cfa858

Please sign in to comment.