Exemplo n.º 1
0
 static async Task AnalyzeSyntaxAsync(
     IIncrementalAnalyzer analyzer,
     TextDocument textDocument,
     InvocationReasons reasons,
     CancellationToken cancellationToken
     )
 {
     if (textDocument is Document document)
     {
         await analyzer
         .AnalyzeSyntaxAsync(
             (Document)document,
             reasons,
             cancellationToken
             )
         .ConfigureAwait(false);
     }
     else if (analyzer is IIncrementalAnalyzer2 analyzer2)
     {
         await analyzer2
         .AnalyzeNonSourceDocumentAsync(
             textDocument,
             reasons,
             cancellationToken
             )
         .ConfigureAwait(false);
     }
 }
Exemplo n.º 2
0
        private static async Task RunAllAnalysisAsync(IIncrementalAnalyzer analyzer, Document document)
        {
            await analyzer.AnalyzeSyntaxAsync(document, InvocationReasons.Empty, CancellationToken.None).ConfigureAwait(false);

            await analyzer.AnalyzeDocumentAsync(document, bodyOpt : null, reasons : InvocationReasons.Empty, cancellationToken : CancellationToken.None).ConfigureAwait(false);

            await analyzer.AnalyzeProjectAsync(document.Project, semanticsChanged : true, reasons : InvocationReasons.Empty, cancellationToken : CancellationToken.None).ConfigureAwait(false);
        }
 private static async Task RunAllAnalysisAsync(IIncrementalAnalyzer analyzer, Document document)
 {
     await analyzer.AnalyzeSyntaxAsync(document, InvocationReasons.Empty, CancellationToken.None).ConfigureAwait(false);
     await analyzer.AnalyzeDocumentAsync(document, bodyOpt: null, reasons: InvocationReasons.Empty, cancellationToken: CancellationToken.None).ConfigureAwait(false);
     await analyzer.AnalyzeProjectAsync(document.Project, semanticsChanged: true, reasons: InvocationReasons.Empty, cancellationToken: CancellationToken.None).ConfigureAwait(false);
 }