提交 51b03940 编写于 作者: H Heejae Chang 提交者: GitHub

Merge pull request #18025 from heejaechang/codelensfunc

add marker to see code lens perf easier
...@@ -7,10 +7,9 @@ ...@@ -7,10 +7,9 @@
using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CodeLens; using Microsoft.CodeAnalysis.CodeLens;
using Microsoft.CodeAnalysis.Host.Mef; using Microsoft.CodeAnalysis.Host.Mef;
using Microsoft.CodeAnalysis.Internal.Log;
using Microsoft.CodeAnalysis.Remote; using Microsoft.CodeAnalysis.Remote;
using Microsoft.CodeAnalysis.Remote.Diagnostics; using Microsoft.CodeAnalysis.Remote.Diagnostics;
using Microsoft.VisualStudio.LanguageServices.Implementation.Extensions;
using Microsoft.VisualStudio.LanguageServices.Remote;
namespace Microsoft.VisualStudio.LanguageServices.CodeLens namespace Microsoft.VisualStudio.LanguageServices.CodeLens
{ {
...@@ -19,6 +18,8 @@ internal sealed class RemoteCodeLensReferencesService : ICodeLensReferencesServi ...@@ -19,6 +18,8 @@ internal sealed class RemoteCodeLensReferencesService : ICodeLensReferencesServi
{ {
public async Task<ReferenceCount> GetReferenceCountAsync(Solution solution, DocumentId documentId, SyntaxNode syntaxNode, int maxSearchResults, public async Task<ReferenceCount> GetReferenceCountAsync(Solution solution, DocumentId documentId, SyntaxNode syntaxNode, int maxSearchResults,
CancellationToken cancellationToken) CancellationToken cancellationToken)
{
using (Logger.LogBlock(FunctionId.CodeLens_GetReferenceCountAsync, cancellationToken))
{ {
if (syntaxNode == null) if (syntaxNode == null)
{ {
...@@ -37,9 +38,12 @@ internal sealed class RemoteCodeLensReferencesService : ICodeLensReferencesServi ...@@ -37,9 +38,12 @@ internal sealed class RemoteCodeLensReferencesService : ICodeLensReferencesServi
solution, WellKnownServiceHubServices.CodeAnalysisService_GetReferenceCountAsync, solution, WellKnownServiceHubServices.CodeAnalysisService_GetReferenceCountAsync,
new object[] { new CodeLensArguments(documentId, syntaxNode), maxSearchResults }, cancellationToken).ConfigureAwait(false); new object[] { new CodeLensArguments(documentId, syntaxNode), maxSearchResults }, cancellationToken).ConfigureAwait(false);
} }
}
public async Task<IEnumerable<ReferenceLocationDescriptor>> FindReferenceLocationsAsync(Solution solution, DocumentId documentId, SyntaxNode syntaxNode, public async Task<IEnumerable<ReferenceLocationDescriptor>> FindReferenceLocationsAsync(Solution solution, DocumentId documentId, SyntaxNode syntaxNode,
CancellationToken cancellationToken) CancellationToken cancellationToken)
{
using (Logger.LogBlock(FunctionId.CodeLens_FindReferenceLocationsAsync, cancellationToken))
{ {
if (syntaxNode == null) if (syntaxNode == null)
{ {
...@@ -58,9 +62,12 @@ internal sealed class RemoteCodeLensReferencesService : ICodeLensReferencesServi ...@@ -58,9 +62,12 @@ internal sealed class RemoteCodeLensReferencesService : ICodeLensReferencesServi
solution, WellKnownServiceHubServices.CodeAnalysisService_FindReferenceLocationsAsync, solution, WellKnownServiceHubServices.CodeAnalysisService_FindReferenceLocationsAsync,
new CodeLensArguments(documentId, syntaxNode), cancellationToken).ConfigureAwait(false); new CodeLensArguments(documentId, syntaxNode), cancellationToken).ConfigureAwait(false);
} }
}
public async Task<IEnumerable<ReferenceMethodDescriptor>> FindReferenceMethodsAsync(Solution solution, DocumentId documentId, SyntaxNode syntaxNode, public async Task<IEnumerable<ReferenceMethodDescriptor>> FindReferenceMethodsAsync(Solution solution, DocumentId documentId, SyntaxNode syntaxNode,
CancellationToken cancellationToken) CancellationToken cancellationToken)
{
using (Logger.LogBlock(FunctionId.CodeLens_FindReferenceMethodsAsync, cancellationToken))
{ {
if (syntaxNode == null) if (syntaxNode == null)
{ {
...@@ -79,9 +86,12 @@ internal sealed class RemoteCodeLensReferencesService : ICodeLensReferencesServi ...@@ -79,9 +86,12 @@ internal sealed class RemoteCodeLensReferencesService : ICodeLensReferencesServi
solution, WellKnownServiceHubServices.CodeAnalysisService_FindReferenceMethodsAsync, solution, WellKnownServiceHubServices.CodeAnalysisService_FindReferenceMethodsAsync,
new CodeLensArguments(documentId, syntaxNode), cancellationToken).ConfigureAwait(false); new CodeLensArguments(documentId, syntaxNode), cancellationToken).ConfigureAwait(false);
} }
}
public async Task<string> GetFullyQualifiedName(Solution solution, DocumentId documentId, SyntaxNode syntaxNode, public async Task<string> GetFullyQualifiedName(Solution solution, DocumentId documentId, SyntaxNode syntaxNode,
CancellationToken cancellationToken) CancellationToken cancellationToken)
{
using (Logger.LogBlock(FunctionId.CodeLens_GetFullyQualifiedName, cancellationToken))
{ {
if (syntaxNode == null) if (syntaxNode == null)
{ {
...@@ -101,4 +111,5 @@ internal sealed class RemoteCodeLensReferencesService : ICodeLensReferencesServi ...@@ -101,4 +111,5 @@ internal sealed class RemoteCodeLensReferencesService : ICodeLensReferencesServi
new CodeLensArguments(documentId, syntaxNode), cancellationToken).ConfigureAwait(false); new CodeLensArguments(documentId, syntaxNode), cancellationToken).ConfigureAwait(false);
} }
} }
}
} }
...@@ -366,5 +366,9 @@ internal enum FunctionId ...@@ -366,5 +366,9 @@ internal enum FunctionId
RemoteHost_Connect, RemoteHost_Connect,
RemoteHost_Disconnect, RemoteHost_Disconnect,
CodeAnalysisService_GetTodoCommentsAsync, CodeAnalysisService_GetTodoCommentsAsync,
CodeLens_GetReferenceCountAsync,
CodeLens_FindReferenceLocationsAsync,
CodeLens_FindReferenceMethodsAsync,
CodeLens_GetFullyQualifiedName,
} }
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册