/// <summary>Values for these parameters can be provided (during testing) for mocking purposes.</summary> protected AbstractAddImportCodeFixProvider( IPackageInstallerService packageInstallerService = null, IPackageSearchService packageSearchService = null) { _packageInstallerService = packageInstallerService; _packageSearchService = packageSearchService; }
private async Task FindNugetOrReferenceAssemblyTypeReferencesAsync( PackageSource source, IPackageSearchService searchService, IPackageInstallerService installerService, List <Reference> allReferences, TSimpleNameSyntax nameNode, string name, int arity, bool isAttributeSearch, CancellationToken cancellationToken) { cancellationToken.ThrowIfCancellationRequested(); var results = searchService.FindPackagesWithType(source.Name, name, arity, cancellationToken); var project = _document.Project; var projectId = project.Id; var workspace = project.Solution.Workspace; int weight = 0; foreach (var result in results) { cancellationToken.ThrowIfCancellationRequested(); if (result.IsDesktopFramework) { await HandleReferenceAssemblyReferenceAsync( installerService, allReferences, nameNode, project, isAttributeSearch, result, weight, cancellationToken).ConfigureAwait(false); } else { await HandleNugetReferenceAsync( source.Source, installerService, allReferences, nameNode, project, isAttributeSearch, result, weight).ConfigureAwait(false); } weight++; } }
public PackageController(IPackageSearchService packageService) { _packageService = packageService; }
/// <summary>For testing purposes only (so that tests can pass in mock values)</summary> internal CSharpAddImportCodeFixProvider( IPackageInstallerService installerService, IPackageSearchService packageSearchService) : base(installerService, packageSearchService) { }
public SearchCommandHandler(IPackageSearchService packageSearchService) { _packageSearchService = packageSearchService; }