Example #1
0
 void AnalyzeRuntimeIdentifiers(PropertyWriteDiagnosticContext ctx)
 {
     if (ctx.Node is ExpressionText t && t.Value.IndexOf(';') < 0)
     {
         ctx.ReportDiagnostic(new MSBuildDiagnostic(UseRuntimeIdentifierForSingleRID, ctx.XElement.Span));
     }
 }
 void AnalyzeTargetFrameworks(PropertyWriteDiagnosticContext ctx)
 {
     if (ctx.Node is ExpressionText t && t.Value.IndexOf(';') < 0)
     {
         ctx.ReportDiagnostic(new MSBuildDiagnostic(UseTargetFrameworkForSingleFramework, ctx.XElement.Span));
     }
 }
Example #3
0
 void AnalyzeRuntimeIdentifier(PropertyWriteDiagnosticContext ctx)
 {
     // right now the visitor parses the expression with lists disabled because the type system says it doesn't expect lists, so we get a text node
     // however, once we attach parsed expressions into the AST they will likely have all options enabled and could be lists
     if (ctx.Node is ListExpression || (ctx.Node is ExpressionText t && t.Value.IndexOf(';') > -1))
     {
         ctx.ReportDiagnostic(new MSBuildDiagnostic(UseRuntimeIdentifiersForMultipleRIDs, ctx.XElement.Span));
     }
 }
 void AnalyzeProperty(PropertyWriteDiagnosticContext ctx) => ctx.ReportDiagnostic(new MSBuildDiagnostic(SupportedDiagnostics[0], ctx.Element.Span));