Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
2c5cae38
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,发现更多精彩内容 >>
提交
2c5cae38
编写于
8月 12, 2020
作者:
R
Rob Lourens
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add "insert cell" submenu
上级
fe4d4f7d
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
40 addition
and
10 deletion
+40
-10
src/vs/platform/actions/common/actions.ts
src/vs/platform/actions/common/actions.ts
+1
-0
src/vs/workbench/contrib/notebook/browser/contrib/coreActions.ts
...workbench/contrib/notebook/browser/contrib/coreActions.ts
+39
-10
未找到文件。
src/vs/platform/actions/common/actions.ts
浏览文件 @
2c5cae38
...
...
@@ -120,6 +120,7 @@ export class MenuId {
static
readonly
CommentTitle
=
new
MenuId
(
'
CommentTitle
'
);
static
readonly
CommentActions
=
new
MenuId
(
'
CommentActions
'
);
static
readonly
NotebookCellTitle
=
new
MenuId
(
'
NotebookCellTitle
'
);
static
readonly
NotebookCellInsert
=
new
MenuId
(
'
NotebookCellInsert
'
);
static
readonly
NotebookCellBetween
=
new
MenuId
(
'
NotebookCellBetween
'
);
static
readonly
BulkEditTitle
=
new
MenuId
(
'
BulkEditTitle
'
);
static
readonly
BulkEditContext
=
new
MenuId
(
'
BulkEditContext
'
);
...
...
src/vs/workbench/contrib/notebook/browser/contrib/coreActions.ts
浏览文件 @
2c5cae38
...
...
@@ -89,6 +89,13 @@ const enum CellToolbarOrder {
DeleteCell
}
const
enum
CellOverflowToolbarGroups
{
Copy
=
'
1_copy
'
,
Insert
=
'
2_insert
'
,
Edit
=
'
3_edit
'
,
Collapse
=
'
4_collapse
'
,
}
export
interface
INotebookActionContext
{
readonly
cellTemplate
?:
BaseCellRenderTemplate
;
readonly
cell
?:
ICellViewModel
;
...
...
@@ -373,6 +380,12 @@ registerAction2(class extends NotebookAction {
}
});
MenuRegistry
.
appendMenuItem
(
MenuId
.
NotebookCellTitle
,
{
submenu
:
MenuId
.
NotebookCellInsert
,
title
:
localize
(
'
notebookMenu.insertCell
'
,
"
Insert Cell
"
),
group
:
CellOverflowToolbarGroups
.
Insert
});
MenuRegistry
.
appendMenuItem
(
MenuId
.
EditorTitle
,
{
command
:
{
id
:
EXECUTE_NOTEBOOK_COMMAND_ID
,
...
...
@@ -409,7 +422,7 @@ registerAction2(class extends NotebookCellAction {
menu
:
{
id
:
MenuId
.
NotebookCellTitle
,
when
:
ContextKeyExpr
.
and
(
NOTEBOOK_EDITOR_FOCUSED
,
NOTEBOOK_EDITOR_EDITABLE
,
NOTEBOOK_CELL_EDITABLE
,
NOTEBOOK_CELL_TYPE
.
isEqualTo
(
'
markdown
'
)),
group
:
'
2_edit
'
,
group
:
CellOverflowToolbarGroups
.
Edit
,
}
});
}
...
...
@@ -433,7 +446,7 @@ registerAction2(class extends NotebookCellAction {
menu
:
{
id
:
MenuId
.
NotebookCellTitle
,
when
:
ContextKeyExpr
.
and
(
NOTEBOOK_EDITOR_FOCUSED
,
NOTEBOOK_EDITOR_EDITABLE
,
NOTEBOOK_CELL_EDITABLE
,
NOTEBOOK_CELL_TYPE
.
isEqualTo
(
'
code
'
)),
group
:
'
2_edit
'
,
group
:
CellOverflowToolbarGroups
.
Edit
,
}
});
}
...
...
@@ -526,6 +539,10 @@ registerAction2(class extends InsertCellCommand {
when
:
ContextKeyExpr
.
and
(
NOTEBOOK_CELL_LIST_FOCUSED
,
InputFocusedContext
.
toNegated
()),
weight
:
KeybindingWeight
.
WorkbenchContrib
},
menu
:
{
id
:
MenuId
.
NotebookCellInsert
,
order
:
0
}
},
CellKind
.
Code
,
'
above
'
);
...
...
@@ -543,6 +560,10 @@ registerAction2(class extends InsertCellCommand {
when
:
ContextKeyExpr
.
and
(
NOTEBOOK_CELL_LIST_FOCUSED
,
InputFocusedContext
.
toNegated
()),
weight
:
KeybindingWeight
.
WorkbenchContrib
},
menu
:
{
id
:
MenuId
.
NotebookCellInsert
,
order
:
1
}
},
CellKind
.
Code
,
'
below
'
);
...
...
@@ -565,6 +586,10 @@ registerAction2(class extends InsertCellCommand {
{
id
:
INSERT_MARKDOWN_CELL_ABOVE_COMMAND_ID
,
title
:
localize
(
'
notebookActions.insertMarkdownCellAbove
'
,
"
Insert Markdown Cell Above
"
),
menu
:
{
id
:
MenuId
.
NotebookCellInsert
,
order
:
2
}
},
CellKind
.
Markdown
,
'
above
'
);
...
...
@@ -577,6 +602,10 @@ registerAction2(class extends InsertCellCommand {
{
id
:
INSERT_MARKDOWN_CELL_BELOW_COMMAND_ID
,
title
:
localize
(
'
notebookActions.insertMarkdownCellBelow
'
,
"
Insert Markdown Cell Below
"
),
menu
:
{
id
:
MenuId
.
NotebookCellInsert
,
order
:
3
}
},
CellKind
.
Markdown
,
'
below
'
);
...
...
@@ -766,7 +795,7 @@ registerAction2(class extends NotebookCellAction {
menu
:
{
id
:
MenuId
.
NotebookCellTitle
,
when
:
NOTEBOOK_EDITOR_FOCUSED
,
group
:
'
1_copy
'
,
group
:
CellOverflowToolbarGroups
.
Copy
,
}
});
}
...
...
@@ -788,7 +817,7 @@ registerAction2(class extends NotebookCellAction {
menu
:
{
id
:
MenuId
.
NotebookCellTitle
,
when
:
ContextKeyExpr
.
and
(
NOTEBOOK_EDITOR_FOCUSED
,
NOTEBOOK_EDITOR_EDITABLE
,
NOTEBOOK_CELL_EDITABLE
),
group
:
'
1_copy
'
,
group
:
CellOverflowToolbarGroups
.
Copy
,
}
});
}
...
...
@@ -817,7 +846,7 @@ registerAction2(class extends NotebookAction {
menu
:
{
id
:
MenuId
.
NotebookCellTitle
,
when
:
ContextKeyExpr
.
and
(
NOTEBOOK_EDITOR_FOCUSED
,
NOTEBOOK_EDITOR_EDITABLE
),
group
:
'
1_copy
'
,
group
:
CellOverflowToolbarGroups
.
Copy
,
}
});
}
...
...
@@ -1375,7 +1404,7 @@ registerAction2(class extends NotebookCellAction {
menu
:
{
id
:
MenuId
.
NotebookCellTitle
,
when
:
ContextKeyExpr
.
and
(
NOTEBOOK_EDITOR_FOCUSED
,
NOTEBOOK_EDITOR_EDITABLE
,
NOTEBOOK_CELL_EDITABLE
),
group
:
'
2_edit
'
,
group
:
CellOverflowToolbarGroups
.
Edit
,
}
});
}
...
...
@@ -1419,7 +1448,7 @@ registerAction2(class extends NotebookCellAction {
menu
:
{
id
:
MenuId
.
NotebookCellTitle
,
when
:
ContextKeyExpr
.
and
(
NOTEBOOK_CELL_LIST_FOCUSED
,
NOTEBOOK_CELL_INPUT_COLLAPSED
.
toNegated
()),
group
:
'
3_collapse
'
,
group
:
CellOverflowToolbarGroups
.
Collapse
,
}
});
}
...
...
@@ -1442,7 +1471,7 @@ registerAction2(class extends NotebookCellAction {
menu
:
{
id
:
MenuId
.
NotebookCellTitle
,
when
:
ContextKeyExpr
.
and
(
NOTEBOOK_CELL_LIST_FOCUSED
,
NOTEBOOK_CELL_INPUT_COLLAPSED
),
group
:
'
3_collapse
'
,
group
:
CellOverflowToolbarGroups
.
Collapse
,
}
});
}
...
...
@@ -1465,7 +1494,7 @@ registerAction2(class extends NotebookCellAction {
menu
:
{
id
:
MenuId
.
NotebookCellTitle
,
when
:
ContextKeyExpr
.
and
(
NOTEBOOK_CELL_LIST_FOCUSED
,
NOTEBOOK_CELL_OUTPUT_COLLAPSED
.
toNegated
(),
NOTEBOOK_CELL_HAS_OUTPUTS
),
group
:
'
3_collapse
'
,
group
:
CellOverflowToolbarGroups
.
Collapse
,
}
});
}
...
...
@@ -1488,7 +1517,7 @@ registerAction2(class extends NotebookCellAction {
menu
:
{
id
:
MenuId
.
NotebookCellTitle
,
when
:
ContextKeyExpr
.
and
(
NOTEBOOK_CELL_LIST_FOCUSED
,
NOTEBOOK_CELL_OUTPUT_COLLAPSED
),
group
:
'
3_collapse
'
,
group
:
CellOverflowToolbarGroups
.
Collapse
,
}
});
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录