public static async Task <Solution> ApplyCodeFix(Document document, TextSpan diagnosticSpan, CancellationToken ct) { var root = await document.GetSyntaxRootAsync(ct).ConfigureAwait(false); var declaration = root.FindToken(diagnosticSpan.Start) .Parent .AncestorsAndSelf() .OfType <TypeDeclarationSyntax>() .First(); if (!(declaration is ClassDeclarationSyntax ids)) { return(document.Project.Solution); } var syntax = await PassiveDeclarationSyntax.FromParseAsync(ids, document, ct); var semantics = SemanticsRoot.FromSyntax(syntax); var template = new PassiveProcessTemplate(semantics); return(ApplyGeneratedCode(document, template)); }
public FinalPropertyTemplate(SemanticsRoot root) { Root = root; }
public PassiveProcessHookHandlerTemplate(SemanticsRoot root) { Root = root; }
public DomainContextTemplate(SemanticsRoot root) { Root = root; }
public PassiveProcessTemplate(SemanticsRoot root) { Root = root; }