Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
060770b4
V
vscode
项目概览
xxadev
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
060770b4
编写于
11月 06, 2019
作者:
M
Matt Bierner
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Show which specific type of requested code actions / refactorings are not available
Fixes #84096
上级
0ef88efa
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
28 addition
and
9 deletion
+28
-9
src/vs/editor/contrib/codeAction/codeActionCommands.ts
src/vs/editor/contrib/codeAction/codeActionCommands.ts
+28
-9
未找到文件。
src/vs/editor/contrib/codeAction/codeActionCommands.ts
浏览文件 @
060770b4
...
@@ -271,12 +271,19 @@ export class CodeActionCommand extends EditorCommand {
...
@@ -271,12 +271,19 @@ export class CodeActionCommand extends EditorCommand {
});
});
}
}
public
runEditorCommand
(
_accessor
:
ServicesAccessor
,
editor
:
ICodeEditor
,
userArg
:
any
)
{
public
runEditorCommand
(
_accessor
:
ServicesAccessor
,
editor
:
ICodeEditor
,
userArg
s
:
any
)
{
const
args
=
CodeActionCommandArgs
.
fromUser
(
userArg
,
{
const
args
=
CodeActionCommandArgs
.
fromUser
(
userArg
s
,
{
kind
:
CodeActionKind
.
Empty
,
kind
:
CodeActionKind
.
Empty
,
apply
:
CodeActionAutoApply
.
IfSingle
,
apply
:
CodeActionAutoApply
.
IfSingle
,
});
});
return
triggerCodeActionsForEditorSelection
(
editor
,
nls
.
localize
(
'
editor.action.quickFix.noneMessage
'
,
"
No code actions available
"
),
return
triggerCodeActionsForEditorSelection
(
editor
,
typeof
userArgs
?.
kind
===
'
string
'
?
args
.
preferred
?
nls
.
localize
(
'
editor.action.codeAction.noneMessage.preferred.kind
'
,
"
No preferred code actions for '{0}' available
"
,
userArgs
.
kind
)
:
nls
.
localize
(
'
editor.action.codeAction.noneMessage.kind
'
,
"
No code actions for '{0}' available
"
,
userArgs
.
kind
)
:
args
.
preferred
?
nls
.
localize
(
'
editor.action.codeAction.noneMessage.preferred
'
,
"
No preferred code actions available
"
)
:
nls
.
localize
(
'
editor.action.codeAction.noneMessage
'
,
"
No code actions available
"
),
{
{
kind
:
args
.
kind
,
kind
:
args
.
kind
,
includeSourceActions
:
true
,
includeSourceActions
:
true
,
...
@@ -322,13 +329,19 @@ export class RefactorAction extends EditorAction {
...
@@ -322,13 +329,19 @@ export class RefactorAction extends EditorAction {
});
});
}
}
public
run
(
_accessor
:
ServicesAccessor
,
editor
:
ICodeEditor
,
userArg
:
any
):
void
{
public
run
(
_accessor
:
ServicesAccessor
,
editor
:
ICodeEditor
,
userArg
s
:
any
):
void
{
const
args
=
CodeActionCommandArgs
.
fromUser
(
userArg
,
{
const
args
=
CodeActionCommandArgs
.
fromUser
(
userArg
s
,
{
kind
:
CodeActionKind
.
Refactor
,
kind
:
CodeActionKind
.
Refactor
,
apply
:
CodeActionAutoApply
.
Never
apply
:
CodeActionAutoApply
.
Never
});
});
return
triggerCodeActionsForEditorSelection
(
editor
,
return
triggerCodeActionsForEditorSelection
(
editor
,
nls
.
localize
(
'
editor.action.refactor.noneMessage
'
,
"
No refactorings available
"
),
typeof
userArgs
?.
kind
===
'
string
'
?
args
.
preferred
?
nls
.
localize
(
'
editor.action.refactor.noneMessage.preferred.kind
'
,
"
No preferred refactorings for '{0}' available
"
,
userArgs
.
kind
)
:
nls
.
localize
(
'
editor.action.refactor.noneMessage.kind
'
,
"
No refactorings for '{0}' available
"
,
userArgs
.
kind
)
:
args
.
preferred
?
nls
.
localize
(
'
editor.action.refactor.noneMessage.preferred
'
,
"
No preferred refactorings available
"
)
:
nls
.
localize
(
'
editor.action.refactor.noneMessage
'
,
"
No refactorings available
"
),
{
{
kind
:
CodeActionKind
.
Refactor
.
contains
(
args
.
kind
)
?
args
.
kind
:
CodeActionKind
.
None
,
kind
:
CodeActionKind
.
Refactor
.
contains
(
args
.
kind
)
?
args
.
kind
:
CodeActionKind
.
None
,
onlyIncludePreferredActions
:
args
.
preferred
,
onlyIncludePreferredActions
:
args
.
preferred
,
...
@@ -365,13 +378,19 @@ export class SourceAction extends EditorAction {
...
@@ -365,13 +378,19 @@ export class SourceAction extends EditorAction {
});
});
}
}
public
run
(
_accessor
:
ServicesAccessor
,
editor
:
ICodeEditor
,
userArg
:
any
):
void
{
public
run
(
_accessor
:
ServicesAccessor
,
editor
:
ICodeEditor
,
userArg
s
:
any
):
void
{
const
args
=
CodeActionCommandArgs
.
fromUser
(
userArg
,
{
const
args
=
CodeActionCommandArgs
.
fromUser
(
userArg
s
,
{
kind
:
CodeActionKind
.
Source
,
kind
:
CodeActionKind
.
Source
,
apply
:
CodeActionAutoApply
.
Never
apply
:
CodeActionAutoApply
.
Never
});
});
return
triggerCodeActionsForEditorSelection
(
editor
,
return
triggerCodeActionsForEditorSelection
(
editor
,
nls
.
localize
(
'
editor.action.source.noneMessage
'
,
"
No source actions available
"
),
typeof
userArgs
?.
kind
===
'
string
'
?
args
.
preferred
?
nls
.
localize
(
'
editor.action.source.noneMessage.preferred.kind
'
,
"
No preferred source actions for '{0}' available
"
,
userArgs
.
kind
)
:
nls
.
localize
(
'
editor.action.source.noneMessage.kind
'
,
"
No source actions for '{0}' available
"
,
userArgs
.
kind
)
:
args
.
preferred
?
nls
.
localize
(
'
editor.action.source.noneMessage.preferred
'
,
"
No preferred source actions available
"
)
:
nls
.
localize
(
'
editor.action.source.noneMessage
'
,
"
No source actions available
"
),
{
{
kind
:
CodeActionKind
.
Source
.
contains
(
args
.
kind
)
?
args
.
kind
:
CodeActionKind
.
None
,
kind
:
CodeActionKind
.
Source
.
contains
(
args
.
kind
)
?
args
.
kind
:
CodeActionKind
.
None
,
includeSourceActions
:
true
,
includeSourceActions
:
true
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录