Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
45fb764e
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,体验更适合开发者的 AI 搜索 >>
提交
45fb764e
编写于
10月 20, 2016
作者:
C
CyrusNajmabadi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Make the code actoin the last argument.
上级
a99692e4
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
40 addition
and
34 deletion
+40
-34
src/EditorFeatures/Core/Implementation/Suggestions/CodeFixSuggestedAction.cs
...Core/Implementation/Suggestions/CodeFixSuggestedAction.cs
+3
-3
src/EditorFeatures/Core/Implementation/Suggestions/CodeRefactoringSuggestedAction.cs
...lementation/Suggestions/CodeRefactoringSuggestedAction.cs
+4
-3
src/EditorFeatures/Core/Implementation/Suggestions/FixAllSuggestedAction.cs
.../Core/Implementation/Suggestions/FixAllSuggestedAction.cs
+2
-2
src/EditorFeatures/Core/Implementation/Suggestions/PreviewChanges/PreviewChangesSuggestedAction.cs
...ggestions/PreviewChanges/PreviewChangesSuggestedAction.cs
+7
-6
src/EditorFeatures/Core/Implementation/Suggestions/SuggestedAction.cs
...atures/Core/Implementation/Suggestions/SuggestedAction.cs
+1
-1
src/EditorFeatures/Core/Implementation/Suggestions/SuggestedActionWithFlavors.cs
.../Implementation/Suggestions/SuggestedActionWithFlavors.cs
+4
-5
src/EditorFeatures/Core/Implementation/Suggestions/SuggestedActionsSourceProvider.cs
...lementation/Suggestions/SuggestedActionsSourceProvider.cs
+12
-9
src/EditorFeatures/Core/Implementation/Suggestions/SuppressionSuggestedAction.cs
.../Implementation/Suggestions/SuppressionSuggestedAction.cs
+7
-5
未找到文件。
src/EditorFeatures/Core/Implementation/Suggestions/CodeFixSuggestedAction.cs
浏览文件 @
45fb764e
...
...
@@ -25,12 +25,12 @@ internal sealed class CodeFixSuggestedAction : SuggestedActionWithFlavors, ITele
ICodeActionEditHandlerService
editHandler
,
IWaitIndicator
waitIndicator
,
CodeFix
fix
,
CodeAction
action
,
object
provider
,
SuggestedActionSet
fixAllFlavors
,
IAsynchronousOperationListener
operationListener
)
IAsynchronousOperationListener
operationListener
,
CodeAction
action
)
:
base
(
workspace
,
subjectBuffer
,
editHandler
,
waitIndicator
,
action
,
provider
,
operationListener
,
fixAllFlavors
)
provider
,
operationListener
,
action
,
fixAllFlavors
)
{
_fix
=
fix
;
}
...
...
src/EditorFeatures/Core/Implementation/Suggestions/CodeRefactoringSuggestedAction.cs
浏览文件 @
45fb764e
...
...
@@ -18,10 +18,11 @@ internal sealed class CodeRefactoringSuggestedAction : SuggestedActionWithFlavor
ITextBuffer
subjectBuffer
,
ICodeActionEditHandlerService
editHandler
,
IWaitIndicator
waitIndicator
,
CodeAction
codeAction
,
CodeRefactoringProvider
provider
,
IAsynchronousOperationListener
operationListener
)
:
base
(
workspace
,
subjectBuffer
,
editHandler
,
waitIndicator
,
codeAction
,
provider
,
operationListener
)
IAsynchronousOperationListener
operationListener
,
CodeAction
codeAction
)
:
base
(
workspace
,
subjectBuffer
,
editHandler
,
waitIndicator
,
provider
,
operationListener
,
codeAction
)
{
}
}
...
...
src/EditorFeatures/Core/Implementation/Suggestions/FixAllSuggestedAction.cs
浏览文件 @
45fb764e
...
...
@@ -32,8 +32,8 @@ internal sealed partial class FixAllSuggestedAction : SuggestedAction, ITelemetr
Diagnostic
originalFixedDiagnostic
,
IAsynchronousOperationListener
operationListener
)
:
base
(
workspace
,
subjectBuffer
,
editHandler
,
waitIndicator
,
new
FixAllCodeAction
(
fixAllState
),
fixAllState
.
FixAllProvid
er
,
operationListener
)
fixAllState
.
FixAllProvider
,
operationListen
er
,
new
FixAllCodeAction
(
fixAllState
)
)
{
_fixedDiagnostic
=
originalFixedDiagnostic
;
}
...
...
src/EditorFeatures/Core/Implementation/Suggestions/PreviewChanges/PreviewChangesSuggestedAction.cs
浏览文件 @
45fb764e
...
...
@@ -23,10 +23,11 @@ private sealed partial class PreviewChangesSuggestedAction : SuggestedAction
ITextBuffer
subjectBuffer
,
ICodeActionEditHandlerService
editHandler
,
IWaitIndicator
waitIndicator
,
PreviewChangesCodeAction
codeAction
,
object
provider
,
IAsynchronousOperationListener
operationListener
)
:
base
(
workspace
,
subjectBuffer
,
editHandler
,
waitIndicator
,
codeAction
,
provider
,
operationListener
)
IAsynchronousOperationListener
operationListener
,
PreviewChangesCodeAction
codeAction
)
:
base
(
workspace
,
subjectBuffer
,
editHandler
,
waitIndicator
,
provider
,
operationListener
,
codeAction
)
{
}
...
...
@@ -45,11 +46,11 @@ private sealed partial class PreviewChangesSuggestedAction : SuggestedAction
return
null
;
}
var
previewAction
=
new
PreviewChangesCodeAction
(
suggestedAction
.
Workspace
,
suggestedAction
.
CodeAction
,
changeSummary
);
return
new
PreviewChangesSuggestedAction
(
suggestedAction
.
Workspace
,
suggestedAction
.
SubjectBuffer
,
suggestedAction
.
EditHandler
,
suggestedAction
.
WaitIndicator
,
previewAction
,
suggestedAction
.
Provider
,
suggestedAction
.
OperationListener
);
suggestedAction
.
WaitIndicator
,
suggestedAction
.
Provider
,
suggestedAction
.
OperationListener
,
new
PreviewChangesCodeAction
(
suggestedAction
.
Workspace
,
suggestedAction
.
CodeAction
,
changeSummary
));
}
}
}
...
...
src/EditorFeatures/Core/Implementation/Suggestions/SuggestedAction.cs
浏览文件 @
45fb764e
...
...
@@ -41,9 +41,9 @@ internal partial class SuggestedAction : ForegroundThreadAffinitizedObject, ISug
ITextBuffer
subjectBuffer
,
ICodeActionEditHandlerService
editHandler
,
IWaitIndicator
waitIndicator
,
CodeAction
codeAction
,
object
provider
,
IAsynchronousOperationListener
operationListener
,
CodeAction
codeAction
,
IEnumerable
<
SuggestedActionSet
>
actionSets
=
null
)
{
Contract
.
ThrowIfTrue
(
provider
==
null
);
...
...
src/EditorFeatures/Core/Implementation/Suggestions/SuggestedActionWithFlavors.cs
浏览文件 @
45fb764e
...
...
@@ -32,11 +32,10 @@ internal abstract partial class SuggestedActionWithFlavors : SuggestedAction, IS
public
SuggestedActionWithFlavors
(
Workspace
workspace
,
ITextBuffer
subjectBuffer
,
ICodeActionEditHandlerService
editHandler
,
IWaitIndicator
waitIndicator
,
CodeAction
codeAction
,
object
provider
,
IAsynchronousOperationListener
operationListener
,
SuggestedActionSet
additionalFlavors
=
null
)
:
base
(
workspace
,
subjectBuffer
,
editHandler
,
waitIndicator
,
codeAction
,
provider
,
operationListener
,
actionSets
:
null
)
IWaitIndicator
waitIndicator
,
object
provider
,
IAsynchronousOperationListener
operationListener
,
CodeAction
codeAction
,
SuggestedActionSet
additionalFlavors
=
null
)
:
base
(
workspace
,
subjectBuffer
,
editHandler
,
waitIndicator
,
provider
,
operationListener
,
codeAction
,
actionSets
:
null
)
{
_additionalFlavors
=
additionalFlavors
;
}
...
...
src/EditorFeatures/Core/Implementation/Suggestions/SuggestedActionsSourceProvider.cs
浏览文件 @
45fb764e
...
...
@@ -379,7 +379,8 @@ private void ProcessFixCollection(Workspace workspace, IDictionary<CodeFixGroupK
{
nestedActions
.
Add
(
new
CodeFixSuggestedAction
(
workspace
,
_subjectBuffer
,
_owner
.
_editHandler
,
_owner
.
_waitIndicator
,
fix
,
nestedAction
,
fixCollection
.
Provider
,
getFixAllSuggestedActionSet
(
nestedAction
),
_owner
.
_listener
));
fixCollection
.
Provider
,
getFixAllSuggestedActionSet
(
nestedAction
),
_owner
.
_listener
,
nestedAction
));
}
var
set
=
new
SuggestedActionSet
(
...
...
@@ -387,14 +388,15 @@ private void ProcessFixCollection(Workspace workspace, IDictionary<CodeFixGroupK
fix
.
PrimaryDiagnostic
.
Location
.
SourceSpan
.
ToSpan
());
suggestedAction
=
new
SuggestedAction
(
workspace
,
_subjectBuffer
,
_owner
.
_editHandler
,
_owner
.
_waitIndicator
,
fix
.
Action
,
fixCollection
.
Provider
,
_owner
.
_listener
,
new
[]
{
set
});
_owner
.
_editHandler
,
_owner
.
_waitIndicator
,
fixCollection
.
Provider
,
_owner
.
_listener
,
fix
.
Action
,
new
[]
{
set
});
}
else
{
suggestedAction
=
new
CodeFixSuggestedAction
(
workspace
,
_subjectBuffer
,
_owner
.
_editHandler
,
_owner
.
_waitIndicator
,
fix
,
fix
.
Action
,
fixCollection
.
Provider
,
getFixAllSuggestedActionSet
(
fix
.
Action
),
_owner
.
_listener
);
workspace
,
_subjectBuffer
,
_owner
.
_editHandler
,
_owner
.
_waitIndicator
,
fix
,
fixCollection
.
Provider
,
getFixAllSuggestedActionSet
(
fix
.
Action
),
_owner
.
_listener
,
fix
.
Action
);
}
AddFix
(
fix
,
suggestedAction
,
map
,
order
);
...
...
@@ -418,8 +420,9 @@ private void ProcessFixCollection(Workspace workspace, IDictionary<CodeFixGroupK
else
{
suggestedAction
=
new
CodeFixSuggestedAction
(
workspace
,
_subjectBuffer
,
_owner
.
_editHandler
,
_owner
.
_waitIndicator
,
fix
,
fix
.
Action
,
fixCollection
.
Provider
,
getFixAllSuggestedActionSet
(
fix
.
Action
),
_owner
.
_listener
);
workspace
,
_subjectBuffer
,
_owner
.
_editHandler
,
_owner
.
_waitIndicator
,
fix
,
fixCollection
.
Provider
,
getFixAllSuggestedActionSet
(
fix
.
Action
),
_owner
.
_listener
,
fix
.
Action
);
}
AddFix
(
fix
,
suggestedAction
,
map
,
order
);
...
...
@@ -582,11 +585,11 @@ private SuggestedActionSet OrganizeRefactorings(Workspace workspace, CodeRefacto
{
var
refactoringSuggestedActions
=
ArrayBuilder
<
SuggestedAction
>.
GetInstance
();
foreach
(
var
a
in
refactoring
.
Actions
)
foreach
(
var
a
ction
in
refactoring
.
Actions
)
{
refactoringSuggestedActions
.
Add
(
new
CodeRefactoringSuggestedAction
(
workspace
,
_subjectBuffer
,
_owner
.
_editHandler
,
_owner
.
_waitIndicator
,
a
,
refactoring
.
Provider
,
_owner
.
_listener
));
refactoring
.
Provider
,
_owner
.
_listener
,
action
));
}
return
new
SuggestedActionSet
(
...
...
src/EditorFeatures/Core/Implementation/Suggestions/SuppressionSuggestedAction.cs
浏览文件 @
45fb764e
...
...
@@ -37,7 +37,8 @@ internal sealed class SuppressionSuggestedAction : SuggestedAction, ITelemetryDi
object
provider
,
Func
<
CodeAction
,
SuggestedActionSet
>
getFixAllSuggestedActionSet
,
IAsynchronousOperationListener
operationListener
)
:
base
(
workspace
,
subjectBuffer
,
editHandler
,
waitIndicator
,
fix
.
Action
,
provider
,
operationListener
)
:
base
(
workspace
,
subjectBuffer
,
editHandler
,
waitIndicator
,
provider
,
operationListener
,
fix
.
Action
)
{
_fix
=
fix
;
_getFixAllSuggestedActionSet
=
getFixAllSuggestedActionSet
;
...
...
@@ -69,14 +70,15 @@ public override Task<IEnumerable<SuggestedActionSet>> GetActionSetsAsync(Cancell
var
nestedSuggestedActions
=
ArrayBuilder
<
SuggestedAction
>.
GetInstance
();
var
fixCount
=
this
.
CodeAction
.
GetCodeActions
().
Length
;
foreach
(
var
c
in
this
.
CodeAction
.
GetCodeActions
())
foreach
(
var
action
in
this
.
CodeAction
.
GetCodeActions
())
{
cancellationToken
.
ThrowIfCancellationRequested
();
var
fixAllSuggestedActionSet
=
_getFixAllSuggestedActionSet
(
c
);
var
fixAllSuggestedActionSet
=
_getFixAllSuggestedActionSet
(
action
);
nestedSuggestedActions
.
Add
(
new
CodeFixSuggestedAction
(
this
.
Workspace
,
this
.
SubjectBuffer
,
this
.
EditHandler
,
this
.
WaitIndicator
,
new
CodeFix
(
_fix
.
Project
,
c
,
_fix
.
Diagnostics
),
c
,
this
.
Provider
,
fixAllSuggestedActionSet
,
this
.
OperationListener
));
this
.
Workspace
,
this
.
SubjectBuffer
,
this
.
EditHandler
,
this
.
WaitIndicator
,
new
CodeFix
(
_fix
.
Project
,
action
,
_fix
.
Diagnostics
),
this
.
Provider
,
fixAllSuggestedActionSet
,
this
.
OperationListener
,
action
));
}
_actionSets
=
ImmutableArray
.
Create
(
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录