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

            FormattingAnalyzerHelper.AnalyzeSyntaxTree(
                context,
                SyntaxFormattingService,
                Descriptor,
                analyzerConfigOptions
                );
        }
예제 #2
0
        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);
        }
예제 #4
0
        private void AnalyzeSyntaxTree(SyntaxTreeAnalysisContext context)
        {
            var options = context.GetAnalyzerOptions().GetSyntaxFormattingOptions(SyntaxFormatting);

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

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