Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
ce90579f
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,发现更多精彩内容 >>
提交
ce90579f
编写于
3月 27, 2020
作者:
R
rebornix
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Use the right constant.
上级
3bcc2f60
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
13 addition
and
10 deletion
+13
-10
src/vs/workbench/contrib/notebook/browser/constants.ts
src/vs/workbench/contrib/notebook/browser/constants.ts
+6
-1
src/vs/workbench/contrib/notebook/browser/view/renderers/cellRenderer.ts
...h/contrib/notebook/browser/view/renderers/cellRenderer.ts
+3
-3
src/vs/workbench/contrib/notebook/browser/viewModel/baseCellViewModel.ts
...h/contrib/notebook/browser/viewModel/baseCellViewModel.ts
+2
-2
src/vs/workbench/contrib/notebook/browser/viewModel/codeCellViewModel.ts
...h/contrib/notebook/browser/viewModel/codeCellViewModel.ts
+2
-4
未找到文件。
src/vs/workbench/contrib/notebook/browser/constants.ts
浏览文件 @
ce90579f
...
...
@@ -22,10 +22,15 @@ export const EXECUTE_CELL_COMMAND_ID = 'workbench.notebook.cell.execute';
// Cell sizing related
export
const
CELL_MARGIN
=
20
;
export
const
CELL_RUN_GUTTER
=
32
;
// TODO should be dynamic based on execution order width, and runnable enablement
export
const
EDITOR_TOOLBAR_HEIGHT
=
22
;
// Top margin of editor
export
const
EDITOR_TOP_MARGIN
=
8
;
// Top and bottom padding inside the monaco editor in a cell, which are included in `cell.editorHeight`
export
const
EDITOR_TOP_PADDING
=
8
;
export
const
EDITOR_BOTTOM_PADDING
=
8
;
export
const
EDITOR_TOOLBAR_HEIGHT
=
22
;
// Cell context keys
export
const
NOTEBOOK_CELL_TYPE_CONTEXT_KEY
=
'
notebookCellType
'
;
// code, markdown
...
...
src/vs/workbench/contrib/notebook/browser/view/renderers/cellRenderer.ts
浏览文件 @
ce90579f
...
...
@@ -24,7 +24,7 @@ import { IContextMenuService } from 'vs/platform/contextview/browser/contextView
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
IKeybindingService
}
from
'
vs/platform/keybinding/common/keybinding
'
;
import
{
INotificationService
}
from
'
vs/platform/notification/common/notification
'
;
import
{
EDITOR_BOTTOM_PADDING
,
EDITOR_TOOLBAR_HEIGHT
,
EDITOR_TOP_PADDING
,
NOTEBOOK_CELL_EDITABLE_CONTEXT_KEY
,
NOTEBOOK_CELL_MARKDOWN_EDIT_MODE_CONTEXT_KEY
,
NOTEBOOK_CELL_TYPE_CONTEXT_KEY
}
from
'
vs/workbench/contrib/notebook/browser/constants
'
;
import
{
EDITOR_BOTTOM_PADDING
,
EDITOR_TOOLBAR_HEIGHT
,
EDITOR_TOP_PADDING
,
NOTEBOOK_CELL_EDITABLE_CONTEXT_KEY
,
NOTEBOOK_CELL_MARKDOWN_EDIT_MODE_CONTEXT_KEY
,
NOTEBOOK_CELL_TYPE_CONTEXT_KEY
,
EDITOR_TOP_MARGIN
}
from
'
vs/workbench/contrib/notebook/browser/constants
'
;
import
{
ExecuteCellAction
,
INotebookCellActionContext
}
from
'
vs/workbench/contrib/notebook/browser/contrib/notebookActions
'
;
import
{
CellEditState
,
CellRenderTemplate
,
CellRunState
,
ICellViewModel
,
INotebookEditor
}
from
'
vs/workbench/contrib/notebook/browser/notebookBrowser
'
;
import
{
CellMenus
}
from
'
vs/workbench/contrib/notebook/browser/view/renderers/cellMenus
'
;
...
...
@@ -142,9 +142,9 @@ abstract class AbstractCellRenderer {
if
(
templateData
.
focusIndicator
)
{
if
(
actions
.
length
)
{
templateData
.
focusIndicator
.
style
.
top
=
`
${
EDITOR_TOOLBAR_HEIGHT
+
EDITOR_TOP_
PADDING
}
px`
;
templateData
.
focusIndicator
.
style
.
top
=
`
${
EDITOR_TOOLBAR_HEIGHT
+
EDITOR_TOP_
MARGIN
}
px`
;
}
else
{
templateData
.
focusIndicator
.
style
.
top
=
`
${
EDITOR_TOP_
PADDING
}
px`
;
templateData
.
focusIndicator
.
style
.
top
=
`
${
EDITOR_TOP_
MARGIN
}
px`
;
}
}
};
...
...
src/vs/workbench/contrib/notebook/browser/viewModel/baseCellViewModel.ts
浏览文件 @
ce90579f
...
...
@@ -11,7 +11,7 @@ import * as model from 'vs/editor/common/model';
import
{
Range
}
from
'
vs/editor/common/core/range
'
;
import
{
ICell
,
NotebookCellMetadata
,
NotebookDocumentMetadata
}
from
'
vs/workbench/contrib/notebook/common/notebookCommon
'
;
import
{
CursorAtBoundary
,
CellFocusMode
,
CellEditState
,
CellRunState
}
from
'
vs/workbench/contrib/notebook/browser/notebookBrowser
'
;
import
{
EDITOR_TO
P_PADDING
,
EDITOR_TOOLBAR_HEIGHT
}
from
'
vs/workbench/contrib/notebook/browser/constants
'
;
import
{
EDITOR_TO
OLBAR_HEIGHT
,
EDITOR_TOP_MARGIN
}
from
'
vs/workbench/contrib/notebook/browser/constants
'
;
import
{
SearchParams
}
from
'
vs/editor/common/model/textModelSearch
'
;
export
const
NotebookCellMetadataDefaults
=
{
...
...
@@ -259,7 +259,7 @@ export abstract class BaseCellViewModel extends Disposable {
return
0
;
}
return
this
.
_textEditor
.
getTopForLineNumber
(
line
)
+
EDITOR_TOP_
PADDING
+
EDITOR_TOOLBAR_HEIGHT
;
return
this
.
_textEditor
.
getTopForLineNumber
(
line
)
+
EDITOR_TOP_
MARGIN
+
EDITOR_TOOLBAR_HEIGHT
;
}
cursorAtBoundary
():
CursorAtBoundary
{
...
...
src/vs/workbench/contrib/notebook/browser/viewModel/codeCellViewModel.ts
浏览文件 @
ce90579f
...
...
@@ -8,7 +8,7 @@ import * as UUID from 'vs/base/common/uuid';
import
*
as
model
from
'
vs/editor/common/model
'
;
import
{
ITextModelService
}
from
'
vs/editor/common/services/resolverService
'
;
import
{
PrefixSumComputer
}
from
'
vs/editor/common/viewModel/prefixSumComputer
'
;
import
{
EDITOR_BOTTOM_PADDING
,
EDITOR_TOOLBAR_HEIGHT
,
EDITOR_TOP_PADDING
,
CELL_MARGIN
,
CELL_RUN_GUTTER
}
from
'
vs/workbench/contrib/notebook/browser/constants
'
;
import
{
EDITOR_BOTTOM_PADDING
,
EDITOR_TOOLBAR_HEIGHT
,
EDITOR_TOP_PADDING
,
CELL_MARGIN
,
CELL_RUN_GUTTER
,
EDITOR_TOP_MARGIN
}
from
'
vs/workbench/contrib/notebook/browser/constants
'
;
import
{
CellEditState
,
ICellViewModel
,
CellFindMatch
,
CodeCellLayoutChangeEvent
,
CodeCellLayoutInfo
,
NotebookLayoutInfo
}
from
'
vs/workbench/contrib/notebook/browser/notebookBrowser
'
;
import
{
CellKind
,
ICell
,
NotebookCellOutputsSplice
}
from
'
vs/workbench/contrib/notebook/common/notebookCommon
'
;
import
{
BaseCellViewModel
}
from
'
./baseCellViewModel
'
;
...
...
@@ -107,9 +107,7 @@ export class CodeCellViewModel extends BaseCellViewModel implements ICellViewMod
// recompute
this
.
_ensureOutputsTop
();
const
outputTotalHeight
=
this
.
_outputsTop
!
.
getTotalValue
();
const
totalHeight
=
this
.
outputs
.
length
?
EDITOR_TOOLBAR_HEIGHT
+
this
.
editorHeight
+
EDITOR_TOP_PADDING
+
16
+
outputTotalHeight
:
EDITOR_TOOLBAR_HEIGHT
+
this
.
editorHeight
+
EDITOR_TOP_PADDING
+
EDITOR_BOTTOM_PADDING
+
outputTotalHeight
;
const
totalHeight
=
EDITOR_TOOLBAR_HEIGHT
+
this
.
editorHeight
+
EDITOR_TOP_MARGIN
+
16
+
outputTotalHeight
;
const
indicatorHeight
=
this
.
editorHeight
+
outputTotalHeight
;
const
outputContainerOffset
=
EDITOR_TOOLBAR_HEIGHT
+
this
.
editorHeight
;
const
editorWidth
=
state
.
outerWidth
!==
undefined
?
state
.
outerWidth
-
CELL_MARGIN
*
2
-
CELL_RUN_GUTTER
:
0
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录