Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update ReferenceResolver and Roslyn packages #23

Merged
merged 3 commits into from
Feb 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/NatashaPad.Core/NatashaPad.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<RootNamespace>NatashaPad</RootNamespace>
<RoslyncPackageVersion>4.9.0-2.final</RoslyncPackageVersion>
<RoslynPackageVersion>4.9.0-3.final</RoslynPackageVersion>
</PropertyGroup>

<ItemGroup>
<Using Include="Microsoft.CodeAnalysis" />
<PackageReference Include="DotNetCore.Compile.Environment" Version="3.2.0" />
<PackageReference Include="DotNetCore.Natasha.CSharp" Version="5.2.2.1" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Features" Version="$(RoslyncPackageVersion)" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="$(RoslyncPackageVersion)" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Scripting" Version="$(RoslyncPackageVersion)" />
<PackageReference Include="ReferenceResolver" Version="0.17.0-preview-20240117-161410" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Features" Version="$(RoslynPackageVersion)" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="$(RoslynPackageVersion)" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Scripting" Version="$(RoslynPackageVersion)" />
<PackageReference Include="ReferenceResolver" Version="0.17.0" />
</ItemGroup>

</Project>
12 changes: 6 additions & 6 deletions src/NatashaPad/ViewModels/NugetManageViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@ await InstalledPackages.Select(p => _nugetHelper.DownloadPackage(p.Name, NuGetVe

private string _searchText;
private bool _includePrerelease = true;
private string _selectedSource;
private string[] _selectedSources = [];

public string[] Sources { get; }

public string SelectedSource
public string[] SelectedSources
{
get => _selectedSource;
set => SetProperty(ref _selectedSource, value);
get => _selectedSources;
set => SetProperty(ref _selectedSources, value);
}

public bool IncludePrerelease
Expand All @@ -80,7 +80,7 @@ private async Task SearchAsync()

//TODO: 这边都给了默认值。需要在界面上支持用户选择
var packagesNames = (
await _nugetHelper.SearchPackages(text, _includePrerelease, source: _selectedSource).ToArrayAsync()
await _nugetHelper.SearchPackages(text, _includePrerelease, sources: _selectedSources).ToArrayAsync()
)
.SelectMany(x => x.SearchResult.Select(r=> r.Identity.Id))
.Distinct()
Expand All @@ -90,7 +90,7 @@ await _nugetHelper.SearchPackages(text, _includePrerelease, source: _selectedSou
foreach (var name in packagesNames)
{
var versions = await _nugetHelper.GetPackageVersions(
name, _includePrerelease, null, _selectedSource
name, _includePrerelease, null, _selectedSources
).ToArrayAsync();
// TODO: we may want to show the source where the version comes from
var pkg = new SearchedPackage(name,
Expand Down