private bool OnSymbolDeclaredEventProcessed_NoLock(SymbolDeclaredCompilationEvent symbolDeclaredEvent)
            {
                // Check if the symbol event has been completely processed or not.

                // Have the symbol actions executed?
                if (!IsEntityFullyProcessed_NoLock(symbolDeclaredEvent.Symbol, _pendingSymbols))
                {
                    return(false);
                }

                // Have the node/code block actions executed for all symbol declarations?
                if (!AreDeclarationsProcessed_NoLock(symbolDeclaredEvent.Symbol, symbolDeclaredEvent.DeclaringSyntaxReferences.Length))
                {
                    return(false);
                }

                // Have the symbol end actions, if any, executed?
                if (_lazyPendingSymbolEndAnalyses != null && !IsEntityFullyProcessed_NoLock(symbolDeclaredEvent.Symbol, _lazyPendingSymbolEndAnalyses))
                {
                    return(false);
                }

                // Mark declarations completely processed.
                MarkDeclarationsProcessed_NoLock(symbolDeclaredEvent.Symbol);

                // Mark the symbol event completely processed.
                return(MarkEntityProcessed_NoLock(symbolDeclaredEvent, _pendingEvents, _analyzerStateDataPool));
            }
 public bool OnSymbolDeclaredEventProcessed(SymbolDeclaredCompilationEvent symbolDeclaredEvent)
 {
     lock (_gate)
     {
         return(OnSymbolDeclaredEventProcessed_NoLock(symbolDeclaredEvent));
     }
 }
예제 #3
0
 private async Task OnSymbolDeclaredEventProcessedAsync(
     SymbolDeclaredCompilationEvent symbolDeclaredEvent,
     ImmutableArray <DiagnosticAnalyzer> analyzers,
     Func <ISymbol, DiagnosticAnalyzer, Task> onSymbolAndMembersProcessedAsync)
 {
     foreach (var analyzer in analyzers)
     {
         var analyzerState = GetAnalyzerState(analyzer);
         if (analyzerState.OnSymbolDeclaredEventProcessed(symbolDeclaredEvent))
         {
             await onSymbolAndMembersProcessedAsync(symbolDeclaredEvent.Symbol, analyzer).ConfigureAwait(false);
         }
     }
 }
 private SymbolDeclaredCompilationEvent(SymbolDeclaredCompilationEvent original, SemanticModel newSemanticModel) : this(original.Compilation, original.Symbol)
 {
     _semanticModel = newSemanticModel;
 }
예제 #5
0
 public static bool ShouldSkipSymbolAnalysis(SymbolDeclaredCompilationEvent symbolEvent)
 {
     // Skip symbol actions for implicitly declared symbols and non-source symbols.
     return(symbolEvent.Symbol.IsImplicitlyDeclared || symbolEvent.DeclaringSyntaxReferences.All(s => s.SyntaxTree == null));
 }