Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
5b310033
V
vscode
项目概览
掘金者说
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
5b310033
编写于
7月 28, 2021
作者:
R
rebornix
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add setting to hide title on notebook toolbar.
上级
ca6eaaa1
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
40 addition
and
11 deletion
+40
-11
src/vs/workbench/contrib/notebook/browser/contrib/coreActions.ts
...workbench/contrib/notebook/browser/contrib/coreActions.ts
+3
-2
src/vs/workbench/contrib/notebook/browser/notebook.contribution.ts
...rkbench/contrib/notebook/browser/notebook.contribution.ts
+7
-1
src/vs/workbench/contrib/notebook/browser/notebookEditorToolbar.ts
...rkbench/contrib/notebook/browser/notebookEditorToolbar.ts
+29
-8
src/vs/workbench/contrib/notebook/common/notebookCommon.ts
src/vs/workbench/contrib/notebook/common/notebookCommon.ts
+1
-0
未找到文件。
src/vs/workbench/contrib/notebook/browser/contrib/coreActions.ts
浏览文件 @
5b310033
...
...
@@ -19,7 +19,7 @@ import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation
import
{
KeybindingWeight
}
from
'
vs/platform/keybinding/common/keybindingsRegistry
'
;
import
{
IQuickInputService
,
IQuickPickItem
,
QuickPickInput
}
from
'
vs/platform/quickinput/common/quickInput
'
;
import
{
BaseCellRenderTemplate
,
CellEditState
,
CellFocusMode
,
EXECUTE_CELL_COMMAND_ID
,
EXPAND_CELL_INPUT_COMMAND_ID
,
getNotebookEditorFromEditorPane
,
IActiveNotebookEditor
,
ICellViewModel
,
NOTEBOOK_CELL_EDITABLE
,
NOTEBOOK_CELL_HAS_OUTPUTS
,
NOTEBOOK_CELL_INPUT_COLLAPSED
,
NOTEBOOK_CELL_LIST_FOCUSED
,
NOTEBOOK_CELL_MARKDOWN_EDIT_MODE
,
NOTEBOOK_CELL_OUTPUT_COLLAPSED
,
NOTEBOOK_CELL_EXECUTION_STATE
,
NOTEBOOK_CELL_TYPE
,
NOTEBOOK_EDITOR_EDITABLE
,
NOTEBOOK_EDITOR_FOCUSED
,
NOTEBOOK_IS_ACTIVE_EDITOR
,
NOTEBOOK_KERNEL_COUNT
,
NOTEBOOK_INTERRUPTIBLE_KERNEL
,
NOTEBOOK_HAS_RUNNING_CELL
,
CHANGE_CELL_LANGUAGE
,
QUIT_EDIT_CELL_COMMAND_ID
,
NOTEBOOK_USE_CONSOLIDATED_OUTPUT_BUTTON
,
NOTEBOOK_HAS_OUTPUTS
,
NOTEBOOK_CELL_EXECUTING
,
NOTEBOOK_MISSING_KERNEL_EXTENSION
}
from
'
vs/workbench/contrib/notebook/browser/notebookBrowser
'
;
import
{
CellEditType
,
CellKind
,
ICellEditOperation
,
isDocumentExcludePattern
,
NotebookCellMetadata
,
NotebookCellExecutionState
,
TransientCellMetadata
,
TransientDocumentMetadata
,
SelectionStateType
,
ICellReplaceEdit
}
from
'
vs/workbench/contrib/notebook/common/notebookCommon
'
;
import
{
CellEditType
,
CellKind
,
ICellEditOperation
,
isDocumentExcludePattern
,
NotebookCellMetadata
,
NotebookCellExecutionState
,
TransientCellMetadata
,
TransientDocumentMetadata
,
SelectionStateType
,
ICellReplaceEdit
,
GlobalToolbarShowLabel
}
from
'
vs/workbench/contrib/notebook/common/notebookCommon
'
;
import
{
ICellRange
,
isICellRange
}
from
'
vs/workbench/contrib/notebook/common/notebookRange
'
;
import
{
INotebookService
}
from
'
vs/workbench/contrib/notebook/common/notebookService
'
;
import
{
IEditorGroupsService
}
from
'
vs/workbench/services/editor/common/editorGroupsService
'
;
...
...
@@ -1163,7 +1163,8 @@ MenuRegistry.appendMenuItem(MenuId.NotebookToolbar, {
when
:
ContextKeyExpr
.
and
(
NOTEBOOK_EDITOR_EDITABLE
.
isEqualTo
(
true
),
ContextKeyExpr
.
notEquals
(
'
config.notebook.insertToolbarLocation
'
,
'
betweenCells
'
),
ContextKeyExpr
.
notEquals
(
'
config.notebook.insertToolbarLocation
'
,
'
hidden
'
)
ContextKeyExpr
.
notEquals
(
'
config.notebook.insertToolbarLocation
'
,
'
hidden
'
),
ContextKeyExpr
.
notEquals
(
`config.
${
GlobalToolbarShowLabel
}
`
,
false
),
)
});
...
...
src/vs/workbench/contrib/notebook/browser/notebook.contribution.ts
浏览文件 @
5b310033
...
...
@@ -30,7 +30,7 @@ import { NotebookEditor } from 'vs/workbench/contrib/notebook/browser/notebookEd
import
{
isCompositeNotebookEditorInput
,
NotebookEditorInput
,
NotebookEditorInputOptions
}
from
'
vs/workbench/contrib/notebook/common/notebookEditorInput
'
;
import
{
INotebookService
}
from
'
vs/workbench/contrib/notebook/common/notebookService
'
;
import
{
NotebookService
}
from
'
vs/workbench/contrib/notebook/browser/notebookServiceImpl
'
;
import
{
CellKind
,
CellToolbarLocation
,
CellToolbarVisibility
,
CellUri
,
DisplayOrderKey
,
UndoRedoPerCell
,
IResolvedNotebookEditorModel
,
NotebookDocumentBackupData
,
NotebookTextDiffEditorPreview
,
NotebookWorkingCopyTypeIdentifier
,
ShowCellStatusBar
,
CompactView
,
FocusIndicator
,
InsertToolbarLocation
,
GlobalToolbar
,
ConsolidatedOutputButton
,
ShowFoldingControls
,
DragAndDropEnabled
,
NotebookCellEditorOptionsCustomizations
,
ConsolidatedRunButton
,
TextOutputLineLimit
}
from
'
vs/workbench/contrib/notebook/common/notebookCommon
'
;
import
{
CellKind
,
CellToolbarLocation
,
CellToolbarVisibility
,
CellUri
,
DisplayOrderKey
,
UndoRedoPerCell
,
IResolvedNotebookEditorModel
,
NotebookDocumentBackupData
,
NotebookTextDiffEditorPreview
,
NotebookWorkingCopyTypeIdentifier
,
ShowCellStatusBar
,
CompactView
,
FocusIndicator
,
InsertToolbarLocation
,
GlobalToolbar
,
ConsolidatedOutputButton
,
ShowFoldingControls
,
DragAndDropEnabled
,
NotebookCellEditorOptionsCustomizations
,
ConsolidatedRunButton
,
TextOutputLineLimit
,
GlobalToolbarShowLabel
}
from
'
vs/workbench/contrib/notebook/common/notebookCommon
'
;
import
{
IEditorService
}
from
'
vs/workbench/services/editor/common/editorService
'
;
import
{
IUndoRedoService
}
from
'
vs/platform/undoRedo/common/undoRedo
'
;
import
{
INotebookEditorModelResolverService
}
from
'
vs/workbench/contrib/notebook/common/notebookEditorModelResolverService
'
;
...
...
@@ -732,6 +732,12 @@ configurationRegistry.registerConfiguration({
default
:
false
,
tags
:
[
'
notebookLayout
'
]
},
[
GlobalToolbarShowLabel
]:
{
description
:
nls
.
localize
(
'
notebook.globalToolbarShowLabel
'
,
"
Control whether the actions on the notebook toolbar should render label or not.
"
),
type
:
'
boolean
'
,
default
:
true
,
tags
:
[
'
notebookLayout
'
]
},
[
TextOutputLineLimit
]:
{
description
:
nls
.
localize
(
'
notebook.textOutputLineLimit
'
,
"
Control how many lines of text in a text output is rendered.
"
),
type
:
'
number
'
,
...
...
src/vs/workbench/contrib/notebook/browser/notebookEditorToolbar.ts
浏览文件 @
5b310033
...
...
@@ -10,6 +10,7 @@ import { IAction, Separator } from 'vs/base/common/actions';
import
{
Emitter
,
Event
}
from
'
vs/base/common/event
'
;
import
{
Disposable
,
IDisposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
ScrollbarVisibility
}
from
'
vs/base/common/scrollable
'
;
import
{
MenuEntryActionViewItem
}
from
'
vs/platform/actions/browser/menuEntryActionViewItem
'
;
import
{
IMenu
,
IMenuService
,
MenuItemAction
,
SubmenuItemAction
}
from
'
vs/platform/actions/common/actions
'
;
import
{
IConfigurationService
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
IContextKeyService
}
from
'
vs/platform/contextkey/common/contextkey
'
;
...
...
@@ -22,7 +23,7 @@ import { SELECT_KERNEL_ID } from 'vs/workbench/contrib/notebook/browser/contrib/
import
{
INotebookEditor
,
NOTEBOOK_EDITOR_ID
}
from
'
vs/workbench/contrib/notebook/browser/notebookBrowser
'
;
import
{
NotebooKernelActionViewItem
}
from
'
vs/workbench/contrib/notebook/browser/notebookKernelActionViewItem
'
;
import
{
ActionViewWithLabel
}
from
'
vs/workbench/contrib/notebook/browser/view/renderers/cellActionView
'
;
import
{
GlobalToolbar
}
from
'
vs/workbench/contrib/notebook/common/notebookCommon
'
;
import
{
GlobalToolbar
,
GlobalToolbarShowLabel
}
from
'
vs/workbench/contrib/notebook/common/notebookCommon
'
;
import
{
IEditorService
}
from
'
vs/workbench/services/editor/common/editorService
'
;
import
{
ITASExperimentService
}
from
'
vs/workbench/services/experiment/common/experimentService
'
;
...
...
@@ -44,6 +45,7 @@ export class NotebookEditorToolbar extends Disposable {
private
_secondaryActions
:
IAction
[];
private
_notebookRightToolbar
!
:
ToolBar
;
private
_useGlobalToolbar
:
boolean
=
false
;
private
_renderLabel
:
boolean
=
true
;
private
readonly
_onDidChangeState
=
this
.
_register
(
new
Emitter
<
void
>
());
onDidChangeState
:
Event
<
void
>
=
this
.
_onDidChangeState
.
event
;
...
...
@@ -110,12 +112,7 @@ export class NotebookEditorToolbar extends Disposable {
this
.
_register
(
this
.
_notebookGlobalActionsMenu
);
this
.
_useGlobalToolbar
=
this
.
configurationService
.
getValue
<
boolean
|
undefined
>
(
GlobalToolbar
)
??
false
;
this
.
_register
(
this
.
configurationService
.
onDidChangeConfiguration
(
e
=>
{
if
(
e
.
affectsConfiguration
(
GlobalToolbar
))
{
this
.
_useGlobalToolbar
=
this
.
configurationService
.
getValue
<
boolean
>
(
GlobalToolbar
);
this
.
_showNotebookActionsinEditorToolbar
();
}
}));
this
.
_renderLabel
=
this
.
configurationService
.
getValue
<
boolean
>
(
GlobalToolbarShowLabel
);
const
context
=
{
ui
:
true
,
...
...
@@ -128,7 +125,11 @@ export class NotebookEditorToolbar extends Disposable {
return
this
.
instantiationService
.
createInstance
(
NotebooKernelActionViewItem
,
action
,
this
.
notebookEditor
);
}
return
action
instanceof
MenuItemAction
?
this
.
instantiationService
.
createInstance
(
ActionViewWithLabel
,
action
)
:
undefined
;
if
(
this
.
_renderLabel
)
{
return
action
instanceof
MenuItemAction
?
this
.
instantiationService
.
createInstance
(
ActionViewWithLabel
,
action
)
:
undefined
;
}
else
{
return
action
instanceof
MenuItemAction
?
this
.
instantiationService
.
createInstance
(
MenuEntryActionViewItem
,
action
,
undefined
)
:
undefined
;
}
};
this
.
_notebookLeftToolbar
=
new
ToolBar
(
this
.
_notebookTopLeftToolbarContainer
,
this
.
contextMenuService
,
{
...
...
@@ -152,6 +153,26 @@ export class NotebookEditorToolbar extends Disposable {
this
.
_showNotebookActionsinEditorToolbar
();
}));
this
.
_register
(
this
.
configurationService
.
onDidChangeConfiguration
(
e
=>
{
if
(
e
.
affectsConfiguration
(
GlobalToolbarShowLabel
))
{
this
.
_renderLabel
=
this
.
configurationService
.
getValue
<
boolean
>
(
GlobalToolbarShowLabel
);
this
.
_notebookLeftToolbar
.
dispose
();
this
.
_notebookLeftToolbar
=
new
ToolBar
(
this
.
_notebookTopLeftToolbarContainer
,
this
.
contextMenuService
,
{
getKeyBinding
:
action
=>
this
.
keybindingService
.
lookupKeybinding
(
action
.
id
),
actionViewItemProvider
:
actionProvider
,
renderDropdownAsChildElement
:
true
});
this
.
_register
(
this
.
_notebookLeftToolbar
);
this
.
_notebookLeftToolbar
.
context
=
context
;
return
;
}
if
(
e
.
affectsConfiguration
(
GlobalToolbar
))
{
this
.
_useGlobalToolbar
=
this
.
configurationService
.
getValue
<
boolean
>
(
GlobalToolbar
);
this
.
_showNotebookActionsinEditorToolbar
();
}
}));
if
(
this
.
experimentService
)
{
this
.
experimentService
.
getTreatment
<
boolean
>
(
'
nbtoolbarineditor
'
).
then
(
treatment
=>
{
if
(
treatment
===
undefined
)
{
...
...
src/vs/workbench/contrib/notebook/common/notebookCommon.ts
浏览文件 @
5b310033
...
...
@@ -851,6 +851,7 @@ export const NotebookCellEditorOptionsCustomizations = 'notebook.editorOptionsCu
export
const
ConsolidatedRunButton
=
'
notebook.consolidatedRunButton
'
;
export
const
OpenGettingStarted
=
'
notebook.experimental.openGettingStarted
'
;
export
const
TextOutputLineLimit
=
'
notebook.output.textLineLimit
'
;
export
const
GlobalToolbarShowLabel
=
'
notebook.globalToolbarShowLabel
'
;
export
const
enum
CellStatusbarAlignment
{
Left
=
1
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录