Skip to content
This repository has been archived by the owner. It is now read-only.

Commit

Permalink
XmlDocAnalyzer now uses ConfigureGeneratedCodeAnalysis API, too.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rpinski committed Apr 12, 2016
1 parent 8562cba commit 536692c
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public class XmlDocAnalyzer : DiagnosticAnalyzer

public override void Initialize(AnalysisContext context)
{
context.ConfigureGeneratedCodeAnalysis(GeneratedCodeAnalysisFlags.None);
context.RegisterCompilationStartAction(compilationContext =>
{
var compilation = compilationContext.Compilation;
Expand All @@ -41,8 +42,6 @@ public override void Initialize(AnalysisContext context)
var semanticModel = compilation.GetSemanticModel(ctx.Tree);
var root = await ctx.Tree.GetRootAsync(ctx.CancellationToken).ConfigureAwait(false);
var model = compilationContext.Compilation.GetSemanticModel(ctx.Tree);
if (model.IsFromGeneratedCode(compilationContext.CancellationToken))
return;
new GatherVisitor(ctx, semanticModel).Visit(root);
}
catch (OperationCanceledException) { }
Expand Down

0 comments on commit 536692c

Please sign in to comment.