Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
c41d6313
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,发现更多精彩内容 >>
提交
c41d6313
编写于
3月 16, 2020
作者:
R
rebornix
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
move cell padding height to constants
上级
4996dcdd
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
20 addition
and
15 deletion
+20
-15
src/vs/workbench/contrib/notebook/browser/constants.ts
src/vs/workbench/contrib/notebook/browser/constants.ts
+6
-0
src/vs/workbench/contrib/notebook/browser/notebookEditor.ts
src/vs/workbench/contrib/notebook/browser/notebookEditor.ts
+2
-1
src/vs/workbench/contrib/notebook/browser/view/notebookCellList.ts
...rkbench/contrib/notebook/browser/view/notebookCellList.ts
+2
-1
src/vs/workbench/contrib/notebook/browser/view/renderers/backLayerWebView.ts
...ntrib/notebook/browser/view/renderers/backLayerWebView.ts
+2
-1
src/vs/workbench/contrib/notebook/browser/view/renderers/cellRenderer.ts
...h/contrib/notebook/browser/view/renderers/cellRenderer.ts
+2
-1
src/vs/workbench/contrib/notebook/browser/view/renderers/codeCell.ts
...bench/contrib/notebook/browser/view/renderers/codeCell.ts
+2
-1
src/vs/workbench/contrib/notebook/browser/view/renderers/markdownCell.ts
...h/contrib/notebook/browser/view/renderers/markdownCell.ts
+1
-1
src/vs/workbench/contrib/notebook/browser/viewModel/notebookCellViewModel.ts
...ntrib/notebook/browser/viewModel/notebookCellViewModel.ts
+2
-1
src/vs/workbench/contrib/notebook/browser/viewModel/notebookViewModel.ts
...h/contrib/notebook/browser/viewModel/notebookViewModel.ts
+1
-1
src/vs/workbench/contrib/notebook/common/notebookCommon.ts
src/vs/workbench/contrib/notebook/common/notebookCommon.ts
+0
-7
未找到文件。
src/vs/workbench/contrib/notebook/browser/constants.ts
浏览文件 @
c41d6313
...
...
@@ -18,3 +18,9 @@ export const COPY_CELL_UP_COMMAND_ID = 'workbench.notebook.cell.copyUp';
export
const
COPY_CELL_DOWN_COMMAND_ID
=
'
workbench.notebook.cell.copyDown
'
;
export
const
EXECUTE_CELL_COMMAND_ID
=
'
workbench.notebook.cell.execute
'
;
// Cell sizing related
export
const
CELL_MARGIN
=
24
;
export
const
EDITOR_TOP_PADDING
=
8
;
export
const
EDITOR_BOTTOM_PADDING
=
8
;
export
const
EDITOR_TOOLBAR_HEIGHT
=
22
;
src/vs/workbench/contrib/notebook/browser/notebookEditor.ts
浏览文件 @
c41d6313
...
...
@@ -27,7 +27,7 @@ import { INotebookService } from 'vs/workbench/contrib/notebook/browser/notebook
import
{
OutputRenderer
}
from
'
vs/workbench/contrib/notebook/browser/view/output/outputRenderer
'
;
import
{
BackLayerWebView
}
from
'
vs/workbench/contrib/notebook/browser/view/renderers/backLayerWebView
'
;
import
{
CodeCellRenderer
,
MarkdownCellRenderer
,
NotebookCellListDelegate
}
from
'
vs/workbench/contrib/notebook/browser/view/renderers/cellRenderer
'
;
import
{
CELL_MARGIN
,
NotebookCellsSplice
,
IOutput
,
CellKind
}
from
'
vs/workbench/contrib/notebook/common/notebookCommon
'
;
import
{
NotebookCellsSplice
,
IOutput
,
CellKind
}
from
'
vs/workbench/contrib/notebook/common/notebookCommon
'
;
import
{
IWebviewService
}
from
'
vs/workbench/contrib/webview/browser/webview
'
;
import
{
getExtraColor
}
from
'
vs/workbench/contrib/welcome/walkThrough/common/walkThroughUtils
'
;
import
{
IEditorGroup
,
IEditorGroupsService
}
from
'
vs/workbench/services/editor/common/editorGroupsService
'
;
...
...
@@ -41,6 +41,7 @@ import { NotebookViewModel, INotebookEditorViewState, IModelDecorationsChangeAcc
import
{
IEditorGroupView
}
from
'
vs/workbench/browser/parts/editor/editor
'
;
import
{
CellViewModel
}
from
'
vs/workbench/contrib/notebook/browser/viewModel/notebookCellViewModel
'
;
import
{
Range
}
from
'
vs/editor/common/core/range
'
;
import
{
CELL_MARGIN
}
from
'
vs/workbench/contrib/notebook/browser/constants
'
;
const
$
=
DOM
.
$
;
const
NOTEBOOK_EDITOR_VIEW_STATE_PREFERENCE_KEY
=
'
NotebookEditorViewState
'
;
...
...
src/vs/workbench/contrib/notebook/browser/view/notebookCellList.ts
浏览文件 @
c41d6313
...
...
@@ -14,11 +14,12 @@ import { IListService, IWorkbenchListOptions, WorkbenchList } from 'vs/platform/
import
{
IThemeService
}
from
'
vs/platform/theme/common/themeService
'
;
import
{
IMouseWheelEvent
}
from
'
vs/base/browser/mouseEvent
'
;
import
{
isMacintosh
}
from
'
vs/base/common/platform
'
;
import
{
EDITOR_TOP_PADDING
,
NOTEBOOK_EDITOR_CURSOR_BOUNDARY
}
from
'
vs/workbench/contrib/notebook/common/notebookCommon
'
;
import
{
NOTEBOOK_EDITOR_CURSOR_BOUNDARY
}
from
'
vs/workbench/contrib/notebook/common/notebookCommon
'
;
import
{
Range
}
from
'
vs/editor/common/core/range
'
;
import
{
CellRevealType
,
CellRevealPosition
,
CursorAtBoundary
}
from
'
vs/workbench/contrib/notebook/browser/notebookBrowser
'
;
import
{
IDisposable
,
DisposableStore
}
from
'
vs/base/common/lifecycle
'
;
import
{
CellViewModel
}
from
'
vs/workbench/contrib/notebook/browser/viewModel/notebookCellViewModel
'
;
import
{
EDITOR_TOP_PADDING
}
from
'
vs/workbench/contrib/notebook/browser/constants
'
;
export
class
NotebookCellList
extends
WorkbenchList
<
CellViewModel
>
implements
IDisposable
{
get
onWillScroll
():
Event
<
ScrollEvent
>
{
return
this
.
view
.
onWillScroll
;
}
...
...
src/vs/workbench/contrib/notebook/browser/view/renderers/backLayerWebView.ts
浏览文件 @
c41d6313
...
...
@@ -11,10 +11,11 @@ import * as UUID from 'vs/base/common/uuid';
import
{
IEnvironmentService
}
from
'
vs/platform/environment/common/environment
'
;
import
{
INotebookEditor
}
from
'
vs/workbench/contrib/notebook/browser/notebookBrowser
'
;
import
{
INotebookService
}
from
'
vs/workbench/contrib/notebook/browser/notebookService
'
;
import
{
CELL_MARGIN
,
IOutput
}
from
'
vs/workbench/contrib/notebook/common/notebookCommon
'
;
import
{
IOutput
}
from
'
vs/workbench/contrib/notebook/common/notebookCommon
'
;
import
{
IWebviewService
,
WebviewElement
}
from
'
vs/workbench/contrib/webview/browser/webview
'
;
import
{
WebviewResourceScheme
}
from
'
vs/workbench/contrib/webview/common/resourceLoader
'
;
import
{
CellViewModel
}
from
'
vs/workbench/contrib/notebook/browser/viewModel/notebookCellViewModel
'
;
import
{
CELL_MARGIN
}
from
'
vs/workbench/contrib/notebook/browser/constants
'
;
export
interface
IDimentionMessage
{
type
:
'
dimension
'
;
...
...
src/vs/workbench/contrib/notebook/browser/view/renderers/cellRenderer.ts
浏览文件 @
c41d6313
...
...
@@ -22,12 +22,13 @@ import { InsertCodeCellAboveAction, INotebookCellActionContext, InsertCodeCellBe
import
{
CellRenderTemplate
,
INotebookEditor
,
ICellViewModel
}
from
'
vs/workbench/contrib/notebook/browser/notebookBrowser
'
;
import
{
CodeCell
}
from
'
vs/workbench/contrib/notebook/browser/view/renderers/codeCell
'
;
import
{
StatefullMarkdownCell
}
from
'
vs/workbench/contrib/notebook/browser/view/renderers/markdownCell
'
;
import
{
CellKind
,
EDITOR_BOTTOM_PADDING
,
EDITOR_TOP_PADDING
,
EDITOR_TOOLBAR_HEIGHT
}
from
'
vs/workbench/contrib/notebook/common/notebookCommon
'
;
import
{
CellKind
}
from
'
vs/workbench/contrib/notebook/common/notebookCommon
'
;
import
{
CellViewModel
}
from
'
../../viewModel/notebookCellViewModel
'
;
import
{
ContextAwareMenuEntryActionViewItem
}
from
'
vs/platform/actions/browser/menuEntryActionViewItem
'
;
import
{
MenuItemAction
}
from
'
vs/platform/actions/common/actions
'
;
import
{
IKeybindingService
}
from
'
vs/platform/keybinding/common/keybinding
'
;
import
{
INotificationService
}
from
'
vs/platform/notification/common/notification
'
;
import
{
EDITOR_TOOLBAR_HEIGHT
,
EDITOR_TOP_PADDING
,
EDITOR_BOTTOM_PADDING
}
from
'
vs/workbench/contrib/notebook/browser/constants
'
;
export
class
NotebookCellListDelegate
implements
IListVirtualDelegate
<
ICellViewModel
>
{
private
_lineHeight
:
number
;
...
...
src/vs/workbench/contrib/notebook/browser/view/renderers/codeCell.ts
浏览文件 @
c41d6313
...
...
@@ -7,13 +7,14 @@ import * as nls from 'vs/nls';
import
*
as
DOM
from
'
vs/base/browser/dom
'
;
import
{
Disposable
,
DisposableStore
}
from
'
vs/base/common/lifecycle
'
;
import
{
getResizesObserver
}
from
'
vs/workbench/contrib/notebook/browser/view/renderers/sizeObserver
'
;
import
{
CELL_MARGIN
,
IOutput
,
EDITOR_TOP_PADDING
,
EDITOR_BOTTOM_PADDING
,
ITransformedDisplayOutputDto
,
IRenderOutput
,
CellOutputKind
}
from
'
vs/workbench/contrib/notebook/common/notebookCommon
'
;
import
{
IOutput
,
ITransformedDisplayOutputDto
,
IRenderOutput
,
CellOutputKind
}
from
'
vs/workbench/contrib/notebook/common/notebookCommon
'
;
import
{
CellRenderTemplate
,
INotebookEditor
,
CellFocusMode
}
from
'
vs/workbench/contrib/notebook/browser/notebookBrowser
'
;
import
{
raceCancellation
}
from
'
vs/base/common/async
'
;
import
{
CancellationTokenSource
}
from
'
vs/base/common/cancellation
'
;
import
{
IQuickInputService
,
IQuickPickItem
}
from
'
vs/platform/quickinput/common/quickInput
'
;
import
{
INotebookService
}
from
'
vs/workbench/contrib/notebook/browser/notebookService
'
;
import
{
CellViewModel
}
from
'
vs/workbench/contrib/notebook/browser/viewModel/notebookCellViewModel
'
;
import
{
CELL_MARGIN
,
EDITOR_TOP_PADDING
,
EDITOR_BOTTOM_PADDING
}
from
'
vs/workbench/contrib/notebook/browser/constants
'
;
interface
IMimeTypeRenderer
extends
IQuickPickItem
{
index
:
number
;
...
...
src/vs/workbench/contrib/notebook/browser/view/renderers/markdownCell.ts
浏览文件 @
c41d6313
...
...
@@ -8,11 +8,11 @@ import { Disposable, DisposableStore } from 'vs/base/common/lifecycle';
import
{
IEditorOptions
}
from
'
vs/editor/common/config/editorOptions
'
;
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
getResizesObserver
}
from
'
vs/workbench/contrib/notebook/browser/view/renderers/sizeObserver
'
;
import
{
CELL_MARGIN
,
EDITOR_TOP_PADDING
,
EDITOR_BOTTOM_PADDING
}
from
'
vs/workbench/contrib/notebook/common/notebookCommon
'
;
import
{
INotebookEditor
,
CellRenderTemplate
,
CellFocusMode
,
CellState
}
from
'
vs/workbench/contrib/notebook/browser/notebookBrowser
'
;
import
{
CancellationTokenSource
}
from
'
vs/base/common/cancellation
'
;
import
{
raceCancellation
}
from
'
vs/base/common/async
'
;
import
{
CellViewModel
}
from
'
vs/workbench/contrib/notebook/browser/viewModel/notebookCellViewModel
'
;
import
{
CELL_MARGIN
,
EDITOR_TOP_PADDING
,
EDITOR_BOTTOM_PADDING
}
from
'
vs/workbench/contrib/notebook/browser/constants
'
;
export
class
StatefullMarkdownCell
extends
Disposable
{
private
editor
:
CodeEditorWidget
|
null
=
null
;
...
...
src/vs/workbench/contrib/notebook/browser/viewModel/notebookCellViewModel.ts
浏览文件 @
c41d6313
...
...
@@ -15,8 +15,9 @@ import { ITextModelService } from 'vs/editor/common/services/resolverService';
import
{
PrefixSumComputer
}
from
'
vs/editor/common/viewModel/prefixSumComputer
'
;
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
MarkdownRenderer
}
from
'
vs/workbench/contrib/notebook/browser/view/renderers/mdRenderer
'
;
import
{
CellKind
,
EDITOR_BOTTOM_PADDING
,
EDITOR_TOP_PADDING
,
ICell
,
IOutput
,
NotebookCellOutputsSplice
,
EDITOR_TOOLBAR_HEIGHT
}
from
'
vs/workbench/contrib/notebook/common/notebookCommon
'
;
import
{
CellKind
,
ICell
,
IOutput
,
NotebookCellOutputsSplice
}
from
'
vs/workbench/contrib/notebook/common/notebookCommon
'
;
import
{
CellFindMatch
,
CellState
,
CursorAtBoundary
,
CellFocusMode
,
ICellViewModel
}
from
'
vs/workbench/contrib/notebook/browser/notebookBrowser
'
;
import
{
EDITOR_TOP_PADDING
,
EDITOR_BOTTOM_PADDING
,
EDITOR_TOOLBAR_HEIGHT
}
from
'
vs/workbench/contrib/notebook/browser/constants
'
;
export
class
CellViewModel
extends
Disposable
implements
ICellViewModel
{
...
...
src/vs/workbench/contrib/notebook/browser/viewModel/notebookViewModel.ts
浏览文件 @
c41d6313
...
...
@@ -130,7 +130,7 @@ export class NotebookViewModel extends Disposable {
}
moveCellToIdx
(
index
:
number
,
newIdx
:
number
):
boolean
{
const
viewCell
=
this
.
viewCells
[
index
];
const
viewCell
=
this
.
viewCells
[
index
]
as
CellViewModel
;
if
(
!
viewCell
)
{
return
false
;
}
...
...
src/vs/workbench/contrib/notebook/common/notebookCommon.ts
浏览文件 @
c41d6313
...
...
@@ -154,13 +154,6 @@ export interface IRenderOutput {
hasDynamicHeight
:
boolean
;
}
export
const
CELL_MARGIN
=
24
;
export
const
EDITOR_TOP_PADDING
=
8
;
export
const
EDITOR_BOTTOM_PADDING
=
8
;
export
const
EDITOR_TOOLBAR_HEIGHT
=
22
;
export
type
NotebookCellsSplice
=
[
number
/* start */
,
number
/* delete count */
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录