internal static AnalyzersFromAssembly CreateFrom(System.Reflection.Assembly asm, bool force = false) { var result = new AnalyzersFromAssembly(); result.AddAssembly(asm, force); return(result); }
static BuiltInCodeDiagnosticProvider () { builtInDiagnostics = Task.Run (() => { var result = new AnalyzersFromAssembly (); foreach (var asm in AppDomain.CurrentDomain.GetAssemblies()) { try { result.AddAssembly (asm); } catch (Exception e) { LoggingService.LogError ("error while loading diagnostics in " + asm.FullName, e); } } return result; }); }
static BuiltInCodeDiagnosticProvider() { builtInDiagnostics = Task.Run(() => { var result = new AnalyzersFromAssembly(); foreach (var asm in AppDomain.CurrentDomain.GetAssemblies()) { try { result.AddAssembly(asm); } catch (Exception e) { LoggingService.LogError("error while loading diagnostics in " + asm.FullName, e); } } return(result); }); }
static BuiltInCodeDiagnosticProvider() { RefactoringEssentials.NRefactory6Host.GetLocalizedString = GettextCatalog.GetString; builtInDiagnostics = Task.Run(() => { var result = new AnalyzersFromAssembly(); foreach (var asm in AppDomain.CurrentDomain.GetAssemblies()) { try { result.AddAssembly(asm); } catch (Exception e) { LoggingService.LogError("Error while loading diagnostics in " + asm.FullName, e); } } return(result); }); }
internal static AnalyzersFromAssembly CreateFrom (System.Reflection.Assembly asm, bool force = false) { var result = new AnalyzersFromAssembly (); result.AddAssembly (asm, force); return result; }
static Task<AnalyzersFromAssembly> GetProjectDiagnosticsAsync (Project project, string language, CancellationToken cancellationToken) { if (project == null) return Task.FromResult (AnalyzersFromAssembly.Empty); AnalyzersFromAssembly result; if (diagnosticCache.TryGetValue(project, out result)) return Task.FromResult (result); result = new AnalyzersFromAssembly (); var dotNetProject = project as DotNetProject; if (dotNetProject != null) { var proxy = new DotNetProjectProxy (dotNetProject); if (proxy.HasPackages ()) { var packagesPath = new SolutionPackageRepositoryPath (proxy); foreach (var file in Directory.EnumerateFiles (packagesPath.PackageRepositoryPath, "*.dll", SearchOption.AllDirectories)) { cancellationToken.ThrowIfCancellationRequested (); try { var asm = Assembly.LoadFrom (file); result.AddAssembly (asm); } catch (Exception) { } } } } diagnosticCache[project] = result; return Task.FromResult (result); }