Exemplo n.º 1
0
        public void Analyze(SemanticModelAnalysisContext context)
        {
            var semanticModel     = context.SemanticModel;
            var syntaxTree        = semanticModel.SyntaxTree;
            var cancellationToken = context.CancellationToken;

            if (!context.GetIdeAnalyzerOptions().DetectAndOfferEditorFeaturesForProbableJsonStrings)
            {
                return;
            }

            var detector = JsonLanguageDetector.GetOrCreate(semanticModel.Compilation, _info);
            var root     = syntaxTree.GetRoot(cancellationToken);

            Analyze(context, detector, root, cancellationToken);
        }
        public void Analyze(SemanticModelAnalysisContext context)
        {
            var semanticModel     = context.SemanticModel;
            var syntaxTree        = semanticModel.SyntaxTree;
            var cancellationToken = context.CancellationToken;

            var option = context.Options.GetIdeOptions().ReportInvalidJsonPatterns;

            if (!option)
            {
                return;
            }

            var detector = JsonLanguageDetector.GetOrCreate(semanticModel.Compilation, _info);
            var root     = syntaxTree.GetRoot(cancellationToken);

            Analyze(context, detector, root, cancellationToken);
        }