Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
af2771b7
R
roslyn
项目概览
lwm1986
/
roslyn
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
roslyn
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
af2771b7
编写于
9月 14, 2016
作者:
P
Paul Vick
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix serialization
上级
2869b7ef
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
59 addition
and
8 deletion
+59
-8
src/VisualStudio/Core/Next/CodeLens/RemoteCodeLensReferencesService.cs
...dio/Core/Next/CodeLens/RemoteCodeLensReferencesService.cs
+5
-4
src/VisualStudio/Core/Next/ServicesVisualStudio.Next.csproj
src/VisualStudio/Core/Next/ServicesVisualStudio.Next.csproj
+3
-0
src/Workspaces/Remote/ServiceHub/CodeLens/CodeLensArguments.cs
...orkspaces/Remote/ServiceHub/CodeLens/CodeLensArguments.cs
+38
-0
src/Workspaces/Remote/ServiceHub/ServiceHub.csproj
src/Workspaces/Remote/ServiceHub/ServiceHub.csproj
+1
-0
src/Workspaces/Remote/ServiceHub/Services/CodeAnalysisService_CodeLens.cs
...emote/ServiceHub/Services/CodeAnalysisService_CodeLens.cs
+12
-4
未找到文件。
src/VisualStudio/Core/Next/CodeLens/RemoteCodeLensReferencesService.cs
浏览文件 @
af2771b7
...
@@ -8,6 +8,7 @@
...
@@ -8,6 +8,7 @@
using
Microsoft.CodeAnalysis.CodeLens
;
using
Microsoft.CodeAnalysis.CodeLens
;
using
Microsoft.CodeAnalysis.Host.Mef
;
using
Microsoft.CodeAnalysis.Host.Mef
;
using
Microsoft.CodeAnalysis.Remote
;
using
Microsoft.CodeAnalysis.Remote
;
using
Microsoft.CodeAnalysis.Remote.Diagnostics
;
using
Microsoft.VisualStudio.LanguageServices.Implementation.Extensions
;
using
Microsoft.VisualStudio.LanguageServices.Implementation.Extensions
;
using
Microsoft.VisualStudio.LanguageServices.Remote
;
using
Microsoft.VisualStudio.LanguageServices.Remote
;
...
@@ -29,7 +30,7 @@ internal sealed class RemoteCodeLensReferencesService : ICodeLensReferencesServi
...
@@ -29,7 +30,7 @@ internal sealed class RemoteCodeLensReferencesService : ICodeLensReferencesServi
// TODO: send telemetry on session
// TODO: send telemetry on session
using
(
var
session
=
await
remoteHostClient
.
CreateCodeAnalysisServiceSessionAsync
(
solution
,
cancellationToken
).
ConfigureAwait
(
false
))
using
(
var
session
=
await
remoteHostClient
.
CreateCodeAnalysisServiceSessionAsync
(
solution
,
cancellationToken
).
ConfigureAwait
(
false
))
{
{
return
await
session
.
InvokeAsync
<
ReferenceCount
>(
WellKnownServiceHubServices
.
CodeAnalysisService_GetReferenceCountAsync
,
documentId
,
syntaxNode
.
Span
,
maxSearchResults
).
ConfigureAwait
(
false
);
return
await
session
.
InvokeAsync
<
ReferenceCount
>(
WellKnownServiceHubServices
.
CodeAnalysisService_GetReferenceCountAsync
,
new
CodeLensArguments
(
documentId
)
,
syntaxNode
.
Span
,
maxSearchResults
).
ConfigureAwait
(
false
);
}
}
}
}
...
@@ -46,7 +47,7 @@ internal sealed class RemoteCodeLensReferencesService : ICodeLensReferencesServi
...
@@ -46,7 +47,7 @@ internal sealed class RemoteCodeLensReferencesService : ICodeLensReferencesServi
// TODO: send telemetry on session
// TODO: send telemetry on session
using
(
var
session
=
await
remoteHostClient
.
CreateCodeAnalysisServiceSessionAsync
(
solution
,
cancellationToken
).
ConfigureAwait
(
false
))
using
(
var
session
=
await
remoteHostClient
.
CreateCodeAnalysisServiceSessionAsync
(
solution
,
cancellationToken
).
ConfigureAwait
(
false
))
{
{
return
await
session
.
InvokeAsync
<
IEnumerable
<
ReferenceLocationDescriptor
>>(
WellKnownServiceHubServices
.
CodeAnalysisService_FindReferenceLocationsAsync
,
documentId
,
syntaxNode
.
Span
).
ConfigureAwait
(
false
);
return
await
session
.
InvokeAsync
<
IEnumerable
<
ReferenceLocationDescriptor
>>(
WellKnownServiceHubServices
.
CodeAnalysisService_FindReferenceLocationsAsync
,
new
CodeLensArguments
(
documentId
)
,
syntaxNode
.
Span
).
ConfigureAwait
(
false
);
}
}
}
}
...
@@ -63,7 +64,7 @@ internal sealed class RemoteCodeLensReferencesService : ICodeLensReferencesServi
...
@@ -63,7 +64,7 @@ internal sealed class RemoteCodeLensReferencesService : ICodeLensReferencesServi
// TODO: send telemetry on session
// TODO: send telemetry on session
using
(
var
session
=
await
remoteHostClient
.
CreateCodeAnalysisServiceSessionAsync
(
solution
,
cancellationToken
).
ConfigureAwait
(
false
))
using
(
var
session
=
await
remoteHostClient
.
CreateCodeAnalysisServiceSessionAsync
(
solution
,
cancellationToken
).
ConfigureAwait
(
false
))
{
{
return
await
session
.
InvokeAsync
<
IEnumerable
<
ReferenceMethodDescriptor
>>(
WellKnownServiceHubServices
.
CodeAnalysisService_FindReferenceMethodsAsync
,
documentId
,
syntaxNode
.
Span
).
ConfigureAwait
(
false
);
return
await
session
.
InvokeAsync
<
IEnumerable
<
ReferenceMethodDescriptor
>>(
WellKnownServiceHubServices
.
CodeAnalysisService_FindReferenceMethodsAsync
,
new
CodeLensArguments
(
documentId
)
,
syntaxNode
.
Span
).
ConfigureAwait
(
false
);
}
}
}
}
...
@@ -80,7 +81,7 @@ internal sealed class RemoteCodeLensReferencesService : ICodeLensReferencesServi
...
@@ -80,7 +81,7 @@ internal sealed class RemoteCodeLensReferencesService : ICodeLensReferencesServi
// TODO: send telemetry on session
// TODO: send telemetry on session
using
(
var
session
=
await
remoteHostClient
.
CreateCodeAnalysisServiceSessionAsync
(
solution
,
cancellationToken
).
ConfigureAwait
(
false
))
using
(
var
session
=
await
remoteHostClient
.
CreateCodeAnalysisServiceSessionAsync
(
solution
,
cancellationToken
).
ConfigureAwait
(
false
))
{
{
return
await
session
.
InvokeAsync
<
string
>(
WellKnownServiceHubServices
.
CodeAnalysisService_GetFullyQualifiedName
,
documentId
,
syntaxNode
.
Span
).
ConfigureAwait
(
false
);
return
await
session
.
InvokeAsync
<
string
>(
WellKnownServiceHubServices
.
CodeAnalysisService_GetFullyQualifiedName
,
new
CodeLensArguments
(
documentId
)
,
syntaxNode
.
Span
).
ConfigureAwait
(
false
);
}
}
}
}
}
}
...
...
src/VisualStudio/Core/Next/ServicesVisualStudio.Next.csproj
浏览文件 @
af2771b7
...
@@ -74,6 +74,9 @@
...
@@ -74,6 +74,9 @@
<PublicAPI
Include=
"PublicAPI.Unshipped.txt"
/>
<PublicAPI
Include=
"PublicAPI.Unshipped.txt"
/>
</ItemGroup>
</ItemGroup>
<ItemGroup>
<ItemGroup>
<Compile
Include=
"..\..\..\Workspaces\Remote\ServiceHub\CodeLens\CodeLensArguments.cs"
>
<Link>
CodeLens\CodeLensArguments.cs
</Link>
</Compile>
<Compile
Include=
"..\..\..\Workspaces\Remote\ServiceHub\Diagnostics\DiagnosticArguments.cs"
>
<Compile
Include=
"..\..\..\Workspaces\Remote\ServiceHub\Diagnostics\DiagnosticArguments.cs"
>
<Link>
Diagnostics\DiagnosticArguments.cs
</Link>
<Link>
Diagnostics\DiagnosticArguments.cs
</Link>
</Compile>
</Compile>
...
...
src/Workspaces/Remote/ServiceHub/CodeLens/CodeLensArguments.cs
0 → 100644
浏览文件 @
af2771b7
// 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.Generic
;
using
System.Collections.Immutable
;
using
System.Linq
;
using
Microsoft.CodeAnalysis.Execution
;
namespace
Microsoft.CodeAnalysis.Remote.Diagnostics
{
/// <summary>
/// helper type to package diagnostic arguments to pass around between remote hosts
/// </summary>
internal
class
CodeLensArguments
{
public
Guid
ProjectIdGuid
;
public
string
ProjectIdDebugName
;
public
Guid
DocumentIdGuid
;
public
string
DocumentIdDebugName
;
public
CodeLensArguments
()
{
}
public
CodeLensArguments
(
DocumentId
documentId
)
{
ProjectIdGuid
=
documentId
.
ProjectId
.
Id
;
ProjectIdDebugName
=
documentId
.
ProjectId
.
DebugName
;
DocumentIdGuid
=
documentId
.
Id
;
DocumentIdDebugName
=
documentId
.
DebugName
;
}
public
DocumentId
GetDocumentId
()
=>
DocumentId
.
CreateFromSerialized
(
ProjectId
.
CreateFromSerialized
(
ProjectIdGuid
,
ProjectIdDebugName
),
DocumentIdGuid
,
DocumentIdDebugName
);
}
}
\ No newline at end of file
src/Workspaces/Remote/ServiceHub/ServiceHub.csproj
浏览文件 @
af2771b7
...
@@ -49,6 +49,7 @@
...
@@ -49,6 +49,7 @@
</ItemGroup>
</ItemGroup>
<ItemGroup>
<ItemGroup>
<None
Include=
"project.json"
/>
<None
Include=
"project.json"
/>
<Compile
Include=
"CodeLens\CodeLensArguments.cs"
/>
<Compile
Include=
"Services\CodeAnalysisService_CodeLens.cs"
/>
<Compile
Include=
"Services\CodeAnalysisService_CodeLens.cs"
/>
<Compile
Include=
"Services\SnapshotService.JsonRpcAssetSource.cs"
/>
<Compile
Include=
"Services\SnapshotService.JsonRpcAssetSource.cs"
/>
<PublicAPI
Include=
"PublicAPI.Shipped.txt"
/>
<PublicAPI
Include=
"PublicAPI.Shipped.txt"
/>
...
...
src/Workspaces/Remote/ServiceHub/Services/CodeAnalysisService_CodeLens.cs
浏览文件 @
af2771b7
...
@@ -7,16 +7,18 @@
...
@@ -7,16 +7,18 @@
using
System.Threading.Tasks
;
using
System.Threading.Tasks
;
using
Microsoft.CodeAnalysis.Execution
;
using
Microsoft.CodeAnalysis.Execution
;
using
Microsoft.CodeAnalysis.Internal.Log
;
using
Microsoft.CodeAnalysis.Internal.Log
;
using
Microsoft.CodeAnalysis.Remote.Diagnostics
;
using
Microsoft.CodeAnalysis.Text
;
using
Microsoft.CodeAnalysis.Text
;
namespace
Microsoft.CodeAnalysis.Remote
namespace
Microsoft.CodeAnalysis.Remote
{
{
internal
partial
class
CodeAnalysisService
internal
partial
class
CodeAnalysisService
{
{
public
async
Task
<
ReferenceCount
>
GetReferenceCountAsync
(
DocumentId
documentId
,
TextSpan
textSpan
,
int
maxResultCount
,
byte
[]
solutionChecksum
)
public
async
Task
<
ReferenceCount
>
GetReferenceCountAsync
(
CodeLensArguments
arguments
,
TextSpan
textSpan
,
int
maxResultCount
,
byte
[]
solutionChecksum
)
{
{
try
try
{
{
var
documentId
=
arguments
.
GetDocumentId
();
using
(
Internal
.
Log
.
Logger
.
LogBlock
(
FunctionId
.
CodeAnalysisService_GetReferenceCountAsync
,
documentId
.
ProjectId
.
DebugName
,
CancellationToken
))
using
(
Internal
.
Log
.
Logger
.
LogBlock
(
FunctionId
.
CodeAnalysisService_GetReferenceCountAsync
,
documentId
.
ProjectId
.
DebugName
,
CancellationToken
))
{
{
var
solution
=
await
RoslynServices
.
SolutionService
.
GetSolutionAsync
(
new
Checksum
(
solutionChecksum
),
CancellationToken
).
ConfigureAwait
(
false
);
var
solution
=
await
RoslynServices
.
SolutionService
.
GetSolutionAsync
(
new
Checksum
(
solutionChecksum
),
CancellationToken
).
ConfigureAwait
(
false
);
...
@@ -41,10 +43,12 @@ public async Task<ReferenceCount> GetReferenceCountAsync(DocumentId documentId,
...
@@ -41,10 +43,12 @@ public async Task<ReferenceCount> GetReferenceCountAsync(DocumentId documentId,
return
null
;
return
null
;
}
}
public
async
Task
<
IEnumerable
<
ReferenceLocationDescriptor
>>
FindReferenceLocationsAsync
(
DocumentId
documentId
,
TextSpan
textSpan
,
byte
[]
solutionChecksum
)
public
async
Task
<
IEnumerable
<
ReferenceLocationDescriptor
>>
FindReferenceLocationsAsync
(
CodeLensArguments
arguments
,
TextSpan
textSpan
,
byte
[]
solutionChecksum
)
{
{
try
try
{
{
var
documentId
=
arguments
.
GetDocumentId
();
using
(
Internal
.
Log
.
Logger
.
LogBlock
(
FunctionId
.
CodeAnalysisService_FindReferenceLocationsAsync
,
documentId
.
ProjectId
.
DebugName
,
CancellationToken
))
using
(
Internal
.
Log
.
Logger
.
LogBlock
(
FunctionId
.
CodeAnalysisService_FindReferenceLocationsAsync
,
documentId
.
ProjectId
.
DebugName
,
CancellationToken
))
{
{
var
solution
=
await
RoslynServices
.
SolutionService
.
GetSolutionAsync
(
new
Checksum
(
solutionChecksum
),
CancellationToken
).
ConfigureAwait
(
false
);
var
solution
=
await
RoslynServices
.
SolutionService
.
GetSolutionAsync
(
new
Checksum
(
solutionChecksum
),
CancellationToken
).
ConfigureAwait
(
false
);
...
@@ -69,10 +73,12 @@ public async Task<IEnumerable<ReferenceLocationDescriptor>> FindReferenceLocatio
...
@@ -69,10 +73,12 @@ public async Task<IEnumerable<ReferenceLocationDescriptor>> FindReferenceLocatio
return
null
;
return
null
;
}
}
public
async
Task
<
IEnumerable
<
ReferenceMethodDescriptor
>>
FindReferenceMethodsAsync
(
DocumentId
documentId
,
TextSpan
textSpan
,
byte
[]
solutionChecksum
)
public
async
Task
<
IEnumerable
<
ReferenceMethodDescriptor
>>
FindReferenceMethodsAsync
(
CodeLensArguments
arguments
,
TextSpan
textSpan
,
byte
[]
solutionChecksum
)
{
{
try
try
{
{
var
documentId
=
arguments
.
GetDocumentId
();
using
(
Internal
.
Log
.
Logger
.
LogBlock
(
FunctionId
.
CodeAnalysisService_FindReferenceMethodsAsync
,
documentId
.
ProjectId
.
DebugName
,
CancellationToken
))
using
(
Internal
.
Log
.
Logger
.
LogBlock
(
FunctionId
.
CodeAnalysisService_FindReferenceMethodsAsync
,
documentId
.
ProjectId
.
DebugName
,
CancellationToken
))
{
{
var
solution
=
await
RoslynServices
.
SolutionService
.
GetSolutionAsync
(
new
Checksum
(
solutionChecksum
),
CancellationToken
).
ConfigureAwait
(
false
);
var
solution
=
await
RoslynServices
.
SolutionService
.
GetSolutionAsync
(
new
Checksum
(
solutionChecksum
),
CancellationToken
).
ConfigureAwait
(
false
);
...
@@ -97,10 +103,12 @@ public async Task<IEnumerable<ReferenceMethodDescriptor>> FindReferenceMethodsAs
...
@@ -97,10 +103,12 @@ public async Task<IEnumerable<ReferenceMethodDescriptor>> FindReferenceMethodsAs
return
null
;
return
null
;
}
}
public
async
Task
<
string
>
GetFullyQualifiedName
(
DocumentId
documentId
,
TextSpan
textSpan
,
byte
[]
solutionChecksum
)
public
async
Task
<
string
>
GetFullyQualifiedName
(
CodeLensArguments
arguments
,
TextSpan
textSpan
,
byte
[]
solutionChecksum
)
{
{
try
try
{
{
var
documentId
=
arguments
.
GetDocumentId
();
using
(
Internal
.
Log
.
Logger
.
LogBlock
(
FunctionId
.
CodeAnalysisService_GetFullyQualifiedName
,
documentId
.
ProjectId
.
DebugName
,
CancellationToken
))
using
(
Internal
.
Log
.
Logger
.
LogBlock
(
FunctionId
.
CodeAnalysisService_GetFullyQualifiedName
,
documentId
.
ProjectId
.
DebugName
,
CancellationToken
))
{
{
var
solution
=
await
RoslynServices
.
SolutionService
.
GetSolutionAsync
(
new
Checksum
(
solutionChecksum
),
CancellationToken
).
ConfigureAwait
(
false
);
var
solution
=
await
RoslynServices
.
SolutionService
.
GetSolutionAsync
(
new
Checksum
(
solutionChecksum
),
CancellationToken
).
ConfigureAwait
(
false
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录