roslyn: CompilationEndAction not being called.

The UseAutoProp analyzer looks like this:

        public sealed override void Initialize(AnalysisContext context)
        {
            context.RegisterCompilationStartAction(csac =>
            {
                var analysisResults = new ConcurrentBag<AnalysisResult>();
                var ineligibleFields = new ConcurrentBag<IFieldSymbol>();

                csac.RegisterSymbolAction(sac => AnalyzeProperty(analysisResults, sac), SymbolKind.Property);
                RegisterIneligibleFieldsAction(csac, ineligibleFields);

                csac.RegisterCompilationEndAction(cac => Process(analysisResults, ineligibleFields, cac));
            });
        }

Even though we call RegisterCompilationEndAction, the call to the registered lambda never happens.

This means that UseAutoProp doesn’t actually work at all.

About this issue

  • Original URL
  • State: open
  • Created 8 years ago
  • Comments: 62 (61 by maintainers)

Commits related to this issue

Most upvoted comments

Capturing notes from @heejaechang ( after discussion we had following this https://github.com/dotnet/roslyn/pull/19067 )

@jinujoseph are we going to push making compilation end analyzer first citizen in VS as we discussed in the meeting? I think we should have bug opened to track the work.

the work we discussed

  1. make full solution analysis per solution option and make it on by default
  2. make full solution analysis to be 3 state.s On, Open Files, Off
  3. reduce delay from currently 5 seconds to 2 or less
  4. make code fix to work with compilation end analyzer (requires editor team’s help making LB to be asyncly updated) as good as other code fixes.
  5. change diagnostic analyzer contract that only compilation end analyzer can produce non local diagnostics (diagnostic that belong to other portion of compilation that it is currently analyzed such as tree, symbol and etc)
  6. add an option to CompilationWithAnalyzer that runs only analyzers with compilation end analysis

we want (1) to gives users full experience. (2) is for people with solution whose machine can’t handle/beefy enough to handle FSA. (3, 4) are too make compilation end analyzer/fixer has similar experience as other analyzer/fixer (5, 6) are needed so that we can run limit work we needs for compilation end analyzers.