Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
883bde50
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,发现更多精彩内容 >>
提交
883bde50
编写于
12月 17, 2019
作者:
T
Tomas Matousek
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Feedback
上级
d407343c
变更
15
隐藏空白更改
内联
并排
Showing
15 changed file
with
45 addition
and
39 deletion
+45
-39
src/EditorFeatures/TestUtilities/Diagnostics/TestDiagnosticAnalyzerDriver.cs
...TestUtilities/Diagnostics/TestDiagnosticAnalyzerDriver.cs
+1
-1
src/Features/Core/Portable/AddImport/SymbolReferenceFinder_PackageAssemblySearch.cs
.../AddImport/SymbolReferenceFinder_PackageAssemblySearch.cs
+2
-4
src/Features/Core/Portable/Diagnostics/EngineV2/DiagnosticIncrementalAnalyzer.InProcOrRemoteHostAnalyzerRunner.cs
...icIncrementalAnalyzer.InProcOrRemoteHostAnalyzerRunner.cs
+1
-0
src/Features/Core/Portable/Diagnostics/EngineV2/DiagnosticIncrementalAnalyzer_IncrementalAnalyzer.cs
...neV2/DiagnosticIncrementalAnalyzer_IncrementalAnalyzer.cs
+1
-0
src/VisualStudio/Core/Def/Implementation/Remote/RemoteHostClientServiceFactory.RemoteHostClientService.cs
...RemoteHostClientServiceFactory.RemoteHostClientService.cs
+1
-1
src/VisualStudio/Core/Def/Implementation/Remote/RemoteHostClientServiceFactory.SolutionChecksumUpdater.cs
...RemoteHostClientServiceFactory.SolutionChecksumUpdater.cs
+1
-0
src/VisualStudio/Core/Def/Implementation/Remote/ServiceHubRemoteHostClient.Connections.cs
...entation/Remote/ServiceHubRemoteHostClient.Connections.cs
+8
-8
src/VisualStudio/Core/Test.Next/Services/LanguageServiceTests.cs
...ualStudio/Core/Test.Next/Services/LanguageServiceTests.cs
+1
-1
src/VisualStudio/Core/Test.Next/Services/ServiceHubServicesTests.cs
...Studio/Core/Test.Next/Services/ServiceHubServicesTests.cs
+3
-2
src/VisualStudio/Core/Test.Next/Services/VisualStudioDiagnosticAnalyzerExecutorTests.cs
...t/Services/VisualStudioDiagnosticAnalyzerExecutorTests.cs
+3
-3
src/VisualStudio/VisualStudioDiagnosticsToolWindow/OptionPages/PerformanceLoggersPage.cs
...agnosticsToolWindow/OptionPages/PerformanceLoggersPage.cs
+1
-0
src/Workspaces/Core/Portable/FindSymbols/SymbolFinder_FindLiteralReferences.cs
...ortable/FindSymbols/SymbolFinder_FindLiteralReferences.cs
+1
-1
src/Workspaces/Core/Portable/FindSymbols/SymbolFinder_FindReferences_Current.cs
...rtable/FindSymbols/SymbolFinder_FindReferences_Current.cs
+1
-1
src/Workspaces/Core/Portable/Remote/RemoteHostClient.cs
src/Workspaces/Core/Portable/Remote/RemoteHostClient.cs
+19
-16
src/Workspaces/Core/Portable/Remote/RemoteHostClientExtensions.cs
...spaces/Core/Portable/Remote/RemoteHostClientExtensions.cs
+1
-1
未找到文件。
src/EditorFeatures/TestUtilities/Diagnostics/TestDiagnosticAnalyzerDriver.cs
浏览文件 @
883bde50
...
...
@@ -143,8 +143,8 @@ private async Task SynchronizeGlobalAssetToRemoteHostIfNeededAsync(Workspace wor
_
=
await
client
.
TryRunRemoteAsync
(
WellKnownRemoteHostServices
.
RemoteHostService
,
nameof
(
IRemoteHostService
.
SynchronizeGlobalAssetsAsync
),
workspace
.
CurrentSolution
,
new
[]
{
(
object
)
checksums
},
workspace
.
CurrentSolution
,
callbackTarget
:
null
,
CancellationToken
.
None
).
ConfigureAwait
(
false
);
}
...
...
src/Features/Core/Portable/AddImport/SymbolReferenceFinder_PackageAssemblySearch.cs
浏览文件 @
883bde50
...
...
@@ -6,6 +6,7 @@
using
System.Threading.Tasks
;
using
Microsoft.CodeAnalysis.Packaging
;
using
Microsoft.CodeAnalysis.PooledObjects
;
using
Microsoft.CodeAnalysis.Shared.Extensions
;
using
Microsoft.CodeAnalysis.SymbolSearch
;
using
Microsoft.CodeAnalysis.Utilities
;
using
Roslyn.Utilities
;
...
...
@@ -141,10 +142,7 @@ private partial class SymbolReferenceFinder
foreach
(
var
reference
in
project
.
MetadataReferences
)
{
cancellationToken
.
ThrowIfCancellationRequested
();
var
compilation
=
await
project
.
GetCompilationAsync
(
cancellationToken
).
ConfigureAwait
(
false
);
// The project must support compilations since we only create compilation for the project that invoked AddImport feature.
RoslynDebug
.
Assert
(
compilation
!=
null
);
var
compilation
=
await
project
.
GetRequiredCompilationAsync
(
cancellationToken
).
ConfigureAwait
(
false
);
var
assemblySymbol
=
compilation
.
GetAssemblyOrModuleSymbol
(
reference
)
as
IAssemblySymbol
;
if
(
assemblySymbol
?.
Name
==
result
.
AssemblyName
)
...
...
src/Features/Core/Portable/Diagnostics/EngineV2/DiagnosticIncrementalAnalyzer.InProcOrRemoteHostAnalyzerRunner.cs
浏览文件 @
883bde50
...
...
@@ -110,6 +110,7 @@ private async Task FireAndForgetReportAnalyzerPerformanceAsync(Project project,
// +1 for project itself
project
.
DocumentIds
.
Count
+
1
},
solution
:
null
,
callbackTarget
:
null
,
cancellationToken
).
ConfigureAwait
(
false
);
}
...
...
src/Features/Core/Portable/Diagnostics/EngineV2/DiagnosticIncrementalAnalyzer_IncrementalAnalyzer.cs
浏览文件 @
883bde50
...
...
@@ -540,6 +540,7 @@ private async Task ReportAnalyzerPerformanceAsync(Document document, Compilation
WellKnownServiceHubServices
.
CodeAnalysisService
,
nameof
(
IRemoteDiagnosticAnalyzerService
.
ReportAnalyzerPerformance
),
new
object
[]
{
pooledObject
.
Object
.
ToAnalyzerPerformanceInfo
(
AnalyzerService
),
/* unit count */
1
},
solution
:
null
,
callbackTarget
:
null
,
cancellationToken
).
ConfigureAwait
(
false
);
}
...
...
src/VisualStudio/Core/Def/Implementation/Remote/RemoteHostClientServiceFactory.RemoteHostClientService.cs
浏览文件 @
883bde50
...
...
@@ -213,8 +213,8 @@ private async Task<RemoteHostClient> EnableAsync(CancellationToken cancellationT
var
success
=
await
client
.
TryRunRemoteAsync
(
WellKnownRemoteHostServices
.
RemoteHostService
,
nameof
(
IRemoteHostService
.
SynchronizeGlobalAssetsAsync
),
_workspace
.
CurrentSolution
,
new
[]
{
(
object
)
checksums
},
_workspace
.
CurrentSolution
,
callbackTarget
:
null
,
cancellationToken
).
ConfigureAwait
(
false
);
...
...
src/VisualStudio/Core/Def/Implementation/Remote/RemoteHostClientServiceFactory.SolutionChecksumUpdater.cs
浏览文件 @
883bde50
...
...
@@ -187,6 +187,7 @@ private void PushTextChanges(Document oldDocument, Document newDocument)
WellKnownRemoteHostServices
.
RemoteHostService
,
nameof
(
IRemoteHostService
.
SynchronizeTextAsync
),
new
object
[]
{
oldDocument
.
Id
,
state
.
Text
,
textChanges
},
solution
:
null
,
callbackTarget
:
null
,
CancellationToken
).
ConfigureAwait
(
false
);
...
...
src/VisualStudio/Core/Def/Implementation/Remote/ServiceHubRemoteHostClient.Connections.cs
浏览文件 @
883bde50
...
...
@@ -27,7 +27,7 @@ internal static class Connections
TimeSpan
timeout
,
CancellationToken
cancellationToken
)
{
const
int
RetryDelayInMS
=
50
;
var
retryDelay
=
TimeSpan
.
FromMilliseconds
(
50
)
;
using
(
var
pooledStopwatch
=
SharedPools
.
Default
<
Stopwatch
>().
GetPooledObject
())
{
...
...
@@ -42,16 +42,16 @@ internal static class Connections
{
return
await
client
.
RequestServiceAsync
(
descriptor
,
cancellationToken
).
ConfigureAwait
(
false
);
}
catch
(
OperationCanceledException
e
)
when
(
e
.
CancellationToken
!=
cancellationToken
)
catch
(
OperationCanceledException
)
when
(!
cancellationToken
.
IsCancellationRequested
)
{
// Retry on cancellation that is not sourced by our cancellation token.
// Since HubClient will throw when it can't connect to service hub service (e.g. timeout, disposal).
}
// wait before next try
await
Task
.
Delay
(
RetryDelayInMS
,
cancellationToken
).
ConfigureAwait
(
false
);
await
Task
.
Delay
(
retryDelay
,
cancellationToken
).
ConfigureAwait
(
false
);
// if we tried for
more than 10 mins
and still couldn't connect, report non-fatal Watson
// if we tried for
too long
and still couldn't connect, report non-fatal Watson
if
(!
s_timeoutReported
&&
watch
.
Elapsed
>
s_reportTimeout
)
{
s_timeoutReported
=
true
;
...
...
@@ -80,9 +80,9 @@ internal static class Connections
CancellationToken
cancellationToken
)
{
const
int
MaxRetryAttempts
=
10
;
const
int
RetryDelayInMS
=
50
;
var
retryDelay
=
TimeSpan
.
FromMilliseconds
(
50
)
;
RemoteInvocation
Exception
lastException
=
null
;
Exception
lastException
=
null
;
var
descriptor
=
new
ServiceDescriptor
(
serviceName
)
{
HostGroup
=
hostGroup
};
...
...
@@ -103,7 +103,7 @@ internal static class Connections
timeout
,
cancellationToken
).
ConfigureAwait
(
false
);
}
catch
(
RemoteInvocationException
ex
)
catch
(
Exception
ex
)
when
(!(
ex
is
OperationCanceledException
)
)
{
// save info only if it failed with different issue than before.
if
(
lastException
?.
Message
!=
ex
.
Message
)
...
...
@@ -117,7 +117,7 @@ internal static class Connections
}
// wait before next try
await
Task
.
Delay
(
RetryDelayInMS
,
cancellationToken
).
ConfigureAwait
(
false
);
await
Task
.
Delay
(
retryDelay
,
cancellationToken
).
ConfigureAwait
(
false
);
}
RemoteHostCrashInfoBar
.
ShowInfoBar
(
workspace
,
lastException
);
...
...
src/VisualStudio/Core/Test.Next/Services/LanguageServiceTests.cs
浏览文件 @
883bde50
...
...
@@ -118,8 +118,8 @@ private async Task UpdatePrimaryWorkspace(InProcRemoteHostClient client, Solutio
Assert
.
True
(
await
client
.
TryRunRemoteAsync
(
WellKnownRemoteHostServices
.
RemoteHostService
,
nameof
(
IRemoteHostService
.
SynchronizePrimaryWorkspaceAsync
),
solution
,
new
object
[]
{
await
solution
.
State
.
GetChecksumAsync
(
CancellationToken
.
None
),
_solutionVersion
++
},
solution
,
callbackTarget
:
null
,
CancellationToken
.
None
));
}
...
...
src/VisualStudio/Core/Test.Next/Services/ServiceHubServicesTests.cs
浏览文件 @
883bde50
...
...
@@ -106,6 +106,7 @@ public async Task TestRemoteHostTextSynchronize()
WellKnownRemoteHostServices
.
RemoteHostService
,
nameof
(
IRemoteHostService
.
SynchronizeTextAsync
),
new
object
[]
{
oldDocument
.
Id
,
oldState
.
Text
,
newText
.
GetTextChanges
(
oldText
)
},
solution
:
null
,
callbackTarget
:
null
,
CancellationToken
.
None
);
...
...
@@ -178,8 +179,8 @@ public async Task TestRemoteHostSynchronizeGlobalAssets()
Assert
.
True
(
await
client
.
TryRunRemoteAsync
(
WellKnownRemoteHostServices
.
RemoteHostService
,
nameof
(
IRemoteHostService
.
SynchronizeGlobalAssetsAsync
),
workspace
.
CurrentSolution
,
new
object
[]
{
new
Checksum
[
0
]
{
}
},
workspace
.
CurrentSolution
,
callbackTarget
:
null
,
CancellationToken
.
None
));
...
...
@@ -379,8 +380,8 @@ private async Task UpdatePrimaryWorkspace(InProcRemoteHostClient client, Solutio
Assert
.
True
(
await
client
.
TryRunRemoteAsync
(
WellKnownRemoteHostServices
.
RemoteHostService
,
nameof
(
IRemoteHostService
.
SynchronizePrimaryWorkspaceAsync
),
solution
,
new
object
[]
{
await
solution
.
State
.
GetChecksumAsync
(
CancellationToken
.
None
),
_solutionVersion
++
},
solution
,
callbackTarget
:
null
,
CancellationToken
.
None
));
}
...
...
src/VisualStudio/Core/Test.Next/Services/VisualStudioDiagnosticAnalyzerExecutorTests.cs
浏览文件 @
883bde50
...
...
@@ -177,8 +177,8 @@ void Method()
Assert
.
True
(
await
client
.
TryRunRemoteAsync
(
WellKnownRemoteHostServices
.
RemoteHostService
,
nameof
(
IRemoteHostService
.
SynchronizeGlobalAssetsAsync
),
workspace
.
CurrentSolution
,
new
[]
{
new
Checksum
[]
{
asset
.
Checksum
}
},
workspace
.
CurrentSolution
,
callbackTarget
:
null
,
CancellationToken
.
None
));
...
...
@@ -233,10 +233,10 @@ void Method()
Assert
.
True
(
await
client
.
TryRunRemoteAsync
(
WellKnownRemoteHostServices
.
RemoteHostService
,
nameof
(
IRemoteHostService
.
SynchronizeGlobalAssetsAsync
),
workspace
.
CurrentSolution
,
new
[]
{
new
Checksum
[]
{
asset
.
Checksum
}
},
workspace
.
CurrentSolution
,
callbackTarget
:
null
,
CancellationToken
.
None
));
cancellationToken
:
CancellationToken
.
None
));
// run analysis
var
project
=
workspace
.
CurrentSolution
.
Projects
.
First
().
AddAnalyzerReference
(
analyzerReference
);
...
...
src/VisualStudio/VisualStudioDiagnosticsToolWindow/OptionPages/PerformanceLoggersPage.cs
浏览文件 @
883bde50
...
...
@@ -71,6 +71,7 @@ public static void SetLoggers(IGlobalOptionService optionService, IThreadingCont
WellKnownRemoteHostServices
.
RemoteHostService
,
nameof
(
IRemoteHostService
.
SetLoggingFunctionIds
),
new
object
[]
{
loggerTypes
,
functionIds
},
solution
:
null
,
callbackTarget
:
null
,
CancellationToken
.
None
));
}
...
...
src/Workspaces/Core/Portable/FindSymbols/SymbolFinder_FindLiteralReferences.cs
浏览文件 @
883bde50
...
...
@@ -30,8 +30,8 @@ public static partial class SymbolFinder
var
success
=
await
client
.
TryRunRemoteAsync
(
WellKnownServiceHubServices
.
CodeAnalysisService
,
nameof
(
IRemoteSymbolFinder
.
FindLiteralReferencesAsync
),
solution
,
new
object
[]
{
value
,
typeCode
},
solution
,
serverCallback
,
cancellationToken
).
ConfigureAwait
(
false
);
...
...
src/Workspaces/Core/Portable/FindSymbols/SymbolFinder_FindReferences_Current.cs
浏览文件 @
883bde50
...
...
@@ -42,13 +42,13 @@ public static partial class SymbolFinder
var
success
=
await
client
.
TryRunRemoteAsync
(
WellKnownServiceHubServices
.
CodeAnalysisService
,
nameof
(
IRemoteSymbolFinder
.
FindReferencesAsync
),
solution
,
new
object
[]
{
SerializableSymbolAndProjectId
.
Dehydrate
(
symbolAndProjectId
),
documents
?.
Select
(
d
=>
d
.
Id
).
ToArray
(),
SerializableFindReferencesSearchOptions
.
Dehydrate
(
options
),
},
solution
,
serverCallback
,
cancellationToken
).
ConfigureAwait
(
false
);
...
...
src/Workspaces/Core/Portable/Remote/RemoteHostClient.cs
浏览文件 @
883bde50
...
...
@@ -127,28 +127,31 @@ public static string CreateClientId(string prefix)
return
new
KeepAliveSession
(
this
,
connection
,
serviceName
,
callbackTarget
);
}
public
async
Task
<
bool
>
TryRunRemoteAsync
(
string
serviceName
,
string
targetName
,
Solution
solution
,
IReadOnlyList
<
object
>
arguments
,
object
?
callbackTarget
,
CancellationToken
cancellationToken
)
public
async
Task
<
bool
>
TryRunRemoteAsync
(
string
serviceName
,
string
targetName
,
IReadOnlyList
<
object
>
arguments
,
Solution
?
solution
,
object
?
callbackTarget
,
CancellationToken
cancellationToken
)
{
using
var
session
=
await
TryCreateSessionAsync
(
serviceName
,
solution
,
callbackTarget
,
cancellationToken
).
ConfigureAwait
(
false
);
if
(
session
==
null
)
{
return
false
;
}
// TODO: revisit solution handling - see https://github.com/dotnet/roslyn/issues/24836
await
session
.
InvokeAsync
(
targetName
,
arguments
,
cancellationToken
).
ConfigureAwait
(
false
);
return
true
;
}
if
(
solution
==
null
)
{
using
var
connection
=
await
TryCreateConnectionAsync
(
serviceName
,
callbackTarget
,
cancellationToken
).
ConfigureAwait
(
false
);
if
(
connection
==
null
)
{
return
false
;
}
public
async
Task
<
bool
>
TryRunRemoteAsync
(
string
serviceName
,
string
targetName
,
IReadOnlyList
<
object
>
arguments
,
object
?
callbackTarget
,
CancellationToken
cancellationToken
)
{
using
var
connection
=
await
TryCreateConnectionAsync
(
serviceName
,
callbackTarget
,
cancellationToken
).
ConfigureAwait
(
false
);
if
(
connection
==
null
)
await
connection
.
InvokeAsync
(
targetName
,
arguments
,
cancellationToken
).
ConfigureAwait
(
false
);
}
else
{
return
false
;
using
var
session
=
await
TryCreateSessionAsync
(
serviceName
,
solution
,
callbackTarget
,
cancellationToken
).
ConfigureAwait
(
false
);
if
(
session
==
null
)
{
return
false
;
}
await
session
.
InvokeAsync
(
targetName
,
arguments
,
cancellationToken
).
ConfigureAwait
(
false
);
}
await
connection
.
InvokeAsync
(
targetName
,
arguments
,
cancellationToken
).
ConfigureAwait
(
false
);
return
true
;
}
...
...
src/Workspaces/Core/Portable/Remote/RemoteHostClientExtensions.cs
浏览文件 @
883bde50
...
...
@@ -34,8 +34,8 @@ public static async Task SynchronizePrimaryWorkspaceAsync(this Workspace workspa
_
=
await
client
.
TryRunRemoteAsync
(
WellKnownRemoteHostServices
.
RemoteHostService
,
nameof
(
IRemoteHostService
.
SynchronizePrimaryWorkspaceAsync
),
solution
,
new
object
[]
{
checksum
,
solution
.
WorkspaceVersion
},
solution
,
callbackTarget
:
null
,
cancellationToken
).
ConfigureAwait
(
false
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录