Skip to content

Commit

Permalink
Stop analyzing properties (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter M authored Apr 25, 2019
1 parent 196ada9 commit 2b3f056
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
<Metadata>
<Identity Id="MalikP.Analyzers.AsyncMethodAnalyzer.E522C155-0DAB-4279-946A-DD03A34258F4" Version="0.3.17" Language="en-US" Publisher="MalikP. (Peter Malik)"/>
<Identity Id="MalikP.Analyzers.AsyncMethodAnalyzer.E522C155-0DAB-4279-946A-DD03A34258F4" Version="0.3.18" Language="en-US" Publisher="MalikP. (Peter Malik)"/>
<DisplayName>MalikP. Async Method Analyzer (VS 2017)</DisplayName>
<Description xml:space="preserve">This is a diagnostic extension for the .NET Compiler Platform ("Roslyn") to analyze asynchronous methods. </Description>
<MoreInfo>https://github.com/peterM/Roslyn-Analyzers</MoreInfo>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<PropertyGroup>
<PackageId>MalikP.Analyzers.AsyncMethodAnalyzer_VS2017</PackageId>
<PackageVersion>0.3.17.0</PackageVersion>
<PackageVersion>0.3.18.0</PackageVersion>
<Authors>Peter Malik</Authors>
<!--<PackageLicenseUrl>https://raw.githubusercontent.com/peterM/Roslyn-Analyzers/master/LICENSE</PackageLicenseUrl>-->
<PackageLicenseFile>LICENSE.txt</PackageLicenseFile>
Expand All @@ -24,7 +24,7 @@
<PackageTags>Async, analyzers</PackageTags>
<NoPackageAnalysis>true</NoPackageAnalysis>
<AssemblyName>MalikP.Analyzers.AsyncMethodAnalyzer15</AssemblyName>
<Version>0.3.17</Version>
<Version>0.3.18</Version>
<Company>MalikP.</Company>
<Product>Asynchronous Method Analyzer (VS2017)</Product>
<RootNamespace>MalikP.Analyzers.AsyncMethodAnalyzer</RootNamespace>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
<Metadata>
<Identity Id="MalikP.Analyzers.AsyncMethodAnalyzer.88168c91-88a1-4722-aae0-c44043b7a9f6" Version="0.3.17" Language="en-US" Publisher="MalikP. (Peter Malik)"/>
<Identity Id="MalikP.Analyzers.AsyncMethodAnalyzer.88168c91-88a1-4722-aae0-c44043b7a9f6" Version="0.3.18" Language="en-US" Publisher="MalikP. (Peter Malik)"/>
<DisplayName>MalikP. Async Method Analyzer (VS 2019)</DisplayName>
<Description xml:space="preserve">This is a diagnostic extension for the .NET Compiler Platform ("Roslyn") to analyze asynchronous methods. </Description>
<MoreInfo>https://github.com/peterM/Roslyn-Analyzers</MoreInfo>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,23 @@ protected AnalyzerCanContinueMethodResult GetContinuationResult(SyntaxNodeAnalys
return result;
}

if (IsMethodKindValid(methodSymbol.MethodKind))
{
return result;
}

if (!(methodSymbol?.ReturnType is INamedTypeSymbol returnTypeSymbol))
{
return result;
}

return new AnalyzerCanContinueMethodResult(methodSymbol, returnTypeSymbol, true);
}

protected virtual bool IsMethodKindValid(MethodKind methodKind)
{
return methodKind != MethodKind.PropertyGet
&& methodKind != MethodKind.PropertySet;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,23 @@ protected AnalyzerCanContinueMethodResult GetContinuationResult(SymbolAnalysisCo
return result;
}

if (!IsMethodKindValid(methodSymbol.MethodKind))
{
return result;
}

if (!(methodSymbol?.ReturnType is INamedTypeSymbol returnTypeSymbol))
{
return result;
}

return new AnalyzerCanContinueMethodResult(methodSymbol, returnTypeSymbol, true);
}

protected virtual bool IsMethodKindValid(MethodKind methodKind)
{
return methodKind != MethodKind.PropertyGet
&& methodKind != MethodKind.PropertySet;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<PropertyGroup>
<PackageId>MalikP.Analyzers.AsyncMethodAnalyzer</PackageId>
<PackageVersion>0.3.17.0</PackageVersion>
<PackageVersion>0.3.18.0</PackageVersion>
<Authors>Peter Malik</Authors>
<!--<PackageLicenseUrl>https://raw.githubusercontent.com/peterM/Roslyn-Analyzers/master/LICENSE</PackageLicenseUrl>-->
<PackageLicenseFile>LICENSE.txt</PackageLicenseFile>
Expand All @@ -24,7 +24,7 @@
<PackageTags>Async, analyzers</PackageTags>
<NoPackageAnalysis>true</NoPackageAnalysis>
<AssemblyName>MalikP.Analyzers.AsyncMethodAnalyzer16</AssemblyName>
<Version>0.3.17</Version>
<Version>0.3.18</Version>
<Company>MalikP.</Company>
<Product>Asynchronous Method Analyzer (VS2019)</Product>
<RootNamespace>MalikP.Analyzers.AsyncMethodAnalyzer</RootNamespace>
Expand Down

0 comments on commit 2b3f056

Please sign in to comment.