Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
c48a1433
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,发现更多精彩内容 >>
提交
c48a1433
编写于
4月 20, 2016
作者:
C
CyrusNajmabadi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove property from FixAllCodeActio
nContext
上级
e19ea0cf
变更
7
显示空白变更内容
内联
并排
Showing
7 changed file
with
25 addition
and
14 deletion
+25
-14
src/EditorFeatures/Core/Implementation/CodeFixes/CodeFixService.cs
...rFeatures/Core/Implementation/CodeFixes/CodeFixService.cs
+3
-1
src/EditorFeatures/Core/Implementation/Suggestions/CodeFixSuggestedAction.cs
...Core/Implementation/Suggestions/CodeFixSuggestedAction.cs
+3
-2
src/EditorFeatures/Core/Implementation/Suggestions/SuggestedActionsSourceProvider.cs
...lementation/Suggestions/SuggestedActionsSourceProvider.cs
+6
-3
src/EditorFeatures/Test/Diagnostics/AbstractUserDiagnosticTest.cs
...orFeatures/Test/Diagnostics/AbstractUserDiagnosticTest.cs
+2
-2
src/EditorFeatures/Test2/Diagnostics/AbstractCrossLanguageUserDiagnosticTest.vb
...t2/Diagnostics/AbstractCrossLanguageUserDiagnosticTest.vb
+2
-1
src/Features/Core/Portable/CodeFixes/CodeFixCollection.cs
src/Features/Core/Portable/CodeFixes/CodeFixCollection.cs
+7
-3
src/Features/Core/Portable/CodeFixes/FixAllOccurrences/FixAllCodeActionContext.cs
...le/CodeFixes/FixAllOccurrences/FixAllCodeActionContext.cs
+2
-2
未找到文件。
src/EditorFeatures/Core/Implementation/CodeFixes/CodeFixService.cs
浏览文件 @
c48a1433
...
@@ -301,7 +301,9 @@ public async Task<IEnumerable<CodeFixCollection>> GetFixesAsync(Document documen
...
@@ -301,7 +301,9 @@ public async Task<IEnumerable<CodeFixCollection>> GetFixesAsync(Document documen
}
}
result
=
result
??
new
List
<
CodeFixCollection
>();
result
=
result
??
new
List
<
CodeFixCollection
>();
var
codeFix
=
new
CodeFixCollection
(
fixer
,
span
,
fixes
,
fixAllProvider
,
fixAllContext
,
supportedScopes
);
var
codeFix
=
new
CodeFixCollection
(
fixer
,
span
,
fixes
,
fixAllProvider
,
fixAllContext
,
supportedScopes
,
diagnostics
.
First
());
result
.
Add
(
codeFix
);
result
.
Add
(
codeFix
);
}
}
...
...
src/EditorFeatures/Core/Implementation/Suggestions/CodeFixSuggestedAction.cs
浏览文件 @
c48a1433
...
@@ -49,6 +49,7 @@ internal class CodeFixSuggestedAction : SuggestedActionWithFlavors, ITelemetryDi
...
@@ -49,6 +49,7 @@ internal class CodeFixSuggestedAction : SuggestedActionWithFlavors, ITelemetryDi
FixAllProvider
fixAllProvider
,
FixAllProvider
fixAllProvider
,
FixAllCodeActionContext
fixAllCodeActionContext
,
FixAllCodeActionContext
fixAllCodeActionContext
,
IEnumerable
<
FixAllScope
>
supportedScopes
,
IEnumerable
<
FixAllScope
>
supportedScopes
,
Diagnostic
firstDiagnostic
,
Workspace
workspace
,
Workspace
workspace
,
ITextBuffer
subjectBuffer
,
ITextBuffer
subjectBuffer
,
ICodeActionEditHandlerService
editHandler
,
ICodeActionEditHandlerService
editHandler
,
...
@@ -71,8 +72,8 @@ internal class CodeFixSuggestedAction : SuggestedActionWithFlavors, ITelemetryDi
...
@@ -71,8 +72,8 @@ internal class CodeFixSuggestedAction : SuggestedActionWithFlavors, ITelemetryDi
var
fixAllContext
=
GetContextForScopeAndActionId
(
fixAllCodeActionContext
,
scope
,
action
.
EquivalenceKey
);
var
fixAllContext
=
GetContextForScopeAndActionId
(
fixAllCodeActionContext
,
scope
,
action
.
EquivalenceKey
);
var
fixAllAction
=
new
FixAllCodeAction
(
fixAllContext
,
fixAllProvider
,
showPreviewChangesDialog
:
true
);
var
fixAllAction
=
new
FixAllCodeAction
(
fixAllContext
,
fixAllProvider
,
showPreviewChangesDialog
:
true
);
var
fixAllSuggestedAction
=
new
FixAllSuggestedAction
(
var
fixAllSuggestedAction
=
new
FixAllSuggestedAction
(
workspace
,
subjectBuffer
,
editHandler
,
waitIndicator
,
fixAllAction
,
fixAllProvider
,
workspace
,
subjectBuffer
,
editHandler
,
waitIndicator
,
fixAllAction
,
fixAll
CodeActionContext
.
OriginalDiagnostics
.
First
()
,
operationListener
);
fixAll
Provider
,
firstDiagnostic
,
operationListener
);
fixAllSuggestedActions
.
Add
(
fixAllSuggestedAction
);
fixAllSuggestedActions
.
Add
(
fixAllSuggestedAction
);
}
}
...
...
src/EditorFeatures/Core/Implementation/Suggestions/SuggestedActionsSourceProvider.cs
浏览文件 @
c48a1433
...
@@ -285,7 +285,8 @@ private List<CodeFixCollection> FilterOnUIThread(List<CodeFixCollection> collect
...
@@ -285,7 +285,8 @@ private List<CodeFixCollection> FilterOnUIThread(List<CodeFixCollection> collect
:
applicableFixes
.
Count
==
collection
.
Fixes
.
Length
:
applicableFixes
.
Count
==
collection
.
Fixes
.
Length
?
collection
?
collection
:
new
CodeFixCollection
(
collection
.
Provider
,
collection
.
TextSpan
,
applicableFixes
,
:
new
CodeFixCollection
(
collection
.
Provider
,
collection
.
TextSpan
,
applicableFixes
,
collection
.
FixAllProvider
,
collection
.
FixAllContext
,
collection
.
SupportedScopes
);
collection
.
FixAllProvider
,
collection
.
FixAllContext
,
collection
.
SupportedScopes
,
collection
.
FirstDiagnostic
);
}
}
private
bool
IsApplicable
(
CodeAction
action
,
Workspace
workspace
)
private
bool
IsApplicable
(
CodeAction
action
,
Workspace
workspace
)
...
@@ -349,8 +350,10 @@ private IEnumerable<SuggestedActionSet> OrganizeFixes(Workspace workspace, IEnum
...
@@ -349,8 +350,10 @@ private IEnumerable<SuggestedActionSet> OrganizeFixes(Workspace workspace, IEnum
Func
<
CodeAction
,
SuggestedActionSet
>
getFixAllSuggestedActionSet
=
Func
<
CodeAction
,
SuggestedActionSet
>
getFixAllSuggestedActionSet
=
codeAction
=>
CodeFixSuggestedAction
.
GetFixAllSuggestedActionSet
(
codeAction
=>
CodeFixSuggestedAction
.
GetFixAllSuggestedActionSet
(
codeAction
,
fixCount
,
fixCollection
.
FixAllProvider
,
fixCollection
.
FixAllContext
,
fixCollection
.
SupportedScopes
,
codeAction
,
fixCount
,
fixCollection
.
FixAllProvider
,
workspace
,
_subjectBuffer
,
_owner
.
_editHandler
,
_owner
.
_waitIndicator
,
_owner
.
_listener
);
fixCollection
.
FixAllContext
,
fixCollection
.
SupportedScopes
,
fixCollection
.
FirstDiagnostic
,
workspace
,
_subjectBuffer
,
_owner
.
_editHandler
,
_owner
.
_waitIndicator
,
_owner
.
_listener
);
foreach
(
var
fix
in
fixes
)
foreach
(
var
fix
in
fixes
)
{
{
...
...
src/EditorFeatures/Test/Diagnostics/AbstractUserDiagnosticTest.cs
浏览文件 @
c48a1433
...
@@ -144,7 +144,7 @@ protected Document GetDocumentAndAnnotatedSpan(TestWorkspace workspace, out stri
...
@@ -144,7 +144,7 @@ protected Document GetDocumentAndAnnotatedSpan(TestWorkspace workspace, out stri
{
{
var
codeFix
=
new
CodeFixCollection
(
var
codeFix
=
new
CodeFixCollection
(
fixer
,
diagnostic
.
Location
.
SourceSpan
,
fixes
,
fixer
,
diagnostic
.
Location
.
SourceSpan
,
fixes
,
fixAllProvider
:
null
,
fixAllContext
:
null
,
supportedScopes
:
null
);
fixAllProvider
:
null
,
fixAllContext
:
null
,
supportedScopes
:
null
,
firstDiagnostic
:
null
);
result
.
Add
(
Tuple
.
Create
(
diagnostic
,
codeFix
));
result
.
Add
(
Tuple
.
Create
(
diagnostic
,
codeFix
));
}
}
}
}
...
@@ -165,7 +165,7 @@ protected Document GetDocumentAndAnnotatedSpan(TestWorkspace workspace, out stri
...
@@ -165,7 +165,7 @@ protected Document GetDocumentAndAnnotatedSpan(TestWorkspace workspace, out stri
var
diagnosticSpan
=
diagnostic
.
Location
.
IsInSource
?
diagnostic
.
Location
.
SourceSpan
:
default
(
TextSpan
);
var
diagnosticSpan
=
diagnostic
.
Location
.
IsInSource
?
diagnostic
.
Location
.
SourceSpan
:
default
(
TextSpan
);
var
codeFix
=
new
CodeFixCollection
(
var
codeFix
=
new
CodeFixCollection
(
fixAllProvider
,
diagnosticSpan
,
ImmutableArray
.
Create
(
new
CodeFix
(
document
.
Project
,
fixAllFix
,
diagnostic
)),
fixAllProvider
,
diagnosticSpan
,
ImmutableArray
.
Create
(
new
CodeFix
(
document
.
Project
,
fixAllFix
,
diagnostic
)),
fixAllProvider
:
null
,
fixAllContext
:
null
,
supportedScopes
:
null
);
fixAllProvider
:
null
,
fixAllContext
:
null
,
supportedScopes
:
null
,
firstDiagnostic
:
null
);
result
.
Add
(
Tuple
.
Create
(
diagnostic
,
codeFix
));
result
.
Add
(
Tuple
.
Create
(
diagnostic
,
codeFix
));
}
}
}
}
...
...
src/EditorFeatures/Test2/Diagnostics/AbstractCrossLanguageUserDiagnosticTest.vb
浏览文件 @
c48a1433
...
@@ -114,7 +114,8 @@ Namespace Microsoft.CodeAnalysis.Editor.UnitTests.Diagnostics
...
@@ -114,7 +114,8 @@ Namespace Microsoft.CodeAnalysis.Editor.UnitTests.Diagnostics
If
fixes
.
Any
()
Then
If
fixes
.
Any
()
Then
result
.
Add
(
Tuple
.
Create
(
diagnostic
,
New
CodeFixCollection
(
result
.
Add
(
Tuple
.
Create
(
diagnostic
,
New
CodeFixCollection
(
fixer
,
diagnostic
.
Location
.
SourceSpan
,
fixes
,
fixer
,
diagnostic
.
Location
.
SourceSpan
,
fixes
,
fixAllProvider
:
=
Nothing
,
fixAllContext
:
=
Nothing
,
supportedScopes
:
=
Nothing
)))
fixAllProvider
:
=
Nothing
,
fixAllContext
:
=
Nothing
,
supportedScopes
:
=
Nothing
,
firstDiagnostic
:
=
Nothing
)))
End
If
End
If
Next
Next
...
...
src/Features/Core/Portable/CodeFixes/CodeFixCollection.cs
浏览文件 @
c48a1433
...
@@ -23,6 +23,7 @@ internal class CodeFixCollection
...
@@ -23,6 +23,7 @@ internal class CodeFixCollection
public
FixAllProvider
FixAllProvider
{
get
;
}
public
FixAllProvider
FixAllProvider
{
get
;
}
public
FixAllCodeActionContext
FixAllContext
{
get
;
}
public
FixAllCodeActionContext
FixAllContext
{
get
;
}
public
IEnumerable
<
FixAllScope
>
SupportedScopes
{
get
;
}
public
IEnumerable
<
FixAllScope
>
SupportedScopes
{
get
;
}
public
Diagnostic
FirstDiagnostic
{
get
;
}
public
CodeFixCollection
(
public
CodeFixCollection
(
object
provider
,
object
provider
,
...
@@ -30,8 +31,9 @@ internal class CodeFixCollection
...
@@ -30,8 +31,9 @@ internal class CodeFixCollection
IEnumerable
<
CodeFix
>
fixes
,
IEnumerable
<
CodeFix
>
fixes
,
FixAllProvider
fixAllProvider
,
FixAllProvider
fixAllProvider
,
FixAllCodeActionContext
fixAllContext
,
FixAllCodeActionContext
fixAllContext
,
IEnumerable
<
FixAllScope
>
supportedScopes
)
:
IEnumerable
<
FixAllScope
>
supportedScopes
,
this
(
provider
,
span
,
fixes
.
ToImmutableArray
(),
fixAllProvider
,
fixAllContext
,
supportedScopes
)
Diagnostic
firstDiagnostic
)
:
this
(
provider
,
span
,
fixes
.
ToImmutableArray
(),
fixAllProvider
,
fixAllContext
,
supportedScopes
,
firstDiagnostic
)
{
{
}
}
...
@@ -41,7 +43,8 @@ internal class CodeFixCollection
...
@@ -41,7 +43,8 @@ internal class CodeFixCollection
ImmutableArray
<
CodeFix
>
fixes
,
ImmutableArray
<
CodeFix
>
fixes
,
FixAllProvider
fixAllProvider
,
FixAllProvider
fixAllProvider
,
FixAllCodeActionContext
fixAllContext
,
FixAllCodeActionContext
fixAllContext
,
IEnumerable
<
FixAllScope
>
supportedScopes
)
IEnumerable
<
FixAllScope
>
supportedScopes
,
Diagnostic
firstDiagnostic
)
{
{
this
.
Provider
=
provider
;
this
.
Provider
=
provider
;
this
.
TextSpan
=
span
;
this
.
TextSpan
=
span
;
...
@@ -49,6 +52,7 @@ internal class CodeFixCollection
...
@@ -49,6 +52,7 @@ internal class CodeFixCollection
this
.
FixAllProvider
=
fixAllProvider
;
this
.
FixAllProvider
=
fixAllProvider
;
this
.
FixAllContext
=
fixAllContext
;
this
.
FixAllContext
=
fixAllContext
;
this
.
SupportedScopes
=
supportedScopes
;
this
.
SupportedScopes
=
supportedScopes
;
this
.
FirstDiagnostic
=
firstDiagnostic
;
}
}
}
}
}
}
src/Features/Core/Portable/CodeFixes/FixAllOccurrences/FixAllCodeActionContext.cs
浏览文件 @
c48a1433
...
@@ -81,13 +81,13 @@ private static IEnumerable<string> GetFixAllDiagnosticIds(FixAllProviderInfo fix
...
@@ -81,13 +81,13 @@ private static IEnumerable<string> GetFixAllDiagnosticIds(FixAllProviderInfo fix
.
Select
(
d
=>
d
.
Id
);
.
Select
(
d
=>
d
.
Id
);
}
}
#if false
public
IEnumerable
<
Diagnostic
>
OriginalDiagnostics
public
IEnumerable
<
Diagnostic
>
OriginalDiagnostics
{
{
get
{
return
_originalFixDiagnostics
;
}
get
{
return
_originalFixDiagnostics
;
}
}
}
#if false
public
FixAllProvider
FixAllProvider
public
FixAllProvider
FixAllProvider
{
{
get
{
return
_fixAllProviderInfo
.
FixAllProvider
;
}
get
{
return
_fixAllProviderInfo
.
FixAllProvider
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录