Exemple #1
0
        private void AnalyzeSyntaxTree(SyntaxTreeAnalysisContext context)
        {
            var analyzerConfigOptions = context.Options.AnalyzerConfigOptionsProvider.GetOptions(
                context.Tree
                );

            FormattingAnalyzerHelper.AnalyzeSyntaxTree(
                context,
                SyntaxFormattingService,
                Descriptor,
                analyzerConfigOptions
                );
        }
        private void AnalyzeSyntaxTree(SyntaxTreeAnalysisContext context, ICodingConventionsManager codingConventionsManager)
        {
            var tree = context.Tree;
            var cancellationToken = context.CancellationToken;

            OptionSet options = CompilerAnalyzerConfigOptions.Empty;

            if (File.Exists(tree.FilePath))
            {
                var codingConventionContext = codingConventionsManager.GetConventionContextAsync(tree.FilePath, cancellationToken).GetAwaiter().GetResult();
                options = ApplyFormattingOptions(options, codingConventionContext);
            }

            FormattingAnalyzerHelper.AnalyzeSyntaxTree(context, SyntaxFormattingService, Descriptor, options);
        }
        private void AnalyzeSyntaxTree(SyntaxTreeAnalysisContext context, Workspace workspace, ICodingConventionsManager codingConventionsManager)
        {
            var tree = context.Tree;
            var cancellationToken = context.CancellationToken;

            var options = workspace.Options;

            if (File.Exists(tree.FilePath))
            {
                var codingConventionContext = codingConventionsManager.GetConventionContextAsync(tree.FilePath, cancellationToken).GetAwaiter().GetResult();
                options = ApplyFormattingOptions(options, codingConventionContext);
            }

            FormattingAnalyzerHelper.AnalyzeSyntaxTree(context, _descriptor, workspace, options);
        }
Exemple #4
0
        private void AnalyzeSyntaxTree(SyntaxTreeAnalysisContext context)
        {
            var options = context.GetAnalyzerOptions().GetSyntaxFormattingOptions(SyntaxFormatting);

            FormattingAnalyzerHelper.AnalyzeSyntaxTree(context, SyntaxFormatting, Descriptor, options);
        }
        private void AnalyzeSyntaxTree(SyntaxTreeAnalysisContext context)
        {
            var options = SyntaxFormatting.GetFormattingOptions(context.Options.AnalyzerConfigOptionsProvider.GetOptions(context.Tree));

            FormattingAnalyzerHelper.AnalyzeSyntaxTree(context, SyntaxFormatting, Descriptor, options);
        }