public ProjectInterfaceResolver(IDictionary <string, IClassStructure> analyzedClasses, IDictionary <string, IFileStructure> analyzedFiles, IDoLog logger) { _resolver = new ConcurrentDictionary <string, IClassStructure>(); _analyzedClasses = analyzedClasses; _analyzedFiles = analyzedFiles; _logger = logger; }
/// <summary> /// Uses Microsoft.Build.Locator.MSBuildLocator to locate VisualStudio instances and subsequently the MSBuild executable. Then creates a MSBuildWorkspace. /// </summary> /// <param name="logger">Logger implementing IDoLog</param> /// <param name="selectionHandler">Used when multiple VisualStudio instances are found. Defaults to TakeLastVsInstance.<br/> /// If you want to ask the user use SelectVsInstanceOnCli or provide your own implementation.</param> public WorkspaceCreator(IDoLog logger = null, ISelectionHandler selectionHandler = null) { var _ = typeof(Microsoft.CodeAnalysis.CSharp.Formatting.CSharpFormattingOptions); //hack needed to copy Microsoft.CodeAnalysis.CSharp.Workspaces _selectionHandler = selectionHandler ?? new TakeLastVsInstance(); _logger = logger ?? new NullLogger(); }
protected AbstractSyntaxDrawer(IInterfaceResolver interfaceResolver, ISyntaxDrawerFactory drawerFactory, StringBuilder diagramToDrawTo, string entryMethod) { _interfaceResolver = interfaceResolver; _diagram = diagramToDrawTo; _entryMethod = entryMethod; _drawerFactory = drawerFactory; _logger = new NullLogger(); }
public SyntaxDrawerFactory(IDictionary <string, IClassStructure> analyzedClasses, string entryMethod, IDoLog logger) { _analyzedClasses = analyzedClasses; _entryMethod = entryMethod; if (logger == null) { logger = new NullLogger(); } _logger = logger; }
public SolutionLoader(IWorkspaceCreator workspaceCreator, IDoLog logger = null) { var _ = typeof(Microsoft.CodeAnalysis.CSharp.SymbolDisplay); _workspaceCreator = workspaceCreator; if (logger == null) { logger = new NullLogger(); } _logger = logger; }
public ProjectAnalyzer(Solution solution, IEnumerable <string> solutionOutputFiles, IDoLog logger) { _solution = solution; _outputFiles = solutionOutputFiles; if (logger == null) { logger = new NullLogger(); } _logger = logger; }
public SequenceDiagramGenerator(IDictionary <string, IClassStructure> analyzedClasses, IInterfaceResolver interfaceResolver, IDoLog logger = null) { _analyzedClasses = analyzedClasses; _diagram = new StringBuilder(); _ifaceResolver = interfaceResolver; if (_logger == null) { _logger = new NullLogger(); } _logger = logger; }
private static async Task RunAnalysis(ProgramOptions options) { _logger = new ConsoleLogger(verbose: options.VerboseLogging, debug: options.DebugLogging); using (var solLoader = new SolutionLoader(_logger)) { var solution = await solLoader.LoadSolution(options.PathToSolution); var extractor = new SymbolExtractorWithCompilation(_logger); var declaredSymbols = await extractor.FindSymbols(solution, options.FullTypeName, options.MethodName, options.MethodArguments); _logger.Info($"Did not find anything for {options.FullTypeName}.{options.MethodName}({string.Join(", ", options.MethodArguments)})"); await ArgumentExtraction(declaredSymbols, solution, options); } }
public SolutionAnalyzer(string solution, IDoLog logger = null) { if (!File.Exists(solution)) { throw new FileNotFoundException("Solution not found! Was looking for " + solution); } _solution = solution; if (logger == null) { logger = new NullLogger(); } _logger = logger; }
public SolutionLoader(IDoLog logger, int?defaultVSInstance = null) { _logger = logger ?? new NullLogger(); // Attempt to set the version of MSBuild. var visualStudioInstances = MSBuildLocator.QueryVisualStudioInstances().ToArray(); var instance = GetInstance(visualStudioInstances, defaultVSInstance); _logger.Info($"Using MSBuild at '{instance.MSBuildPath}' to load projects."); // NOTE: Be sure to register an instance with the MSBuildLocator // before calling MSBuildWorkspace.Create() // otherwise, MSBuildWorkspace won't MEF compose. if (!MSBuildLocator.IsRegistered) { MSBuildLocator.RegisterInstance(instance); } _workspace = MSBuildWorkspace.Create(); }
public SelectVsInstanceOnCli(IDoLog logger) { _logger = logger ?? new NullLogger(); }
public static IInterfaceResolver GetInterfaceResolver(ISolutionAnalyzer soltion, IProjectAnalyzer project, IDoLog logger, ConfigContext ctx) { if (ctx.IFaceResolver == InterfaceResolverType.ProjectLevel) { return(new ProjectInterfaceResolver(project.AnalyzedClasses, project.AnalyzedFiles, logger)); } throw new NotImplementedException(); }
public ConsoleProgressReporter(IDoLog logger) { _logger = logger ?? new NullLogger(); }
public SymbolExtractorWithSymbolFinder(IDoLog logger) { _logger = logger ?? new NullLogger(); }
public SymbolExtractorWithCompilation(IDoLog logger) { _logger = logger ?? new NullLogger(); }
/// <summary> /// /// </summary> /// <param name="hintPath">Overwrites using of default SDK paths to search for dotNETCore SDKs.</param> /// <param name="logger">Implementation of a logger according to the IDoLog interface, defaults to NullLogger.</param> /// <param name="msBuildLocator">Supply your own search logic to locate MSBuild.dll by implementing the IMsBuildLocator interface.</param> public WorkspaceCreator(string hintPath = "", IDoLog logger = null, IMsBuildLocator msBuildLocator = null) { _logger = logger ?? new NullLogger(); _locator = msBuildLocator ?? new MsBuildLocator(); _hintPath = hintPath; }
public InvocationArgumentExtractor(IDoLog logger) { _logger = logger ?? new NullLogger(); }
internal void AppendLogger(IDoLog logger) { _logger = logger; }