internal ElementDiagnosticContext(
     MSBuildAnalysisSession session,
     MSBuildElement element)
 {
     this.session = session;
     Element      = element;
 }
Пример #2
0
 internal AttributeDiagnosticContext(
     MSBuildAnalysisSession session,
     MSBuildAttribute attribute)
 {
     this.session = session;
     Attribute    = attribute;
 }
 internal ElementDiagnosticContext(
     MSBuildAnalysisSession session,
     XElement element,
     MSBuildElementSyntax elementSyntax)
 {
     this.session  = session;
     Element       = element;
     ElementSyntax = elementSyntax;
 }
Пример #4
0
 internal PropertyWriteDiagnosticContext(
     MSBuildAnalysisSession session, XElement element, ValueInfo info, MSBuildValueKind kind, ExpressionNode node)
 {
     this.session = session;
     Element      = element;
     Info         = info;
     Kind         = kind;
     Node         = node;
 }
        public List <MSBuildDiagnostic> Analyze(MSBuildRootDocument doc, CancellationToken token)
        {
            var session = new MSBuildAnalysisSession(context, doc, token);
            var visitor = new MSBuildAnalyzerVisitor(session);

            visitor.Run(doc, token: token);

            session.AddCoreDiagnostics(doc.Diagnostics);

            return(session.Diagnostics);
        }
 internal AttributeDiagnosticContext(
     MSBuildAnalysisSession session,
     XElement element,
     XAttribute attribute,
     MSBuildElementSyntax elementSyntax,
     MSBuildAttributeSyntax attributeSyntax)
 {
     this.session    = session;
     Element         = element;
     Attribute       = attribute;
     ElementSyntax   = elementSyntax;
     AttributeSyntax = attributeSyntax;
 }
        public List <MSBuildDiagnostic> Analyze(MSBuildRootDocument doc, bool includeFilteredCoreDiagnostics, CancellationToken token)
        {
            var session = new MSBuildAnalysisSession(context, doc, token);

            AnalyzeElement(doc.ProjectElement, session, token);

            if (includeFilteredCoreDiagnostics)
            {
                session.AddCoreDiagnostics(doc.Diagnostics);
            }

            return(session.Diagnostics);
        }
        static void AnalyzeElement(MSBuildElement element, MSBuildAnalysisSession session, CancellationToken token)
        {
            token.ThrowIfCancellationRequested();

            session.ExecuteElementActions(element);

            foreach (var child in element.Elements)
            {
                AnalyzeElement(child, session, token);
            }

            foreach (var att in element.Attributes)
            {
                session.ExecuteAttributeActions(att);
            }

            if (element is MSBuildPropertyElement propertyElement)
            {
                session.ExecutePropertyWriteActions(propertyElement);
            }
        }
 public MSBuildAnalyzerVisitor(MSBuildAnalysisSession session)
 {
     this.session = session;
 }
Пример #10
0
 internal PropertyWriteDiagnosticContext(
     MSBuildAnalysisSession session, MSBuildPropertyElement element)
 {
     this.session = session;
     Element      = element;
 }