public IEnumerable <T> Get <T>(ICompilationDocument document) { var syntaxTreeAsync = document.SyntaxTree; var checkClasses = Visit <T>(syntaxTreeAsync, document.Compile, this, document); foreach (var checkClass in checkClasses) { yield return(checkClass); } }
public CheckClasses(ICompilationDocument document, ICompilationInfo compile, string pattern) : base(document, compile, pattern, "class") { }
public CheckFile(ICompilationDocument document, ICompilationInfo compile) { this.document = document; this.compile = compile; this.Name = document.Name; }
protected CheckTypes(ICompilationDocument document, ICompilationInfo compile, string pattern, string typeName) : this(compile.Get <T>(document), pattern, typeName) { }
private static IEnumerable <T> Visit <T>(SyntaxTree syntaxTreeAsync, Microsoft.CodeAnalysis.Compilation compile, ICompilationInfo compilationInfo, ICompilationDocument document) { CheckClassVisitor visitor; if (!CompilationDocumentResult.TryGetValue(document.FullName, out visitor)) { var semanticModel = compile.GetSemanticModel(syntaxTreeAsync); visitor = new CheckClassVisitor(document, semanticModel, compilationInfo); visitor.Visit(syntaxTreeAsync.GetRoot()); CompilationDocumentResult.Add(document.FullName, visitor); } return(visitor.Get <T>()); }