Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
67ce37ff
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,发现更多精彩内容 >>
提交
67ce37ff
编写于
7月 25, 2019
作者:
H
HeeJae Chang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
updated following feedbacks
上级
35973ef0
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
27 addition
and
23 deletion
+27
-23
src/VisualStudio/CSharp/Impl/LanguageClient/CSharpLanguageServerClient.cs
.../CSharp/Impl/LanguageClient/CSharpLanguageServerClient.cs
+3
-2
src/VisualStudio/Core/Def/Implementation/LanguageClient/AbstractLanguageServerClient.cs
...ementation/LanguageClient/AbstractLanguageServerClient.cs
+8
-14
src/VisualStudio/VisualBasic/Impl/LanguageClient/VisualBasicLanguageServerClient.vb
...ic/Impl/LanguageClient/VisualBasicLanguageServerClient.vb
+3
-2
src/Workspaces/Core/Portable/Shared/TestHooks/FeatureAttribute_Names.cs
.../Core/Portable/Shared/TestHooks/FeatureAttribute_Names.cs
+1
-1
src/Workspaces/Remote/ServiceHub/Services/LanguageServer.cs
src/Workspaces/Remote/ServiceHub/Services/LanguageServer.cs
+3
-3
src/Workspaces/Remote/ServiceHub/Shared/ServiceHubServiceBase.cs
...kspaces/Remote/ServiceHub/Shared/ServiceHubServiceBase.cs
+9
-1
未找到文件。
src/VisualStudio/CSharp/Impl/LanguageClient/CSharpLanguageServerClient.cs
浏览文件 @
67ce37ff
...
...
@@ -16,6 +16,7 @@ namespace Microsoft.VisualStudio.LanguageServices.CSharp.LanguageClient
// currently, platform doesn't allow multiple content types
// to be associated with 1 ILanguageClient forcing us to
// create multiple ILanguageClients for each content type
// https://devdiv.visualstudio.com/DevDiv/_workitems/edit/952373
[
ContentType
(
ContentTypeNames
.
CSharpContentType
)]
[
Export
(
typeof
(
ILanguageClient
))]
[
ExportMetadata
(
"Capabilities"
,
"WorkspaceStreamingSymbolProvider"
)]
...
...
@@ -30,8 +31,8 @@ internal class CSharpLanguageServerClient : AbstractLanguageServerClient
:
base
(
workspace
,
eventListener
,
listenerProvider
,
WellKnownServiceHubServices
.
CSharpLanguageServer
,
"ManagedLanguage.IDE.CSharpLanguageServer"
)
languageServerName
:
WellKnownServiceHubServices
.
CSharpLanguageServer
,
serviceHubClientName
:
"ManagedLanguage.IDE.CSharpLanguageServer"
)
{
}
...
...
src/VisualStudio/Core/Def/Implementation/LanguageClient/AbstractLanguageServerClient.cs
浏览文件 @
67ce37ff
...
...
@@ -12,7 +12,6 @@
using
Microsoft.VisualStudio.LanguageServices.Remote
;
using
Microsoft.CodeAnalysis.Host
;
using
System.Composition
;
using
Microsoft.CodeAnalysis.Editor.Shared.Utilities
;
using
Microsoft.CodeAnalysis.Shared.TestHooks
;
namespace
Microsoft.VisualStudio.LanguageServices.Implementation.LanguageService
...
...
@@ -23,7 +22,7 @@ internal abstract class AbstractLanguageServerClient : ILanguageClient
private
readonly
LanguageServerClientEventListener
_eventListener
;
private
readonly
IAsynchronousOperationListener
_asyncListener
;
private
readonly
string
_
c
lientName
;
private
readonly
string
_
serviceHubC
lientName
;
private
readonly
string
_languageServerName
;
/// <summary>
...
...
@@ -60,13 +59,13 @@ internal abstract class AbstractLanguageServerClient : ILanguageClient
LanguageServerClientEventListener
eventListener
,
IAsynchronousOperationListenerProvider
listenerProvider
,
string
languageServerName
,
string
c
lientName
)
string
serviceHubC
lientName
)
{
_workspace
=
workspace
;
_eventListener
=
eventListener
;
_asyncListener
=
listenerProvider
.
GetListener
(
FeatureAttribute
.
FindReferences
);
_
clientName
=
c
lientName
;
_
serviceHubClientName
=
serviceHubC
lientName
;
_languageServerName
=
languageServerName
;
}
...
...
@@ -80,7 +79,7 @@ public async Task<Connection> ActivateAsync(CancellationToken cancellationToken)
}
var
hostGroup
=
new
HostGroup
(
client
.
ClientId
);
var
hubClient
=
new
HubClient
(
_
c
lientName
);
var
hubClient
=
new
HubClient
(
_
serviceHubC
lientName
);
var
stream
=
await
ServiceHubRemoteHostClient
.
Connections
.
RequestServiceAsync
(
_workspace
,
...
...
@@ -104,7 +103,10 @@ public Task OnLoadedAsync()
// set up event stream so that we start LSP server once Roslyn is loaded
_eventListener
.
WorkspaceStarted
.
ContinueWith
(
async
_
=>
{
EnsureRemoteHost
();
// this might get called before solution is fully loaded and before file is opened.
// we delay our OOP start until then, but user might do vsstart before that. so we make sure we start OOP if
// it is not running yet. multiple start is no-op
((
RemoteHostClientServiceFactory
.
RemoteHostClientService
)
_workspace
.
Services
.
GetService
<
IRemoteHostClientService
>()).
Enable
();
// wait until remote host is available before let platform know that they can activate our LSP
var
client
=
await
_workspace
.
TryGetRemoteHostClientAsync
(
CancellationToken
.
None
).
ConfigureAwait
(
false
);
...
...
@@ -120,14 +122,6 @@ public Task OnLoadedAsync()
},
TaskScheduler
.
Default
).
CompletesAsyncOperation
(
token
);
return
Task
.
CompletedTask
;
void
EnsureRemoteHost
()
{
// this might get called before solution is fully loaded and before file is opened.
// we delay our OOP start until then, but user might do vsstart before that. so we make sure we start OOP if
// it is not running yet. multiple start is no-op
((
RemoteHostClientServiceFactory
.
RemoteHostClientService
)
_workspace
.
Services
.
GetService
<
IRemoteHostClientService
>()).
Enable
();
}
}
/// <summary>
...
...
src/VisualStudio/VisualBasic/Impl/LanguageClient/VisualBasicLanguageServerClient.vb
浏览文件 @
67ce37ff
...
...
@@ -14,6 +14,7 @@ Namespace Microsoft.VisualStudio.LanguageServices.VisualBasic.LanguageClient
' currently, platform doesn't allow multiple content types
' to be associated with 1 ILanguageClient forcing us to
' create multiple ILanguageClients for each content type
' https://devdiv.visualstudio.com/DevDiv/_workitems/edit/952373
<
ContentType
(
ContentTypeNames
.
VisualBasicContentType
)
>
<
Export
(
GetType
(
ILanguageClient
))
>
<
ExportMetadata
(
"Capabilities"
,
"WorkspaceStreamingSymbolProvider"
)
>
...
...
@@ -28,8 +29,8 @@ Namespace Microsoft.VisualStudio.LanguageServices.VisualBasic.LanguageClient
MyBase
.
New
(
workspace
,
eventListener
,
listenerProvider
,
WellKnownServiceHubServices
.
VisualBasicLanguageServer
,
"ManagedLanguage.IDE.VisualBasicLanguageServer"
)
languageServerName
:
=
WellKnownServiceHubServices
.
VisualBasicLanguageServer
,
serviceHubClientName
:
=
"ManagedLanguage.IDE.VisualBasicLanguageServer"
)
End
Sub
Public
Overrides
ReadOnly
Property
Name
As
String
...
...
src/Workspaces/Core/Portable/Shared/TestHooks/FeatureAttribute_Names.cs
浏览文件 @
67ce37ff
...
...
@@ -38,7 +38,7 @@ internal partial class FeatureAttribute
public
const
string
Snippets
=
nameof
(
Snippets
);
public
const
string
SolutionCrawler
=
nameof
(
SolutionCrawler
);
public
const
string
TodoCommentList
=
nameof
(
TodoCommentList
);
public
const
string
VsSearch
=
nameof
(
Vs
Search
);
public
const
string
LanguageServerWorkspaceSymbolSearch
=
nameof
(
LanguageServerWorkspaceSymbol
Search
);
public
const
string
Workspace
=
nameof
(
Workspace
);
}
}
src/Workspaces/Remote/ServiceHub/Services/LanguageServer.cs
浏览文件 @
67ce37ff
...
...
@@ -98,7 +98,7 @@ public void Exit()
}
[
JsonRpcMethod
(
VSSymbolMethods
.
WorkspaceBeginSymbolName
)]
public
Task
<
VSBeginSymbolParams
>
WorkspaceBegin
SymbolAsync
(
string
query
,
int
searchId
,
CancellationToken
cancellationToken
)
public
Task
<
VSBeginSymbolParams
>
BeginWorkspace
SymbolAsync
(
string
query
,
int
searchId
,
CancellationToken
cancellationToken
)
{
return
RunServiceAsync
(
async
()
=>
{
...
...
@@ -130,7 +130,7 @@ async Task SearchProjectAsync(Project project, CancellationToken cancellationTok
s_supportedKinds
,
cancellationToken
).
ConfigureAwait
(
false
);
var
convertedResults
=
await
Convert
(
results
,
cancellationToken
).
ConfigureAwait
(
false
);
var
convertedResults
=
await
Convert
Async
(
results
,
cancellationToken
).
ConfigureAwait
(
false
);
await
InvokeAsync
(
VSSymbolMethods
.
WorkspacePublishSymbolName
,
...
...
@@ -139,7 +139,7 @@ async Task SearchProjectAsync(Project project, CancellationToken cancellationTok
}
}
private
static
async
Task
<
VSSymbolInformation
[
]>
Convert
(
private
static
async
Task
<
VSSymbolInformation
[
]>
Convert
Async
(
ImmutableArray
<
INavigateToSearchResult
>
results
,
CancellationToken
cancellationToken
)
{
var
symbols
=
new
VSSymbolInformation
[
results
.
Length
];
...
...
src/Workspaces/Remote/ServiceHub/Shared/ServiceHubServiceBase.cs
浏览文件 @
67ce37ff
...
...
@@ -84,7 +84,15 @@ private static Task<Solution> GetSolutionAsync(RoslynServices roslynService, Pin
}
/// <summary>
/// Base type with helper methods. this is not tied to how Roslyn OOP works. just servicehub helpers.
/// Base type with servicehub helper methods. this is not tied to how Roslyn OOP works.
///
/// any type that derived from this type is supposed to be an entry point for servicehub services.
/// name of the type should match one appears in GenerateServiceHubConfigurationFiles.targets
/// and signature of either its constructor or static CreateAsync must follow the convension
/// ctor(Stream stream, IServiceProvider serviceProvider).
///
/// see servicehub detail from here
/// https://microsoft.sharepoint.com/teams/DD_VSIDE/_layouts/15/WopiFrame.aspx?sourcedoc={bd8fab44-c988-4f11-9866-bb12f906bb53}&action=edit&wd=target%28Extensibility%2FFrom%20ConEx%2FServiceHub.one%7Cbafb6e9b-5988-4995-8135-f152abd28a0d%2FOnboarding%20%28for%20partners%5C%29%7Ccc54c21c-2894-4f05-8ce4-9530bacdb9c8%2F%29&wdorigin=703
/// </summary>
internal
abstract
class
ServiceBase
:
IDisposable
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录