public List <IDEFileActions> RunIncremental(List <string> updatedFiles, RootNodes projectRules) { var ideFileActions = new List <IDEFileActions>(); var allReferences = _sourceFileResults?.SelectMany(s => s.References).Distinct(); RulesFileLoader rulesFileLoader = new RulesFileLoader(allReferences, Constants.RulesDefaultPath, RulesEngineConfiguration.TargetVersions, string.Empty, RulesEngineConfiguration.AssemblyDir); projectRules = rulesFileLoader.Load(); RulesAnalysis walker = new RulesAnalysis(_sourceFileResults, projectRules); var projectActions = walker.Analyze(); CodeReplacer baseReplacer = new CodeReplacer(_sourceFileBuildResults, RulesEngineConfiguration, _metaReferences, updatedFiles); _projectResult.ExecutedActions = baseReplacer.Run(projectActions, RulesEngineConfiguration.ProjectType); ideFileActions = projectActions .FileActions .SelectMany(f => f.NodeTokens.Select(n => new IDEFileActions() { TextSpan = n.TextSpan, Description = n.Description, FilePath = f.FilePath, TextChanges = n.TextChanges })) .ToList(); return(ideFileActions); }
/// <summary> /// Runs the project rewriter using a previously initialized analysis /// </summary> /// <param name="projectActions"></param> public ProjectResult Run(ProjectActions projectActions) { _projectResult.ProjectActions = projectActions; CodeReplacer baseReplacer = new CodeReplacer(_sourceFileBuildResults, RulesEngineConfiguration, _metaReferences); _projectResult.ExecutedActions = baseReplacer.Run(projectActions, RulesEngineConfiguration.ProjectType); return(_projectResult); }
/// <summary> /// Runs the project rewriter using a previously initialized analysis /// </summary> /// <param name="projectActions"></param> public virtual ProjectResult Run(ProjectActions projectActions) { _projectResult.ProjectActions = projectActions; CodeReplacer baseReplacer = new CodeReplacer(_sourceFileBuildResults, ProjectConfiguration, _metaReferences, _analyzerResult, projectResult: _projectResult); _projectResult.ExecutedActions = baseReplacer.Run(projectActions, ProjectConfiguration.ProjectType); return(_projectResult); }