提交 efff76e9 编写于 作者: C CyrusNajmabadi

JsonSerializer directly supports immutable arrays.

上级 197bd722
......@@ -258,7 +258,7 @@ public async Task TestFailedInstallRollsBackFile()
}
private Task<ImmutableArray<PackageWithTypeResult>> CreateSearchResult(
string packageName, string typeName, IReadOnlyList<string> containingNamespaceNames)
string packageName, string typeName, ImmutableArray<string> containingNamespaceNames)
{
return CreateSearchResult(new PackageWithTypeResult(
packageName: packageName, typeName: typeName, version: null,
......@@ -268,6 +268,6 @@ public async Task TestFailedInstallRollsBackFile()
private Task<ImmutableArray<PackageWithTypeResult>> CreateSearchResult(params PackageWithTypeResult[] results)
=> Task.FromResult(ImmutableArray.Create(results));
private IReadOnlyList<string> CreateNameParts(params string[] parts) => parts;
private ImmutableArray<string> CreateNameParts(params string[] parts) => parts.ToImmutableArray();
}
}
\ No newline at end of file
......@@ -124,11 +124,11 @@ private async Task<RemoteHostClient.Session> TryGetSessionAsync()
return ImmutableArray<PackageWithTypeResult>.Empty;
}
var results = await session.InvokeAsync<PackageWithTypeResult[]>(
var results = await session.InvokeAsync<ImmutableArray<PackageWithTypeResult>>(
nameof(IRemoteSymbolSearchUpdateEngine.FindPackagesWithTypeAsync),
source, name, arity).ConfigureAwait(false);
return results.ToImmutableArray();
return results;
}
public async Task<ImmutableArray<PackageWithAssemblyResult>> FindPackagesWithAssemblyAsync(
......@@ -141,11 +141,11 @@ private async Task<RemoteHostClient.Session> TryGetSessionAsync()
return ImmutableArray<PackageWithAssemblyResult>.Empty;
}
var results = await session.InvokeAsync<PackageWithAssemblyResult[]>(
var results = await session.InvokeAsync<ImmutableArray<PackageWithAssemblyResult>>(
nameof(IRemoteSymbolSearchUpdateEngine.FindPackagesWithAssemblyAsync),
source, assemblyName).ConfigureAwait(false);
return results.ToImmutableArray();
return results;
}
public async Task<ImmutableArray<ReferenceAssemblyWithTypeResult>> FindReferenceAssembliesWithTypeAsync(
......@@ -158,11 +158,11 @@ private async Task<RemoteHostClient.Session> TryGetSessionAsync()
return ImmutableArray<ReferenceAssemblyWithTypeResult>.Empty;
}
var results = await session.InvokeAsync<ReferenceAssemblyWithTypeResult[]>(
var results = await session.InvokeAsync<ImmutableArray<ReferenceAssemblyWithTypeResult>>(
nameof(IRemoteSymbolSearchUpdateEngine.FindReferenceAssembliesWithTypeAsync),
name, arity).ConfigureAwait(false);
return results.ToImmutableArray();
return results;
}
public async Task UpdateContinuouslyAsync(
......
......@@ -239,7 +239,7 @@ End Class", fixProviderData:=New ProviderData(installerServiceMock.Object, packa
installerServiceMock.Verify()
End Function
Private Function CreateSearchResult(packageName As String, typeName As String, nameParts As IReadOnlyList(Of String)) As Task(Of ImmutableArray(Of PackageWithTypeResult))
Private Function CreateSearchResult(packageName As String, typeName As String, nameParts As ImmutableArray(Of String)) As Task(Of ImmutableArray(Of PackageWithTypeResult))
Return CreateSearchResult(New PackageWithTypeResult(
packageName:=packageName,
typeName:=typeName,
......@@ -252,8 +252,8 @@ End Class", fixProviderData:=New ProviderData(installerServiceMock.Object, packa
Return Task.FromResult(ImmutableArray.Create(results))
End Function
Private Function CreateNameParts(ParamArray parts As String()) As IReadOnlyList(Of String)
Return parts
Private Function CreateNameParts(ParamArray parts As String()) As ImmutableArray(Of String)
Return parts.ToImmutableArray()
End Function
End Class
End Namespace
\ No newline at end of file
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Collections.Immutable;
using System.Threading.Tasks;
namespace Microsoft.CodeAnalysis.DesignerAttributes
{
internal interface IRemoteDesignerAttributeService
{
Task<DesignerAttributeDocumentData[]> ScanDesignerAttributesAsync(ProjectId projectId);
Task<ImmutableArray<DesignerAttributeDocumentData>> ScanDesignerAttributesAsync(ProjectId projectId);
}
}
}
\ No newline at end of file
......@@ -48,12 +48,12 @@ internal abstract partial class AbstractDocumentHighlightsService : IDocumentHig
return (succeeded: false, ImmutableArray<DocumentHighlights>.Empty);
}
var result = await session.InvokeAsync<SerializableDocumentHighlights[]>(
var result = await session.InvokeAsync<ImmutableArray<SerializableDocumentHighlights>>(
nameof(IRemoteDocumentHighlights.GetDocumentHighlightsAsync),
document.Id,
position,
documentsToSearch.Select(d => d.Id).ToArray()).ConfigureAwait(false);
return (true, SerializableDocumentHighlights.Rehydrate(result, document.Project.Solution));
return (true, result.SelectAsArray(h => h.Rehydrate(document.Project.Solution)));
}
}
......
......@@ -8,47 +8,23 @@ namespace Microsoft.CodeAnalysis.DocumentHighlighting
{
internal interface IRemoteDocumentHighlights
{
Task<SerializableDocumentHighlights[]> GetDocumentHighlightsAsync(
Task<ImmutableArray<SerializableDocumentHighlights>> GetDocumentHighlightsAsync(
DocumentId documentId, int position, DocumentId[] documentIdsToSearch);
}
internal struct SerializableDocumentHighlights
{
public DocumentId DocumentId;
public HighlightSpan[] HighlightSpans;
public ImmutableArray<HighlightSpan> HighlightSpans;
public static ImmutableArray<DocumentHighlights> Rehydrate(SerializableDocumentHighlights[] array, Solution solution)
{
var result = ArrayBuilder<DocumentHighlights>.GetInstance(array.Length);
foreach (var dehydrated in array)
{
result.Push(dehydrated.Rehydrate(solution));
}
return result.ToImmutableAndFree();
}
private DocumentHighlights Rehydrate(Solution solution)
public DocumentHighlights Rehydrate(Solution solution)
=> new DocumentHighlights(solution.GetDocument(DocumentId), HighlightSpans.ToImmutableArray());
public static SerializableDocumentHighlights[] Dehydrate(ImmutableArray<DocumentHighlights> array)
{
var result = new SerializableDocumentHighlights[array.Length];
var index = 0;
foreach (var highlights in array)
{
result[index] = Dehydrate(highlights);
index++;
}
return result;
}
private static SerializableDocumentHighlights Dehydrate(DocumentHighlights highlights)
public static SerializableDocumentHighlights Dehydrate(DocumentHighlights highlights)
=> new SerializableDocumentHighlights
{
DocumentId = highlights.Document.Id,
HighlightSpans = highlights.HighlightSpans.ToArray()
HighlightSpans = highlights.HighlightSpans
};
}
}
\ No newline at end of file
......@@ -15,23 +15,21 @@ internal abstract partial class AbstractNavigateToSearchService
private async Task<ImmutableArray<INavigateToSearchResult>> SearchDocumentInRemoteProcessAsync(
RemoteHostClient.Session session, Document document, string searchPattern, CancellationToken cancellationToken)
{
var serializableResults = await session.InvokeAsync<SerializableNavigateToSearchResult[]>(
var serializableResults = await session.InvokeAsync<ImmutableArray<SerializableNavigateToSearchResult>>(
nameof(IRemoteNavigateToSearchService.SearchDocumentAsync),
new object[] { document.Id, searchPattern }, cancellationToken).ConfigureAwait(false);
serializableResults = serializableResults ?? Array.Empty<SerializableNavigateToSearchResult>();
return serializableResults.Select(r => r.Rehydrate(document.Project.Solution)).ToImmutableArray();
return serializableResults.SelectAsArray(r => r.Rehydrate(document.Project.Solution));
}
private async Task<ImmutableArray<INavigateToSearchResult>> SearchProjectInRemoteProcessAsync(
RemoteHostClient.Session session, Project project, string searchPattern, CancellationToken cancellationToken)
{
var serializableResults = await session.InvokeAsync<SerializableNavigateToSearchResult[]>(
var serializableResults = await session.InvokeAsync<ImmutableArray<SerializableNavigateToSearchResult>>(
nameof(IRemoteNavigateToSearchService.SearchProjectAsync),
new object[] { project.Id, searchPattern }, cancellationToken).ConfigureAwait(false);
serializableResults = serializableResults ?? Array.Empty<SerializableNavigateToSearchResult>();
return serializableResults.Select(r => r.Rehydrate(project.Solution)).ToImmutableArray();
return serializableResults.SelectAsArray(r => r.Rehydrate(project.Solution));
}
private static Task<RemoteHostClient.Session> GetRemoteHostSessionAsync(Project project, CancellationToken cancellationToken)
......
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Collections.Immutable;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis.Remote;
......@@ -7,7 +8,7 @@ namespace Microsoft.CodeAnalysis.NavigateTo
{
internal interface IRemoteNavigateToSearchService
{
Task<SerializableNavigateToSearchResult[]> SearchDocumentAsync(DocumentId documentId, string searchPattern);
Task<SerializableNavigateToSearchResult[]> SearchProjectAsync(ProjectId projectId, string searchPattern);
Task<ImmutableArray<SerializableNavigateToSearchResult>> SearchDocumentAsync(DocumentId documentId, string searchPattern);
Task<ImmutableArray<SerializableNavigateToSearchResult>> SearchProjectAsync(ProjectId projectId, string searchPattern);
}
}
......@@ -18,7 +18,7 @@ internal class SerializableNavigateToSearchResult
public NavigateToMatchKind MatchKind;
public bool IsCaseSensitive;
public string Name;
public TextSpan[] NameMatchSpans;
public ImmutableArray<TextSpan> NameMatchSpans;
public string SecondarySort;
public string Summary;
......@@ -33,7 +33,7 @@ internal static SerializableNavigateToSearchResult Dehydrate(INavigateToSearchRe
MatchKind = result.MatchKind,
IsCaseSensitive = result.IsCaseSensitive,
Name = result.Name,
NameMatchSpans = result.NameMatchSpans.ToArray(),
NameMatchSpans = result.NameMatchSpans,
SecondarySort = result.SecondarySort,
Summary = result.Summary,
NavigableItem = SerializableNavigableItem.Dehydrate(result.NavigableItem)
......
......@@ -121,7 +121,7 @@ public async Task AnalyzeProjectAsync(Project project, bool semanticsChanged, In
return null;
}
var serializedResults = await session.InvokeAsync<DesignerAttributeDocumentData[]>(
var serializedResults = await session.InvokeAsync<ImmutableArray<DesignerAttributeDocumentData>>(
nameof(IRemoteDesignerAttributeService.ScanDesignerAttributesAsync), project.Id).ConfigureAwait(false);
var data = serializedResults.ToImmutableDictionary(kvp => kvp.FilePath);
......
......@@ -93,7 +93,7 @@ class Test { }";
var solution = workspace.CurrentSolution;
var result = await client.RunCodeAnalysisServiceOnRemoteHostAsync<DesignerAttributeDocumentData[]>(
var result = await client.RunCodeAnalysisServiceOnRemoteHostAsync<ImmutableArray<DesignerAttributeDocumentData>>(
solution, nameof(IRemoteDesignerAttributeService.ScanDesignerAttributesAsync),
solution.Projects.First().Id, CancellationToken.None);
......
......@@ -98,7 +98,7 @@ internal static partial class DeclarationFinder
{
if (session != null)
{
var result = await session.InvokeAsync<SerializableSymbolAndProjectId[]>(
var result = await session.InvokeAsync<ImmutableArray<SerializableSymbolAndProjectId>>(
nameof(IRemoteSymbolFinder.FindAllDeclarationsWithNormalQueryAsync),
project.Id, query.Name, query.Kind, criteria).ConfigureAwait(false);
......@@ -113,7 +113,7 @@ internal static partial class DeclarationFinder
}
private static async Task<ImmutableArray<SymbolAndProjectId>> RehydrateAsync(
Solution solution, SerializableSymbolAndProjectId[] array, CancellationToken cancellationToken)
Solution solution, ImmutableArray<SerializableSymbolAndProjectId> array, CancellationToken cancellationToken)
{
var result = ArrayBuilder<SymbolAndProjectId>.GetInstance(array.Length);
......
......@@ -118,7 +118,7 @@ internal static partial class DeclarationFinder
{
if (session != null)
{
var result = await session.InvokeAsync<SerializableSymbolAndProjectId[]>(
var result = await session.InvokeAsync<ImmutableArray<SerializableSymbolAndProjectId>>(
nameof(IRemoteSymbolFinder.FindSolutionSourceDeclarationsWithNormalQueryAsync),
name, ignoreCase, criteria).ConfigureAwait(false);
......@@ -139,7 +139,7 @@ internal static partial class DeclarationFinder
{
if (session != null)
{
var result = await session.InvokeAsync<SerializableSymbolAndProjectId[]>(
var result = await session.InvokeAsync<ImmutableArray<SerializableSymbolAndProjectId>>(
nameof(IRemoteSymbolFinder.FindProjectSourceDeclarationsWithNormalQueryAsync),
project.Id, name, ignoreCase, criteria).ConfigureAwait(false);
......@@ -160,7 +160,7 @@ internal static partial class DeclarationFinder
{
if (session != null)
{
var result = await session.InvokeAsync<SerializableSymbolAndProjectId[]>(
var result = await session.InvokeAsync<ImmutableArray<SerializableSymbolAndProjectId>>(
nameof(IRemoteSymbolFinder.FindProjectSourceDeclarationsWithPatternAsync),
project.Id, pattern, criteria).ConfigureAwait(false);
......
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Collections.Immutable;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis.Remote;
......@@ -10,16 +11,16 @@ internal interface IRemoteSymbolFinder
Task FindReferencesAsync(SerializableSymbolAndProjectId symbolAndProjectIdArg, DocumentId[] documentArgs);
Task FindLiteralReferencesAsync(object value);
Task<SerializableSymbolAndProjectId[]> FindAllDeclarationsWithNormalQueryAsync(
Task<ImmutableArray<SerializableSymbolAndProjectId>> FindAllDeclarationsWithNormalQueryAsync(
ProjectId projectId, string name, SearchKind searchKind, SymbolFilter criteria);
Task<SerializableSymbolAndProjectId[]> FindSolutionSourceDeclarationsWithNormalQueryAsync(
Task<ImmutableArray<SerializableSymbolAndProjectId>> FindSolutionSourceDeclarationsWithNormalQueryAsync(
string name, bool ignoreCase, SymbolFilter criteria);
Task<SerializableSymbolAndProjectId[]> FindProjectSourceDeclarationsWithNormalQueryAsync(
Task<ImmutableArray<SerializableSymbolAndProjectId>> FindProjectSourceDeclarationsWithNormalQueryAsync(
ProjectId projectId, string name, bool ignoreCase, SymbolFilter criteria);
Task<SerializableSymbolAndProjectId[]> FindProjectSourceDeclarationsWithPatternAsync(
Task<ImmutableArray<SerializableSymbolAndProjectId>> FindProjectSourceDeclarationsWithPatternAsync(
ProjectId projectId, string pattern, SymbolFilter criteria);
}
}
\ No newline at end of file
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Collections.Immutable;
using System.Threading.Tasks;
namespace Microsoft.CodeAnalysis.SymbolSearch
......@@ -8,8 +9,8 @@ internal interface IRemoteSymbolSearchUpdateEngine
{
Task UpdateContinuouslyAsync(string sourceName, string localSettingsDirectory);
Task<PackageWithTypeResult[]> FindPackagesWithTypeAsync(string source, string name, int arity);
Task<PackageWithAssemblyResult[]> FindPackagesWithAssemblyAsync(string source, string name);
Task<ReferenceAssemblyWithTypeResult[]> FindReferenceAssembliesWithTypeAsync(string name, int arity);
Task<ImmutableArray<PackageWithTypeResult>> FindPackagesWithTypeAsync(string source, string name, int arity);
Task<ImmutableArray<PackageWithAssemblyResult>> FindPackagesWithAssemblyAsync(string source, string name);
Task<ImmutableArray<ReferenceAssemblyWithTypeResult>> FindReferenceAssembliesWithTypeAsync(string name, int arity);
}
}
\ No newline at end of file
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Collections.Immutable;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis.DesignerAttributes;
......@@ -16,7 +17,7 @@ internal partial class CodeAnalysisService : IRemoteDesignerAttributeService
///
/// This will be called by ServiceHub/JsonRpc framework
/// </summary>
public async Task<DesignerAttributeDocumentData[]> ScanDesignerAttributesAsync(ProjectId projectId)
public async Task<ImmutableArray<DesignerAttributeDocumentData>> ScanDesignerAttributesAsync(ProjectId projectId)
{
using (RoslynLogger.LogBlock(FunctionId.CodeAnalysisService_GetDesignerAttributesAsync, projectId.DebugName, CancellationToken))
{
......@@ -25,7 +26,7 @@ public async Task<DesignerAttributeDocumentData[]> ScanDesignerAttributesAsync(P
var data = await AbstractDesignerAttributeService.TryAnalyzeProjectInCurrentProcessAsync(
project, CancellationToken).ConfigureAwait(false);
return data.Values.ToArray();
return data.Values.ToImmutableArray();
}
}
}
......
......@@ -11,7 +11,7 @@ namespace Microsoft.CodeAnalysis.Remote
// root level service for all Roslyn services
internal partial class CodeAnalysisService : IRemoteDocumentHighlights
{
public async Task<SerializableDocumentHighlights[]> GetDocumentHighlightsAsync(
public async Task<ImmutableArray<SerializableDocumentHighlights>> GetDocumentHighlightsAsync(
DocumentId documentId, int position, DocumentId[] documentIdsToSearch)
{
var solution = await GetSolutionAsync().ConfigureAwait(false);
......@@ -22,7 +22,7 @@ internal partial class CodeAnalysisService : IRemoteDocumentHighlights
var result = await service.GetDocumentHighlightsAsync(
document, position, documentsToSearch, CancellationToken).ConfigureAwait(false);
return SerializableDocumentHighlights.Dehydrate(result);
return result.SelectAsArray(SerializableDocumentHighlights.Dehydrate);
}
}
}
\ No newline at end of file
......@@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis.Remote
{
internal partial class CodeAnalysisService : IRemoteNavigateToSearchService
{
public async Task<SerializableNavigateToSearchResult[]> SearchDocumentAsync(
public async Task<ImmutableArray<SerializableNavigateToSearchResult>> SearchDocumentAsync(
DocumentId documentId, string searchPattern)
{
using (UserOperationBooster.Boost())
......@@ -24,7 +24,7 @@ internal partial class CodeAnalysisService : IRemoteNavigateToSearchService
}
}
public async Task<SerializableNavigateToSearchResult[]> SearchProjectAsync(
public async Task<ImmutableArray<SerializableNavigateToSearchResult>> SearchProjectAsync(
ProjectId projectId, string searchPattern)
{
using (UserOperationBooster.Boost())
......@@ -39,10 +39,10 @@ internal partial class CodeAnalysisService : IRemoteNavigateToSearchService
}
}
private SerializableNavigateToSearchResult[] Convert(
private ImmutableArray<SerializableNavigateToSearchResult> Convert(
ImmutableArray<INavigateToSearchResult> result)
{
return result.Select(SerializableNavigateToSearchResult.Dehydrate).ToArray();
return result.SelectAsArray(SerializableNavigateToSearchResult.Dehydrate);
}
}
}
\ No newline at end of file
......@@ -44,7 +44,7 @@ public async Task FindLiteralReferencesAsync(object value)
value, solution, progressCallback, CancellationToken).ConfigureAwait(false);
}
public async Task<SerializableSymbolAndProjectId[]> FindAllDeclarationsWithNormalQueryAsync(
public async Task<ImmutableArray<SerializableSymbolAndProjectId>> FindAllDeclarationsWithNormalQueryAsync(
ProjectId projectId, string name, SearchKind searchKind, SymbolFilter criteria)
{
var solution = await GetSolutionAsync().ConfigureAwait(false);
......@@ -55,21 +55,21 @@ public async Task FindLiteralReferencesAsync(object value)
var result = await DeclarationFinder.FindAllDeclarationsWithNormalQueryInCurrentProcessAsync(
project, query, criteria, this.CancellationToken).ConfigureAwait(false);
return result.Select(SerializableSymbolAndProjectId.Dehydrate).ToArray();
return result.SelectAsArray(SerializableSymbolAndProjectId.Dehydrate);
}
}
public async Task<SerializableSymbolAndProjectId[]> FindSolutionSourceDeclarationsWithNormalQueryAsync(
public async Task<ImmutableArray<SerializableSymbolAndProjectId>> FindSolutionSourceDeclarationsWithNormalQueryAsync(
string name, bool ignoreCase, SymbolFilter criteria)
{
var solution = await GetSolutionAsync().ConfigureAwait(false);
var result = await DeclarationFinder.FindSourceDeclarationsWithNormalQueryInCurrentProcessAsync(
solution, name, ignoreCase, criteria, CancellationToken).ConfigureAwait(false);
return result.Select(SerializableSymbolAndProjectId.Dehydrate).ToArray();
return result.SelectAsArray(SerializableSymbolAndProjectId.Dehydrate);
}
public async Task<SerializableSymbolAndProjectId[]> FindProjectSourceDeclarationsWithNormalQueryAsync(
public async Task<ImmutableArray<SerializableSymbolAndProjectId>> FindProjectSourceDeclarationsWithNormalQueryAsync(
ProjectId projectId, string name, bool ignoreCase, SymbolFilter criteria)
{
var solution = await GetSolutionAsync().ConfigureAwait(false);
......@@ -78,10 +78,10 @@ public async Task FindLiteralReferencesAsync(object value)
var result = await DeclarationFinder.FindSourceDeclarationsWithNormalQueryInCurrentProcessAsync(
project, name, ignoreCase, criteria, CancellationToken).ConfigureAwait(false);
return result.Select(SerializableSymbolAndProjectId.Dehydrate).ToArray();
return result.SelectAsArray(SerializableSymbolAndProjectId.Dehydrate);
}
public async Task<SerializableSymbolAndProjectId[]> FindProjectSourceDeclarationsWithPatternAsync(
public async Task<ImmutableArray<SerializableSymbolAndProjectId>> FindProjectSourceDeclarationsWithPatternAsync(
ProjectId projectId, string pattern, SymbolFilter criteria)
{
var solution = await GetSolutionAsync().ConfigureAwait(false);
......@@ -90,7 +90,7 @@ public async Task FindLiteralReferencesAsync(object value)
var result = await DeclarationFinder.FindSourceDeclarationsWithPatternInCurrentProcessAsync(
project, pattern, criteria, CancellationToken).ConfigureAwait(false);
return result.Select(SerializableSymbolAndProjectId.Dehydrate).ToArray();
return result.SelectAsArray(SerializableSymbolAndProjectId.Dehydrate);
}
private class FindLiteralReferencesProgressCallback : IStreamingFindLiteralReferencesProgress
......
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Collections.Immutable;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis.SymbolSearch;
......@@ -26,28 +26,28 @@ public Task UpdateContinuouslyAsync(string sourceName, string localSettingsDirec
return _updateEngine.UpdateContinuouslyAsync(sourceName, localSettingsDirectory);
}
public async Task<PackageWithTypeResult[]> FindPackagesWithTypeAsync(string source, string name, int arity)
public async Task<ImmutableArray<PackageWithTypeResult>> FindPackagesWithTypeAsync(string source, string name, int arity)
{
var results = await _updateEngine.FindPackagesWithTypeAsync(
source, name, arity).ConfigureAwait(false);
var serializedResults = results.ToArray();
return serializedResults;
return results;
}
public async Task<PackageWithAssemblyResult[]> FindPackagesWithAssemblyAsync(string source, string assemblyName)
public async Task<ImmutableArray<PackageWithAssemblyResult>> FindPackagesWithAssemblyAsync(string source, string assemblyName)
{
var results = await _updateEngine.FindPackagesWithAssemblyAsync(
source, assemblyName).ConfigureAwait(false);
var serializedResults = results.ToArray();
return serializedResults;
return results;
}
public async Task<ReferenceAssemblyWithTypeResult[]> FindReferenceAssembliesWithTypeAsync(string name, int arity)
public async Task<ImmutableArray<ReferenceAssemblyWithTypeResult>> FindReferenceAssembliesWithTypeAsync(string name, int arity)
{
var results = await _updateEngine.FindReferenceAssembliesWithTypeAsync(
name, arity).ConfigureAwait(false);
var serializedResults = results.ToArray();
return serializedResults;
return results;
}
private class LogService : ISymbolSearchLogService
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册