Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
724b433e
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,发现更多精彩内容 >>
提交
724b433e
编写于
11月 21, 2019
作者:
J
Johannes Rieken
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
simplify how editor commands/actions register menu entries
上级
14928afa
变更
20
隐藏空白更改
内联
并排
Showing
20 changed file
with
116 addition
and
83 deletion
+116
-83
src/vs/editor/browser/controller/coreCommands.ts
src/vs/editor/browser/controller/coreCommands.ts
+3
-3
src/vs/editor/browser/editorExtensions.ts
src/vs/editor/browser/editorExtensions.ts
+72
-40
src/vs/editor/contrib/clipboard/clipboard.ts
src/vs/editor/contrib/clipboard/clipboard.ts
+6
-6
src/vs/editor/contrib/codeAction/codeActionCommands.ts
src/vs/editor/contrib/codeAction/codeActionCommands.ts
+2
-2
src/vs/editor/contrib/comment/comment.ts
src/vs/editor/contrib/comment/comment.ts
+2
-2
src/vs/editor/contrib/find/findController.ts
src/vs/editor/contrib/find/findController.ts
+2
-2
src/vs/editor/contrib/format/formatActions.ts
src/vs/editor/contrib/format/formatActions.ts
+2
-2
src/vs/editor/contrib/linesOperations/linesOperations.ts
src/vs/editor/contrib/linesOperations/linesOperations.ts
+5
-5
src/vs/editor/contrib/multicursor/multicursor.ts
src/vs/editor/contrib/multicursor/multicursor.ts
+7
-7
src/vs/editor/contrib/rename/rename.ts
src/vs/editor/contrib/rename/rename.ts
+1
-1
src/vs/editor/contrib/smartSelect/smartSelect.ts
src/vs/editor/contrib/smartSelect/smartSelect.ts
+2
-2
src/vs/editor/standalone/browser/quickOpen/quickCommand.ts
src/vs/editor/standalone/browser/quickOpen/quickCommand.ts
+1
-1
src/vs/editor/standalone/browser/quickOpen/quickOutline.ts
src/vs/editor/standalone/browser/quickOpen/quickOutline.ts
+1
-1
src/vs/platform/actions/common/actions.ts
src/vs/platform/actions/common/actions.ts
+1
-0
src/vs/workbench/contrib/callHierarchy/browser/callHierarchy.contribution.ts
...ntrib/callHierarchy/browser/callHierarchy.contribution.ts
+1
-1
src/vs/workbench/contrib/debug/browser/debugEditorActions.ts
src/vs/workbench/contrib/debug/browser/debugEditorActions.ts
+3
-3
src/vs/workbench/contrib/emmet/browser/actions/expandAbbreviation.ts
...bench/contrib/emmet/browser/actions/expandAbbreviation.ts
+1
-1
src/vs/workbench/contrib/emmet/browser/actions/showEmmetCommands.ts
...kbench/contrib/emmet/browser/actions/showEmmetCommands.ts
+1
-1
src/vs/workbench/contrib/format/browser/formatActionsMultiple.ts
...workbench/contrib/format/browser/formatActionsMultiple.ts
+2
-2
src/vs/workbench/contrib/quickopen/browser/commandsHandler.ts
...vs/workbench/contrib/quickopen/browser/commandsHandler.ts
+1
-1
未找到文件。
src/vs/editor/browser/controller/coreCommands.ts
浏览文件 @
724b433e
...
...
@@ -1753,7 +1753,7 @@ registerCommand(new EditorOrNativeTextInputCommand({
kbExpr
:
null
,
primary
:
KeyMod
.
CtrlCmd
|
KeyCode
.
KEY_A
},
menu
bar
Opts
:
{
menuOpts
:
{
menuId
:
MenuId
.
MenubarSelectionMenu
,
group
:
'
1_basic
'
,
title
:
nls
.
localize
({
key
:
'
miSelectAll
'
,
comment
:
[
'
&& denotes a mnemonic
'
]
},
"
&&Select All
"
),
...
...
@@ -1771,7 +1771,7 @@ registerCommand(new EditorOrNativeTextInputCommand({
kbExpr
:
EditorContextKeys
.
textInputFocus
,
primary
:
KeyMod
.
CtrlCmd
|
KeyCode
.
KEY_Z
},
menu
bar
Opts
:
{
menuOpts
:
{
menuId
:
MenuId
.
MenubarEditMenu
,
group
:
'
1_do
'
,
title
:
nls
.
localize
({
key
:
'
miUndo
'
,
comment
:
[
'
&& denotes a mnemonic
'
]
},
"
&&Undo
"
),
...
...
@@ -1792,7 +1792,7 @@ registerCommand(new EditorOrNativeTextInputCommand({
secondary
:
[
KeyMod
.
CtrlCmd
|
KeyMod
.
Shift
|
KeyCode
.
KEY_Z
],
mac
:
{
primary
:
KeyMod
.
CtrlCmd
|
KeyMod
.
Shift
|
KeyCode
.
KEY_Z
}
},
menu
bar
Opts
:
{
menuOpts
:
{
menuId
:
MenuId
.
MenubarEditMenu
,
group
:
'
1_do
'
,
title
:
nls
.
localize
({
key
:
'
miRedo
'
,
comment
:
[
'
&& denotes a mnemonic
'
]
},
"
&&Redo
"
),
...
...
src/vs/editor/browser/editorExtensions.ts
浏览文件 @
724b433e
...
...
@@ -42,10 +42,10 @@ export interface ICommandKeybindingsOptions extends IKeybindings {
kbExpr
?:
ContextKeyExpr
|
null
;
weight
:
number
;
}
export
interface
ICommandMenu
bar
Options
{
export
interface
ICommandMenuOptions
{
menuId
:
MenuId
;
group
:
string
;
order
:
number
;
group
?
:
string
;
order
?
:
number
;
when
?:
ContextKeyExpr
;
title
:
string
;
}
...
...
@@ -54,36 +54,29 @@ export interface ICommandOptions {
precondition
:
ContextKeyExpr
|
undefined
;
kbOpts
?:
ICommandKeybindingsOptions
;
description
?:
ICommandHandlerDescription
;
menu
barOpts
?:
ICommandMenubarOptions
;
menu
Opts
?:
ICommandMenuOptions
|
ICommandMenuOptions
[]
;
}
export
abstract
class
Command
{
public
readonly
id
:
string
;
public
readonly
precondition
:
ContextKeyExpr
|
undefined
;
private
readonly
_kbOpts
:
ICommandKeybindingsOptions
|
undefined
;
private
readonly
_menu
barOpts
:
ICommandMenubarOptions
|
undefined
;
private
readonly
_menu
Opts
:
ICommandMenuOptions
|
ICommandMenuOptions
[]
|
undefined
;
private
readonly
_description
:
ICommandHandlerDescription
|
undefined
;
constructor
(
opts
:
ICommandOptions
)
{
this
.
id
=
opts
.
id
;
this
.
precondition
=
opts
.
precondition
;
this
.
_kbOpts
=
opts
.
kbOpts
;
this
.
_menu
barOpts
=
opts
.
menubar
Opts
;
this
.
_menu
Opts
=
opts
.
menu
Opts
;
this
.
_description
=
opts
.
description
;
}
public
register
():
void
{
if
(
this
.
_menubarOpts
)
{
MenuRegistry
.
appendMenuItem
(
this
.
_menubarOpts
.
menuId
,
{
group
:
this
.
_menubarOpts
.
group
,
command
:
{
id
:
this
.
id
,
title
:
this
.
_menubarOpts
.
title
,
// precondition: this.precondition
},
when
:
this
.
_menubarOpts
.
when
,
order
:
this
.
_menubarOpts
.
order
});
if
(
Array
.
isArray
(
this
.
_menuOpts
))
{
this
.
_menuOpts
.
forEach
(
this
.
_registerMenuItem
,
this
);
}
else
if
(
this
.
_menuOpts
)
{
this
.
_registerMenuItem
(
this
.
_menuOpts
);
}
if
(
this
.
_kbOpts
)
{
...
...
@@ -119,6 +112,19 @@ export abstract class Command {
}
}
private
_registerMenuItem
(
item
:
ICommandMenuOptions
):
void
{
MenuRegistry
.
appendMenuItem
(
item
.
menuId
,
{
group
:
item
.
group
,
command
:
{
id
:
this
.
id
,
title
:
item
.
title
,
// precondition: this.precondition
},
when
:
item
.
when
,
order
:
item
.
order
});
}
public
abstract
runCommand
(
accessor
:
ServicesAccessor
,
args
:
any
):
void
|
Promise
<
void
>
;
}
...
...
@@ -184,44 +190,70 @@ export abstract class EditorCommand extends Command {
//#region EditorAction
export
interface
IEditor
Command
MenuOptions
{
export
interface
IEditor
ActionContext
MenuOptions
{
group
:
string
;
order
:
number
;
when
?:
ContextKeyExpr
;
}
export
interface
IActionOptions
extends
ICommandOptions
{
export
interface
IActionOptions
{
id
:
string
;
label
:
string
;
alias
:
string
;
menuOpts
?:
IEditorCommandMenuOptions
;
description
?:
ICommandHandlerDescription
;
precondition
:
ContextKeyExpr
|
undefined
;
kbOpts
?:
ICommandKeybindingsOptions
;
contextMenuOpts
?:
IEditorActionContextMenuOptions
;
menuOpts
?:
Partial
<
ICommandMenuOptions
>
|
Partial
<
ICommandMenuOptions
[]
>
;
}
export
abstract
class
EditorAction
extends
EditorCommand
{
private
static
convertOptions
(
opts
:
IActionOptions
):
ICommandOptions
{
function
patch
(
menu
:
Partial
<
ICommandMenuOptions
>
):
ICommandMenuOptions
{
if
(
!
menu
.
title
)
{
menu
.
title
=
opts
.
label
;
}
if
(
!
menu
.
menuId
)
{
menu
.
menuId
=
MenuId
.
EditorContext
;
}
if
(
!
menu
.
when
)
{
menu
.
when
=
opts
.
precondition
;
}
return
<
ICommandMenuOptions
>
menu
;
}
let
menuOpts
:
ICommandMenuOptions
[];
if
(
Array
.
isArray
(
opts
.
menuOpts
))
{
menuOpts
=
opts
.
menuOpts
.
map
(
m
=>
patch
(
m
!
));
}
else
if
(
opts
.
menuOpts
)
{
menuOpts
=
[
patch
(
opts
.
menuOpts
)];
}
else
{
menuOpts
=
[];
}
if
(
opts
.
contextMenuOpts
)
{
const
contextMenuItem
=
{
title
:
opts
.
label
,
when
:
ContextKeyExpr
.
and
(
opts
.
precondition
,
opts
.
contextMenuOpts
.
when
),
menuId
:
MenuId
.
EditorContext
,
group
:
opts
.
contextMenuOpts
.
group
,
order
:
opts
.
contextMenuOpts
.
order
};
menuOpts
.
push
(
contextMenuItem
);
}
opts
.
menuOpts
=
menuOpts
;
return
<
ICommandOptions
>
opts
;
}
public
readonly
label
:
string
;
public
readonly
alias
:
string
;
private
readonly
menuOpts
:
IEditorCommandMenuOptions
|
undefined
;
constructor
(
opts
:
IActionOptions
)
{
super
(
opts
);
super
(
EditorAction
.
convertOptions
(
opts
)
);
this
.
label
=
opts
.
label
;
this
.
alias
=
opts
.
alias
;
this
.
menuOpts
=
opts
.
menuOpts
;
}
public
register
():
void
{
if
(
this
.
menuOpts
)
{
MenuRegistry
.
appendMenuItem
(
MenuId
.
EditorContext
,
{
command
:
{
id
:
this
.
id
,
title
:
this
.
label
},
when
:
ContextKeyExpr
.
and
(
this
.
precondition
,
this
.
menuOpts
.
when
),
group
:
this
.
menuOpts
.
group
,
order
:
this
.
menuOpts
.
order
});
}
super
.
register
();
}
public
runEditorCommand
(
accessor
:
ServicesAccessor
,
editor
:
ICodeEditor
,
args
:
any
):
void
|
Promise
<
void
>
{
...
...
src/vs/editor/contrib/clipboard/clipboard.ts
浏览文件 @
724b433e
...
...
@@ -77,11 +77,11 @@ class ExecCommandCutAction extends ExecCommandAction {
alias
:
'
Cut
'
,
precondition
:
EditorContextKeys
.
writable
,
kbOpts
:
kbOpts
,
m
enuOpts
:
{
contextM
enuOpts
:
{
group
:
CLIPBOARD_CONTEXT_MENU_GROUP
,
order
:
1
},
menu
bar
Opts
:
{
menuOpts
:
{
menuId
:
MenuId
.
MenubarEditMenu
,
group
:
'
2_ccp
'
,
title
:
nls
.
localize
({
key
:
'
miCut
'
,
comment
:
[
'
&& denotes a mnemonic
'
]
},
"
Cu&&t
"
),
...
...
@@ -126,11 +126,11 @@ class ExecCommandCopyAction extends ExecCommandAction {
alias
:
'
Copy
'
,
precondition
:
undefined
,
kbOpts
:
kbOpts
,
m
enuOpts
:
{
contextM
enuOpts
:
{
group
:
CLIPBOARD_CONTEXT_MENU_GROUP
,
order
:
2
},
menu
bar
Opts
:
{
menuOpts
:
{
menuId
:
MenuId
.
MenubarEditMenu
,
group
:
'
2_ccp
'
,
title
:
nls
.
localize
({
key
:
'
miCopy
'
,
comment
:
[
'
&& denotes a mnemonic
'
]
},
"
&&Copy
"
),
...
...
@@ -175,11 +175,11 @@ class ExecCommandPasteAction extends ExecCommandAction {
alias
:
'
Paste
'
,
precondition
:
EditorContextKeys
.
writable
,
kbOpts
:
kbOpts
,
m
enuOpts
:
{
contextM
enuOpts
:
{
group
:
CLIPBOARD_CONTEXT_MENU_GROUP
,
order
:
3
},
menu
bar
Opts
:
{
menuOpts
:
{
menuId
:
MenuId
.
MenubarEditMenu
,
group
:
'
2_ccp
'
,
title
:
nls
.
localize
({
key
:
'
miPaste
'
,
comment
:
[
'
&& denotes a mnemonic
'
]
},
"
&&Paste
"
),
...
...
src/vs/editor/contrib/codeAction/codeActionCommands.ts
浏览文件 @
724b433e
...
...
@@ -265,7 +265,7 @@ export class RefactorAction extends EditorAction {
},
weight
:
KeybindingWeight
.
EditorContrib
},
m
enuOpts
:
{
contextM
enuOpts
:
{
group
:
'
1_modification
'
,
order
:
2
,
when
:
ContextKeyExpr
.
and
(
...
...
@@ -308,7 +308,7 @@ export class SourceAction extends EditorAction {
label
:
nls
.
localize
(
'
source.label
'
,
"
Source Action...
"
),
alias
:
'
Source Action...
'
,
precondition
:
ContextKeyExpr
.
and
(
EditorContextKeys
.
writable
,
EditorContextKeys
.
hasCodeActionsProvider
),
m
enuOpts
:
{
contextM
enuOpts
:
{
group
:
'
1_modification
'
,
order
:
2.1
,
when
:
ContextKeyExpr
.
and
(
...
...
src/vs/editor/contrib/comment/comment.ts
浏览文件 @
724b433e
...
...
@@ -56,7 +56,7 @@ class ToggleCommentLineAction extends CommentLineAction {
primary
:
KeyMod
.
CtrlCmd
|
KeyCode
.
US_SLASH
,
weight
:
KeybindingWeight
.
EditorContrib
},
menu
bar
Opts
:
{
menuOpts
:
{
menuId
:
MenuId
.
MenubarEditMenu
,
group
:
'
5_insert
'
,
title
:
nls
.
localize
({
key
:
'
miToggleLineComment
'
,
comment
:
[
'
&& denotes a mnemonic
'
]
},
"
&&Toggle Line Comment
"
),
...
...
@@ -112,7 +112,7 @@ class BlockCommentAction extends EditorAction {
linux
:
{
primary
:
KeyMod
.
CtrlCmd
|
KeyMod
.
Shift
|
KeyCode
.
KEY_A
},
weight
:
KeybindingWeight
.
EditorContrib
},
menu
bar
Opts
:
{
menuOpts
:
{
menuId
:
MenuId
.
MenubarEditMenu
,
group
:
'
5_insert
'
,
title
:
nls
.
localize
({
key
:
'
miToggleBlockComment
'
,
comment
:
[
'
&& denotes a mnemonic
'
]
},
"
Toggle &&Block Comment
"
),
...
...
src/vs/editor/contrib/find/findController.ts
浏览文件 @
724b433e
...
...
@@ -455,7 +455,7 @@ export class StartFindAction extends EditorAction {
primary
:
KeyMod
.
CtrlCmd
|
KeyCode
.
KEY_F
,
weight
:
KeybindingWeight
.
EditorContrib
},
menu
bar
Opts
:
{
menuOpts
:
{
menuId
:
MenuId
.
MenubarEditMenu
,
group
:
'
3_find
'
,
title
:
nls
.
localize
({
key
:
'
miFind
'
,
comment
:
[
'
&& denotes a mnemonic
'
]
},
"
&&Find
"
),
...
...
@@ -701,7 +701,7 @@ export class StartFindReplaceAction extends EditorAction {
mac
:
{
primary
:
KeyMod
.
CtrlCmd
|
KeyMod
.
Alt
|
KeyCode
.
KEY_F
},
weight
:
KeybindingWeight
.
EditorContrib
},
menu
bar
Opts
:
{
menuOpts
:
{
menuId
:
MenuId
.
MenubarEditMenu
,
group
:
'
3_find
'
,
title
:
nls
.
localize
({
key
:
'
miReplace
'
,
comment
:
[
'
&& denotes a mnemonic
'
]
},
"
&&Replace
"
),
...
...
src/vs/editor/contrib/format/formatActions.ts
浏览文件 @
724b433e
...
...
@@ -219,7 +219,7 @@ class FormatDocumentAction extends EditorAction {
linux
:
{
primary
:
KeyMod
.
CtrlCmd
|
KeyMod
.
Shift
|
KeyCode
.
KEY_I
},
weight
:
KeybindingWeight
.
EditorContrib
},
m
enuOpts
:
{
contextM
enuOpts
:
{
when
:
EditorContextKeys
.
hasDocumentFormattingProvider
,
group
:
'
1_modification
'
,
order
:
1.3
...
...
@@ -248,7 +248,7 @@ class FormatSelectionAction extends EditorAction {
primary
:
KeyChord
(
KeyMod
.
CtrlCmd
|
KeyCode
.
KEY_K
,
KeyMod
.
CtrlCmd
|
KeyCode
.
KEY_F
),
weight
:
KeybindingWeight
.
EditorContrib
},
m
enuOpts
:
{
contextM
enuOpts
:
{
when
:
ContextKeyExpr
.
and
(
EditorContextKeys
.
hasDocumentSelectionFormattingProvider
,
EditorContextKeys
.
hasNonEmptySelection
),
group
:
'
1_modification
'
,
order
:
1.31
...
...
src/vs/editor/contrib/linesOperations/linesOperations.ts
浏览文件 @
724b433e
...
...
@@ -64,7 +64,7 @@ class CopyLinesUpAction extends AbstractCopyLinesAction {
linux
:
{
primary
:
KeyMod
.
CtrlCmd
|
KeyMod
.
Alt
|
KeyMod
.
Shift
|
KeyCode
.
UpArrow
},
weight
:
KeybindingWeight
.
EditorContrib
},
menu
bar
Opts
:
{
menuOpts
:
{
menuId
:
MenuId
.
MenubarSelectionMenu
,
group
:
'
2_line
'
,
title
:
nls
.
localize
({
key
:
'
miCopyLinesUp
'
,
comment
:
[
'
&& denotes a mnemonic
'
]
},
"
&&Copy Line Up
"
),
...
...
@@ -87,7 +87,7 @@ class CopyLinesDownAction extends AbstractCopyLinesAction {
linux
:
{
primary
:
KeyMod
.
CtrlCmd
|
KeyMod
.
Alt
|
KeyMod
.
Shift
|
KeyCode
.
DownArrow
},
weight
:
KeybindingWeight
.
EditorContrib
},
menu
bar
Opts
:
{
menuOpts
:
{
menuId
:
MenuId
.
MenubarSelectionMenu
,
group
:
'
2_line
'
,
title
:
nls
.
localize
({
key
:
'
miCopyLinesDown
'
,
comment
:
[
'
&& denotes a mnemonic
'
]
},
"
Co&&py Line Down
"
),
...
...
@@ -105,7 +105,7 @@ export class DuplicateSelectionAction extends EditorAction {
label
:
nls
.
localize
(
'
duplicateSelection
'
,
"
Duplicate Selection
"
),
alias
:
'
Duplicate Selection
'
,
precondition
:
EditorContextKeys
.
writable
,
menu
bar
Opts
:
{
menuOpts
:
{
menuId
:
MenuId
.
MenubarSelectionMenu
,
group
:
'
2_line
'
,
title
:
nls
.
localize
({
key
:
'
miDuplicateSelection
'
,
comment
:
[
'
&& denotes a mnemonic
'
]
},
"
&&Duplicate Selection
"
),
...
...
@@ -178,7 +178,7 @@ class MoveLinesUpAction extends AbstractMoveLinesAction {
linux
:
{
primary
:
KeyMod
.
Alt
|
KeyCode
.
UpArrow
},
weight
:
KeybindingWeight
.
EditorContrib
},
menu
bar
Opts
:
{
menuOpts
:
{
menuId
:
MenuId
.
MenubarSelectionMenu
,
group
:
'
2_line
'
,
title
:
nls
.
localize
({
key
:
'
miMoveLinesUp
'
,
comment
:
[
'
&& denotes a mnemonic
'
]
},
"
Mo&&ve Line Up
"
),
...
...
@@ -201,7 +201,7 @@ class MoveLinesDownAction extends AbstractMoveLinesAction {
linux
:
{
primary
:
KeyMod
.
Alt
|
KeyCode
.
DownArrow
},
weight
:
KeybindingWeight
.
EditorContrib
},
menu
bar
Opts
:
{
menuOpts
:
{
menuId
:
MenuId
.
MenubarSelectionMenu
,
group
:
'
2_line
'
,
title
:
nls
.
localize
({
key
:
'
miMoveLinesDown
'
,
comment
:
[
'
&& denotes a mnemonic
'
]
},
"
Move &&Line Down
"
),
...
...
src/vs/editor/contrib/multicursor/multicursor.ts
浏览文件 @
724b433e
...
...
@@ -46,7 +46,7 @@ export class InsertCursorAbove extends EditorAction {
},
weight
:
KeybindingWeight
.
EditorContrib
},
menu
bar
Opts
:
{
menuOpts
:
{
menuId
:
MenuId
.
MenubarSelectionMenu
,
group
:
'
3_multi
'
,
title
:
nls
.
localize
({
key
:
'
miInsertCursorAbove
'
,
comment
:
[
'
&& denotes a mnemonic
'
]
},
"
&&Add Cursor Above
"
),
...
...
@@ -95,7 +95,7 @@ export class InsertCursorBelow extends EditorAction {
},
weight
:
KeybindingWeight
.
EditorContrib
},
menu
bar
Opts
:
{
menuOpts
:
{
menuId
:
MenuId
.
MenubarSelectionMenu
,
group
:
'
3_multi
'
,
title
:
nls
.
localize
({
key
:
'
miInsertCursorBelow
'
,
comment
:
[
'
&& denotes a mnemonic
'
]
},
"
A&&dd Cursor Below
"
),
...
...
@@ -140,7 +140,7 @@ class InsertCursorAtEndOfEachLineSelected extends EditorAction {
primary
:
KeyMod
.
Shift
|
KeyMod
.
Alt
|
KeyCode
.
KEY_I
,
weight
:
KeybindingWeight
.
EditorContrib
},
menu
bar
Opts
:
{
menuOpts
:
{
menuId
:
MenuId
.
MenubarSelectionMenu
,
group
:
'
3_multi
'
,
title
:
nls
.
localize
({
key
:
'
miInsertCursorAtEndOfEachLineSelected
'
,
comment
:
[
'
&& denotes a mnemonic
'
]
},
"
Add C&&ursors to Line Ends
"
),
...
...
@@ -662,7 +662,7 @@ export class AddSelectionToNextFindMatchAction extends MultiCursorSelectionContr
primary
:
KeyMod
.
CtrlCmd
|
KeyCode
.
KEY_D
,
weight
:
KeybindingWeight
.
EditorContrib
},
menu
bar
Opts
:
{
menuOpts
:
{
menuId
:
MenuId
.
MenubarSelectionMenu
,
group
:
'
3_multi
'
,
title
:
nls
.
localize
({
key
:
'
miAddSelectionToNextFindMatch
'
,
comment
:
[
'
&& denotes a mnemonic
'
]
},
"
Add &&Next Occurrence
"
),
...
...
@@ -682,7 +682,7 @@ export class AddSelectionToPreviousFindMatchAction extends MultiCursorSelectionC
label
:
nls
.
localize
(
'
addSelectionToPreviousFindMatch
'
,
"
Add Selection To Previous Find Match
"
),
alias
:
'
Add Selection To Previous Find Match
'
,
precondition
:
undefined
,
menu
bar
Opts
:
{
menuOpts
:
{
menuId
:
MenuId
.
MenubarSelectionMenu
,
group
:
'
3_multi
'
,
title
:
nls
.
localize
({
key
:
'
miAddSelectionToPreviousFindMatch
'
,
comment
:
[
'
&& denotes a mnemonic
'
]
},
"
Add P&&revious Occurrence
"
),
...
...
@@ -740,7 +740,7 @@ export class SelectHighlightsAction extends MultiCursorSelectionControllerAction
primary
:
KeyMod
.
CtrlCmd
|
KeyMod
.
Shift
|
KeyCode
.
KEY_L
,
weight
:
KeybindingWeight
.
EditorContrib
},
menu
bar
Opts
:
{
menuOpts
:
{
menuId
:
MenuId
.
MenubarSelectionMenu
,
group
:
'
3_multi
'
,
title
:
nls
.
localize
({
key
:
'
miSelectHighlights
'
,
comment
:
[
'
&& denotes a mnemonic
'
]
},
"
Select All &&Occurrences
"
),
...
...
@@ -765,7 +765,7 @@ export class CompatChangeAll extends MultiCursorSelectionControllerAction {
primary
:
KeyMod
.
CtrlCmd
|
KeyCode
.
F2
,
weight
:
KeybindingWeight
.
EditorContrib
},
m
enuOpts
:
{
contextM
enuOpts
:
{
group
:
'
1_modification
'
,
order
:
1.2
}
...
...
src/vs/editor/contrib/rename/rename.ts
浏览文件 @
724b433e
...
...
@@ -238,7 +238,7 @@ export class RenameAction extends EditorAction {
primary
:
KeyCode
.
F2
,
weight
:
KeybindingWeight
.
EditorContrib
},
m
enuOpts
:
{
contextM
enuOpts
:
{
group
:
'
1_modification
'
,
order
:
1.1
}
...
...
src/vs/editor/contrib/smartSelect/smartSelect.ts
浏览文件 @
724b433e
...
...
@@ -167,7 +167,7 @@ class GrowSelectionAction extends AbstractSmartSelect {
},
weight
:
KeybindingWeight
.
EditorContrib
},
menu
bar
Opts
:
{
menuOpts
:
{
menuId
:
MenuId
.
MenubarSelectionMenu
,
group
:
'
1_basic
'
,
title
:
nls
.
localize
({
key
:
'
miSmartSelectGrow
'
,
comment
:
[
'
&& denotes a mnemonic
'
]
},
"
&&Expand Selection
"
),
...
...
@@ -196,7 +196,7 @@ class ShrinkSelectionAction extends AbstractSmartSelect {
},
weight
:
KeybindingWeight
.
EditorContrib
},
menu
bar
Opts
:
{
menuOpts
:
{
menuId
:
MenuId
.
MenubarSelectionMenu
,
group
:
'
1_basic
'
,
title
:
nls
.
localize
({
key
:
'
miSmartSelectShrink
'
,
comment
:
[
'
&& denotes a mnemonic
'
]
},
"
&&Shrink Selection
"
),
...
...
src/vs/editor/standalone/browser/quickOpen/quickCommand.ts
浏览文件 @
724b433e
...
...
@@ -88,7 +88,7 @@ export class QuickCommandAction extends BaseEditorQuickOpenAction {
primary
:
(
browser
.
isIE
?
KeyMod
.
Alt
|
KeyCode
.
F1
:
KeyCode
.
F1
),
weight
:
KeybindingWeight
.
EditorContrib
},
m
enuOpts
:
{
contextM
enuOpts
:
{
group
:
'
z_commands
'
,
order
:
1
}
...
...
src/vs/editor/standalone/browser/quickOpen/quickOutline.ts
浏览文件 @
724b433e
...
...
@@ -121,7 +121,7 @@ export class QuickOutlineAction extends BaseEditorQuickOpenAction {
primary
:
KeyMod
.
CtrlCmd
|
KeyMod
.
Shift
|
KeyCode
.
KEY_O
,
weight
:
KeybindingWeight
.
EditorContrib
},
m
enuOpts
:
{
contextM
enuOpts
:
{
group
:
'
navigation
'
,
order
:
3
}
...
...
src/vs/platform/actions/common/actions.ts
浏览文件 @
724b433e
...
...
@@ -65,6 +65,7 @@ export const enum MenuId {
DebugWatchContext
,
DebugToolBar
,
EditorContext
,
EditorContextPeek
,
EditorTitle
,
EditorTitleContext
,
EmptyEditorGroupContext
,
...
...
src/vs/workbench/contrib/callHierarchy/browser/callHierarchy.contribution.ts
浏览文件 @
724b433e
...
...
@@ -160,7 +160,7 @@ registerEditorAction(class extends EditorAction {
id
:
'
editor.showCallHierarchy
'
,
label
:
localize
(
'
title
'
,
"
Peek Call Hierarchy
"
),
alias
:
'
Peek Call Hierarchy
'
,
m
enuOpts
:
{
contextM
enuOpts
:
{
group
:
'
navigation
'
,
order
:
1.48
},
...
...
src/vs/workbench/contrib/debug/browser/debugEditorActions.ts
浏览文件 @
724b433e
...
...
@@ -111,7 +111,7 @@ export class RunToCursorAction extends EditorAction {
label
:
RunToCursorAction
.
LABEL
,
alias
:
'
Debug: Run to Cursor
'
,
precondition
:
ContextKeyExpr
.
and
(
CONTEXT_IN_DEBUG_MODE
,
PanelFocusContext
.
toNegated
(),
CONTEXT_DEBUG_STATE
.
isEqualTo
(
'
stopped
'
),
EditorContextKeys
.
editorTextFocus
),
m
enuOpts
:
{
contextM
enuOpts
:
{
group
:
'
debug
'
,
order
:
2
}
...
...
@@ -160,7 +160,7 @@ class SelectionToReplAction extends EditorAction {
label
:
nls
.
localize
(
'
debugEvaluate
'
,
"
Debug: Evaluate
"
),
alias
:
'
Debug: Evaluate
'
,
precondition
:
ContextKeyExpr
.
and
(
EditorContextKeys
.
hasNonEmptySelection
,
CONTEXT_IN_DEBUG_MODE
,
EditorContextKeys
.
editorTextFocus
),
m
enuOpts
:
{
contextM
enuOpts
:
{
group
:
'
debug
'
,
order
:
0
}
...
...
@@ -190,7 +190,7 @@ class SelectionToWatchExpressionsAction extends EditorAction {
label
:
nls
.
localize
(
'
debugAddToWatch
'
,
"
Debug: Add to Watch
"
),
alias
:
'
Debug: Add to Watch
'
,
precondition
:
ContextKeyExpr
.
and
(
EditorContextKeys
.
hasNonEmptySelection
,
CONTEXT_IN_DEBUG_MODE
,
EditorContextKeys
.
editorTextFocus
),
m
enuOpts
:
{
contextM
enuOpts
:
{
group
:
'
debug
'
,
order
:
1
}
...
...
src/vs/workbench/contrib/emmet/browser/actions/expandAbbreviation.ts
浏览文件 @
724b433e
...
...
@@ -29,7 +29,7 @@ class ExpandAbbreviationAction extends EmmetEditorAction {
),
weight
:
KeybindingWeight
.
EditorContrib
},
menu
bar
Opts
:
{
menuOpts
:
{
menuId
:
MenuId
.
MenubarEditMenu
,
group
:
'
5_insert
'
,
title
:
nls
.
localize
({
key
:
'
miEmmetExpandAbbreviation
'
,
comment
:
[
'
&& denotes a mnemonic
'
]
},
"
Emmet: E&&xpand Abbreviation
"
),
...
...
src/vs/workbench/contrib/emmet/browser/actions/showEmmetCommands.ts
浏览文件 @
724b433e
...
...
@@ -21,7 +21,7 @@ class ShowEmmetCommandsAction extends EditorAction {
label
:
nls
.
localize
(
'
showEmmetCommands
'
,
"
Show Emmet Commands
"
),
alias
:
'
Show Emmet Commands
'
,
precondition
:
EditorContextKeys
.
writable
,
menu
bar
Opts
:
{
menuOpts
:
{
menuId
:
MenuId
.
MenubarEditMenu
,
group
:
'
5_insert
'
,
title
:
nls
.
localize
({
key
:
'
miShowEmmetCommands
'
,
comment
:
[
'
&& denotes a mnemonic
'
]
},
"
E&&mmet...
"
),
...
...
src/vs/workbench/contrib/format/browser/formatActionsMultiple.ts
浏览文件 @
724b433e
...
...
@@ -253,7 +253,7 @@ registerEditorAction(class FormatDocumentMultipleAction extends EditorAction {
label
:
nls
.
localize
(
'
formatDocument.label.multiple
'
,
"
Format Document With...
"
),
alias
:
'
Format Document...
'
,
precondition
:
ContextKeyExpr
.
and
(
EditorContextKeys
.
writable
,
EditorContextKeys
.
hasMultipleDocumentFormattingProvider
),
m
enuOpts
:
{
contextM
enuOpts
:
{
group
:
'
1_modification
'
,
order
:
1.3
}
...
...
@@ -284,7 +284,7 @@ registerEditorAction(class FormatSelectionMultipleAction extends EditorAction {
label
:
nls
.
localize
(
'
formatSelection.label.multiple
'
,
"
Format Selection With...
"
),
alias
:
'
Format Code...
'
,
precondition
:
ContextKeyExpr
.
and
(
ContextKeyExpr
.
and
(
EditorContextKeys
.
writable
),
EditorContextKeys
.
hasMultipleDocumentSelectionFormattingProvider
),
m
enuOpts
:
{
contextM
enuOpts
:
{
when
:
ContextKeyExpr
.
and
(
EditorContextKeys
.
hasNonEmptySelection
),
group
:
'
1_modification
'
,
order
:
1.31
...
...
src/vs/workbench/contrib/quickopen/browser/commandsHandler.ts
浏览文件 @
724b433e
...
...
@@ -214,7 +214,7 @@ class CommandPaletteEditorAction extends EditorAction {
label
:
localize
(
'
showCommands.label
'
,
"
Command Palette...
"
),
alias
:
'
Command Palette
'
,
precondition
:
undefined
,
m
enuOpts
:
{
contextM
enuOpts
:
{
group
:
'
z_commands
'
,
order
:
1
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录