public static IEnumerable <IAnalysisFixAction> GetActions(Document doc, FixableResult result) { foreach (var fix in result.Fixes) { foreach (var handler in AnalysisExtensions.GetFixHandlers(fix.FixType)) { foreach (var action in handler.GetFixes(doc, fix)) { yield return(action); } } } }
public static IList <Result> Analyze <T> (T input, RuleTreeType treeType) { Debug.Assert(typeof(T) == AnalysisExtensions.GetType(treeType.Input)); var tree = AnalysisExtensions.GetAnalysisTree(treeType); if (tree == null) { return(RuleTreeLeaf.Empty); } //force to analyze immediately by evaluating into a list return(tree.Analyze(input).ToList()); }
public static IEnumerable <Result> Analyze <T> (T input, RuleTreeType treeType, CancellationToken cancellationToken = default(CancellationToken)) { Debug.Assert(typeof(T) == AnalysisExtensions.GetType(treeType.Input)); var tree = AnalysisExtensions.GetAnalysisTree(treeType); if (tree == null) { return(RuleTreeLeaf.Empty); } //force to analyze immediately by evaluating into a list return(tree.Analyze(input, cancellationToken).ToList()); }