Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
28621ea9
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,发现更多精彩内容 >>
提交
28621ea9
编写于
11月 21, 2019
作者:
M
Manish Vasani
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Feedback
上级
10422f72
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
14 addition
and
30 deletion
+14
-30
src/EditorFeatures/Core.Wpf/Suggestions/SuggestedActionsSource.cs
...orFeatures/Core.Wpf/Suggestions/SuggestedActionsSource.cs
+4
-4
src/EditorFeatures/Core/Implementation/CodeFixes/CodeFixService.cs
...rFeatures/Core/Implementation/CodeFixes/CodeFixService.cs
+4
-4
src/Features/Core/Portable/CodeFixes/ICodeFixService.cs
src/Features/Core/Portable/CodeFixes/ICodeFixService.cs
+1
-1
src/Features/Core/Portable/CodeRefactorings/CodeRefactoringService.cs
.../Core/Portable/CodeRefactorings/CodeRefactoringService.cs
+1
-1
src/Features/Core/Portable/CodeRefactorings/ICodeRefactoringService.cs
...Core/Portable/CodeRefactorings/ICodeRefactoringService.cs
+1
-1
src/Features/Core/Portable/Diagnostics/EngineV2/DiagnosticIncrementalAnalyzer_GetDiagnosticsForSpan.cs
...V2/DiagnosticIncrementalAnalyzer_GetDiagnosticsForSpan.cs
+2
-2
src/Features/Core/Portable/Diagnostics/IDiagnosticAnalyzerService.cs
...s/Core/Portable/Diagnostics/IDiagnosticAnalyzerService.cs
+1
-1
src/Workspaces/Core/Portable/Utilities/NoOpDisposable.cs
src/Workspaces/Core/Portable/Utilities/NoOpDisposable.cs
+0
-16
未找到文件。
src/EditorFeatures/Core.Wpf/Suggestions/SuggestedActionsSource.cs
浏览文件 @
28621ea9
...
@@ -155,7 +155,7 @@ public bool TryGetTelemetryId(out Guid telemetryId)
...
@@ -155,7 +155,7 @@ public bool TryGetTelemetryId(out Guid telemetryId)
ISuggestedActionCategorySet
requestedActionCategories
,
ISuggestedActionCategorySet
requestedActionCategories
,
SnapshotSpan
range
,
SnapshotSpan
range
,
CancellationToken
cancellationToken
)
CancellationToken
cancellationToken
)
=>
GetSuggestedActions
(
requestedActionCategories
,
range
,
addOperationScope
:
_
=>
n
ew
NoOpDisposable
()
,
cancellationToken
);
=>
GetSuggestedActions
(
requestedActionCategories
,
range
,
addOperationScope
:
_
=>
n
ull
,
cancellationToken
);
public
IEnumerable
<
SuggestedActionSet
>?
GetSuggestedActions
(
public
IEnumerable
<
SuggestedActionSet
>?
GetSuggestedActions
(
ISuggestedActionCategorySet
requestedActionCategories
,
ISuggestedActionCategorySet
requestedActionCategories
,
...
@@ -172,7 +172,7 @@ public bool TryGetTelemetryId(out Guid telemetryId)
...
@@ -172,7 +172,7 @@ public bool TryGetTelemetryId(out Guid telemetryId)
public
IEnumerable
<
SuggestedActionSet
>?
GetSuggestedActions
(
public
IEnumerable
<
SuggestedActionSet
>?
GetSuggestedActions
(
ISuggestedActionCategorySet
requestedActionCategories
,
ISuggestedActionCategorySet
requestedActionCategories
,
SnapshotSpan
range
,
SnapshotSpan
range
,
Func
<
string
,
IDisposable
>
addOperationScope
,
Func
<
string
,
IDisposable
?
>
addOperationScope
,
CancellationToken
cancellationToken
)
CancellationToken
cancellationToken
)
{
{
AssertIsForeground
();
AssertIsForeground
();
...
@@ -345,7 +345,7 @@ private SuggestedActionSet InlineActions(SuggestedActionSet actionSet)
...
@@ -345,7 +345,7 @@ private SuggestedActionSet InlineActions(SuggestedActionSet actionSet)
Workspace
workspace
,
Workspace
workspace
,
Document
document
,
Document
document
,
SnapshotSpan
range
,
SnapshotSpan
range
,
Func
<
string
,
IDisposable
>
addOperationScope
,
Func
<
string
,
IDisposable
?
>
addOperationScope
,
CancellationToken
cancellationToken
)
CancellationToken
cancellationToken
)
{
{
this
.
AssertIsForeground
();
this
.
AssertIsForeground
();
...
@@ -734,7 +734,7 @@ private static SuggestedActionSetPriority GetSuggestedActionSetPriority(CodeActi
...
@@ -734,7 +734,7 @@ private static SuggestedActionSetPriority GetSuggestedActionSetPriority(CodeActi
Workspace
workspace
,
Workspace
workspace
,
Document
document
,
Document
document
,
TextSpan
?
selectionOpt
,
TextSpan
?
selectionOpt
,
Func
<
string
,
IDisposable
>
addOperationScope
,
Func
<
string
,
IDisposable
?
>
addOperationScope
,
CancellationToken
cancellationToken
)
CancellationToken
cancellationToken
)
{
{
this
.
AssertIsForeground
();
this
.
AssertIsForeground
();
...
...
src/EditorFeatures/Core/Implementation/CodeFixes/CodeFixService.cs
浏览文件 @
28621ea9
...
@@ -146,9 +146,9 @@ public Task<ImmutableArray<CodeFixCollection>> GetFixesAsync(Document document,
...
@@ -146,9 +146,9 @@ public Task<ImmutableArray<CodeFixCollection>> GetFixesAsync(Document document,
=>
GetFixesAsync
(
document
,
range
,
includeConfigurationFixes
,
isBlocking
:
false
,
cancellationToken
);
=>
GetFixesAsync
(
document
,
range
,
includeConfigurationFixes
,
isBlocking
:
false
,
cancellationToken
);
public
Task
<
ImmutableArray
<
CodeFixCollection
>>
GetFixesAsync
(
Document
document
,
TextSpan
range
,
bool
includeConfigurationFixes
,
bool
isBlocking
,
CancellationToken
cancellationToken
)
public
Task
<
ImmutableArray
<
CodeFixCollection
>>
GetFixesAsync
(
Document
document
,
TextSpan
range
,
bool
includeConfigurationFixes
,
bool
isBlocking
,
CancellationToken
cancellationToken
)
=>
GetFixesAsync
(
document
,
range
,
includeConfigurationFixes
,
isBlocking
,
addOperationScope
:
_
=>
n
ew
NoOpDisposable
()
,
cancellationToken
);
=>
GetFixesAsync
(
document
,
range
,
includeConfigurationFixes
,
isBlocking
,
addOperationScope
:
_
=>
n
ull
,
cancellationToken
);
public
async
Task
<
ImmutableArray
<
CodeFixCollection
>>
GetFixesAsync
(
Document
document
,
TextSpan
range
,
bool
includeConfigurationFixes
,
bool
isBlocking
,
Func
<
string
,
IDisposable
>
addOperationScope
,
CancellationToken
cancellationToken
)
public
async
Task
<
ImmutableArray
<
CodeFixCollection
>>
GetFixesAsync
(
Document
document
,
TextSpan
range
,
bool
includeConfigurationFixes
,
bool
isBlocking
,
Func
<
string
,
IDisposable
?
>
addOperationScope
,
CancellationToken
cancellationToken
)
{
{
// REVIEW: this is the first and simplest design. basically, when ctrl+. is pressed, it asks diagnostic service to give back
// REVIEW: this is the first and simplest design. basically, when ctrl+. is pressed, it asks diagnostic service to give back
// current diagnostics for the given span, and it will use that to get fixes. internally diagnostic service will either return cached information
// current diagnostics for the given span, and it will use that to get fixes. internally diagnostic service will either return cached information
...
@@ -220,7 +220,7 @@ int GetValue(CodeFixCollection c)
...
@@ -220,7 +220,7 @@ int GetValue(CodeFixCollection c)
}
}
using
var
resultDisposer
=
ArrayBuilder
<
CodeFixCollection
>.
GetInstance
(
out
var
result
);
using
var
resultDisposer
=
ArrayBuilder
<
CodeFixCollection
>.
GetInstance
(
out
var
result
);
await
AppendFixesAsync
(
document
,
range
,
diagnostics
,
fixAllForInSpan
:
true
,
isBlocking
:
false
,
result
,
addOperationScope
:
_
=>
n
ew
NoOpDisposable
()
,
cancellationToken
).
ConfigureAwait
(
false
);
await
AppendFixesAsync
(
document
,
range
,
diagnostics
,
fixAllForInSpan
:
true
,
isBlocking
:
false
,
result
,
addOperationScope
:
_
=>
n
ull
,
cancellationToken
).
ConfigureAwait
(
false
);
// TODO: Just get the first fix for now until we have a way to config user's preferred fix
// TODO: Just get the first fix for now until we have a way to config user's preferred fix
// https://github.com/dotnet/roslyn/issues/27066
// https://github.com/dotnet/roslyn/issues/27066
...
@@ -254,7 +254,7 @@ public async Task<Document> ApplyCodeFixesForSpecificDiagnosticIdAsync(Document
...
@@ -254,7 +254,7 @@ public async Task<Document> ApplyCodeFixesForSpecificDiagnosticIdAsync(Document
bool
fixAllForInSpan
,
bool
fixAllForInSpan
,
bool
isBlocking
,
bool
isBlocking
,
ArrayBuilder
<
CodeFixCollection
>
result
,
ArrayBuilder
<
CodeFixCollection
>
result
,
Func
<
string
,
IDisposable
>
addOperationScope
,
Func
<
string
,
IDisposable
?
>
addOperationScope
,
CancellationToken
cancellationToken
)
CancellationToken
cancellationToken
)
{
{
var
hasAnySharedFixer
=
_workspaceFixersMap
.
TryGetValue
(
document
.
Project
.
Language
,
out
var
fixerMap
);
var
hasAnySharedFixer
=
_workspaceFixersMap
.
TryGetValue
(
document
.
Project
.
Language
,
out
var
fixerMap
);
...
...
src/Features/Core/Portable/CodeFixes/ICodeFixService.cs
浏览文件 @
28621ea9
...
@@ -15,7 +15,7 @@ namespace Microsoft.CodeAnalysis.CodeFixes
...
@@ -15,7 +15,7 @@ namespace Microsoft.CodeAnalysis.CodeFixes
internal
interface
ICodeFixService
internal
interface
ICodeFixService
{
{
Task
<
ImmutableArray
<
CodeFixCollection
>>
GetFixesAsync
(
Document
document
,
TextSpan
textSpan
,
bool
includeSuppressionFixes
,
bool
isBlocking
,
CancellationToken
cancellationToken
);
Task
<
ImmutableArray
<
CodeFixCollection
>>
GetFixesAsync
(
Document
document
,
TextSpan
textSpan
,
bool
includeSuppressionFixes
,
bool
isBlocking
,
CancellationToken
cancellationToken
);
Task
<
ImmutableArray
<
CodeFixCollection
>>
GetFixesAsync
(
Document
document
,
TextSpan
textSpan
,
bool
includeSuppressionFixes
,
bool
isBlocking
,
Func
<
string
,
IDisposable
>
addOperationScope
,
CancellationToken
cancellationToken
);
Task
<
ImmutableArray
<
CodeFixCollection
>>
GetFixesAsync
(
Document
document
,
TextSpan
textSpan
,
bool
includeSuppressionFixes
,
bool
isBlocking
,
Func
<
string
,
IDisposable
?
>
addOperationScope
,
CancellationToken
cancellationToken
);
Task
<
ImmutableArray
<
CodeFixCollection
>>
GetFixesAsync
(
Document
document
,
TextSpan
textSpan
,
bool
includeSuppressionFixes
,
CancellationToken
cancellationToken
);
Task
<
ImmutableArray
<
CodeFixCollection
>>
GetFixesAsync
(
Document
document
,
TextSpan
textSpan
,
bool
includeSuppressionFixes
,
CancellationToken
cancellationToken
);
Task
<
CodeFixCollection
?>
GetDocumentFixAllForIdInSpanAsync
(
Document
document
,
TextSpan
textSpan
,
string
diagnosticId
,
CancellationToken
cancellationToken
);
Task
<
CodeFixCollection
?>
GetDocumentFixAllForIdInSpanAsync
(
Document
document
,
TextSpan
textSpan
,
string
diagnosticId
,
CancellationToken
cancellationToken
);
Task
<
Document
>
ApplyCodeFixesForSpecificDiagnosticIdAsync
(
Document
document
,
string
diagnosticId
,
IProgressTracker
progressTracker
,
CancellationToken
cancellationToken
);
Task
<
Document
>
ApplyCodeFixesForSpecificDiagnosticIdAsync
(
Document
document
,
string
diagnosticId
,
IProgressTracker
progressTracker
,
CancellationToken
cancellationToken
);
...
...
src/Features/Core/Portable/CodeRefactorings/CodeRefactoringService.cs
浏览文件 @
28621ea9
...
@@ -109,7 +109,7 @@ private IEnumerable<CodeRefactoringProvider> GetProviders(Document document)
...
@@ -109,7 +109,7 @@ private IEnumerable<CodeRefactoringProvider> GetProviders(Document document)
Document
document
,
Document
document
,
TextSpan
state
,
TextSpan
state
,
bool
isBlocking
,
bool
isBlocking
,
Func
<
string
,
IDisposable
>
addOperationScope
,
Func
<
string
,
IDisposable
?
>
addOperationScope
,
CancellationToken
cancellationToken
)
CancellationToken
cancellationToken
)
{
{
using
(
Logger
.
LogBlock
(
FunctionId
.
Refactoring_CodeRefactoringService_GetRefactoringsAsync
,
cancellationToken
))
using
(
Logger
.
LogBlock
(
FunctionId
.
Refactoring_CodeRefactoringService_GetRefactoringsAsync
,
cancellationToken
))
...
...
src/Features/Core/Portable/CodeRefactorings/ICodeRefactoringService.cs
浏览文件 @
28621ea9
...
@@ -18,6 +18,6 @@ internal interface ICodeRefactoringService
...
@@ -18,6 +18,6 @@ internal interface ICodeRefactoringService
Task
<
ImmutableArray
<
CodeRefactoring
>>
GetRefactoringsAsync
(
Document
document
,
TextSpan
textSpan
,
bool
isBlocking
,
CancellationToken
cancellationToken
);
Task
<
ImmutableArray
<
CodeRefactoring
>>
GetRefactoringsAsync
(
Document
document
,
TextSpan
textSpan
,
bool
isBlocking
,
CancellationToken
cancellationToken
);
Task
<
ImmutableArray
<
CodeRefactoring
>>
GetRefactoringsAsync
(
Document
document
,
TextSpan
textSpan
,
bool
isBlocking
,
Func
<
string
,
IDisposable
>
addOperationScope
,
CancellationToken
cancellationToken
);
Task
<
ImmutableArray
<
CodeRefactoring
>>
GetRefactoringsAsync
(
Document
document
,
TextSpan
textSpan
,
bool
isBlocking
,
Func
<
string
,
IDisposable
?
>
addOperationScope
,
CancellationToken
cancellationToken
);
}
}
}
}
src/Features/Core/Portable/Diagnostics/EngineV2/DiagnosticIncrementalAnalyzer_GetDiagnosticsForSpan.cs
浏览文件 @
28621ea9
...
@@ -114,7 +114,7 @@ public async Task<bool> TryGetAsync(List<DiagnosticData> list, Func<string, IDis
...
@@ -114,7 +114,7 @@ public async Task<bool> TryGetAsync(List<DiagnosticData> list, Func<string, IDis
foreach
(
var
stateSet
in
_stateSets
)
foreach
(
var
stateSet
in
_stateSets
)
{
{
IDisposable
disposableScope
=
null
;
IDisposable
disposableScope
=
null
;
RoslynEventSource
.
LogBlock
?
logBlock
=
null
;
RoslynEventSource
.
LogBlock
logBlock
=
default
;
try
try
{
{
if
(
addOperationScopeOpt
!=
null
)
if
(
addOperationScopeOpt
!=
null
)
...
@@ -153,7 +153,7 @@ public async Task<bool> TryGetAsync(List<DiagnosticData> list, Func<string, IDis
...
@@ -153,7 +153,7 @@ public async Task<bool> TryGetAsync(List<DiagnosticData> list, Func<string, IDis
}
}
finally
finally
{
{
logBlock
?
.
Dispose
();
logBlock
.
Dispose
();
disposableScope
?.
Dispose
();
disposableScope
?.
Dispose
();
}
}
}
}
...
...
src/Features/Core/Portable/Diagnostics/IDiagnosticAnalyzerService.cs
浏览文件 @
28621ea9
...
@@ -75,7 +75,7 @@ internal interface IDiagnosticAnalyzerService
...
@@ -75,7 +75,7 @@ internal interface IDiagnosticAnalyzerService
/// This can be expensive since it is force analyzing diagnostics if it doesn't have up-to-date one yet.
/// This can be expensive since it is force analyzing diagnostics if it doesn't have up-to-date one yet.
/// If diagnosticIdOpt is not null, it gets diagnostics only for this given diagnosticIdOpt value
/// If diagnosticIdOpt is not null, it gets diagnostics only for this given diagnosticIdOpt value
/// </summary>
/// </summary>
Task
<
IEnumerable
<
DiagnosticData
>>
GetDiagnosticsForSpanAsync
(
Document
document
,
TextSpan
range
,
string
?
diagnosticIdOpt
=
null
,
bool
includeSuppressedDiagnostics
=
false
,
Func
<
string
,
IDisposable
>?
addOperationScopeOpt
=
null
,
CancellationToken
cancellationToken
=
default
);
Task
<
IEnumerable
<
DiagnosticData
>>
GetDiagnosticsForSpanAsync
(
Document
document
,
TextSpan
range
,
string
?
diagnosticIdOpt
=
null
,
bool
includeSuppressedDiagnostics
=
false
,
Func
<
string
,
IDisposable
?
>?
addOperationScopeOpt
=
null
,
CancellationToken
cancellationToken
=
default
);
/// <summary>
/// <summary>
/// Gets a list of <see cref="DiagnosticAnalyzer"/>s for the given <see cref="Project"/>
/// Gets a list of <see cref="DiagnosticAnalyzer"/>s for the given <see cref="Project"/>
...
...
src/Workspaces/Core/Portable/Utilities/NoOpDisposable.cs
已删除
100644 → 0
浏览文件 @
10422f72
// 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
;
namespace
Roslyn.Utilities
{
/// <summary>
/// Dummy no-op disposable.
/// </summary>
internal
struct
NoOpDisposable
:
IDisposable
{
public
void
Dispose
()
{
}
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录