From 0aa3a7d0086fe80c094b0013904b28001154d918 Mon Sep 17 00:00:00 2001 From: veigr Date: Mon, 8 Feb 2016 19:40:07 +0900 Subject: [PATCH] =?UTF-8?q?InvalidGuidMetadataAnalyzer=20=20=E3=81=8C=20Ar?= =?UTF-8?q?gumentException=20=E3=82=92=E5=90=90=E3=81=8F=E3=81=93=E3=81=A8?= =?UTF-8?q?=E3=81=8C=E3=81=82=E3=82=8B=E5=95=8F=E9=A1=8C=E3=82=92=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../InvalidGuidMetadataAnalyzer.cs | 2 +- .../KanColleViewer.PluginAnalyzer/Properties/AssemblyInfo.cs | 2 +- source/Analyzers/KanColleViewer.PluginAnalyzer/Utility.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/source/Analyzers/KanColleViewer.PluginAnalyzer/InvalidGuidMetadataAnalyzer.cs b/source/Analyzers/KanColleViewer.PluginAnalyzer/InvalidGuidMetadataAnalyzer.cs index ad76c8eb5..31c41b35c 100644 --- a/source/Analyzers/KanColleViewer.PluginAnalyzer/InvalidGuidMetadataAnalyzer.cs +++ b/source/Analyzers/KanColleViewer.PluginAnalyzer/InvalidGuidMetadataAnalyzer.cs @@ -53,7 +53,7 @@ private static void AnalyzeCompilation(CompilationAnalysisContext context) // GUID として解釈できない値か、IPlugin で未定義の GUID が指定されてたらアウト var guidMetadata = syntax.GetGuidMetadata(semanticModel); if (!guidMetadata.HasValue - || plugins.All(x => x.GetGuidMetadataValueSyntax()?.GetGuidMetadata(semanticModel) != guidMetadata)) + || plugins.All(x => x.GetGuidMetadataValueSyntax()?.GetGuidMetadata(compilation.GetSemanticModel(x.SyntaxTree)) != guidMetadata)) { context.ReportDiagnostic(Diagnostic.Create(InvalidGuidMetadataRule, p.GetLocation())); } diff --git a/source/Analyzers/KanColleViewer.PluginAnalyzer/Properties/AssemblyInfo.cs b/source/Analyzers/KanColleViewer.PluginAnalyzer/Properties/AssemblyInfo.cs index 4654394ef..32798a2f9 100644 --- a/source/Analyzers/KanColleViewer.PluginAnalyzer/Properties/AssemblyInfo.cs +++ b/source/Analyzers/KanColleViewer.PluginAnalyzer/Properties/AssemblyInfo.cs @@ -24,4 +24,4 @@ // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("1.1.0.0")] +[assembly: AssemblyVersion("1.1.1.0")] diff --git a/source/Analyzers/KanColleViewer.PluginAnalyzer/Utility.cs b/source/Analyzers/KanColleViewer.PluginAnalyzer/Utility.cs index 48abde86e..651e87a9a 100644 --- a/source/Analyzers/KanColleViewer.PluginAnalyzer/Utility.cs +++ b/source/Analyzers/KanColleViewer.PluginAnalyzer/Utility.cs @@ -134,7 +134,7 @@ private static string GetGuidMetadataConstantValue(this AttributeArgumentSyntax { if (syntax == null) return null; var constantValue = semanticModel.GetConstantValue(syntax.Expression); - return constantValue.Value?.ToString() ?? null; + return constantValue.Value?.ToString(); } public static AttributeArgumentSyntax GetGuidMetadataValueSyntax(this ClassDeclarationSyntax classDeclaration)