Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
WLHYW
vscode
提交
c4c5f45c
V
vscode
项目概览
WLHYW
/
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,发现更多精彩内容 >>
提交
c4c5f45c
编写于
1月 26, 2021
作者:
R
rebornix
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix #115150.
上级
39d9b04f
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
9 addition
and
14 deletion
+9
-14
src/vs/workbench/contrib/notebook/browser/diff/diffComponents.ts
...workbench/contrib/notebook/browser/diff/diffComponents.ts
+6
-13
src/vs/workbench/contrib/notebook/browser/diff/diffElementViewModel.ts
...nch/contrib/notebook/browser/diff/diffElementViewModel.ts
+3
-1
未找到文件。
src/vs/workbench/contrib/notebook/browser/diff/diffComponents.ts
浏览文件 @
c4c5f45c
...
...
@@ -7,16 +7,14 @@ import * as DOM from 'vs/base/browser/dom';
import
{
Disposable
,
DisposableStore
}
from
'
vs/base/common/lifecycle
'
;
import
{
IDiffEditorOptions
,
IEditorOptions
}
from
'
vs/editor/common/config/editorOptions
'
;
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
DiffElementViewModelBase
,
getFormatedMetadataJSON
,
PropertyFoldingState
,
SideBySideDiffElementViewModel
,
SingleSideDiffElementViewModel
}
from
'
vs/workbench/contrib/notebook/browser/diff/diffElementViewModel
'
;
import
{
DiffElementViewModelBase
,
getFormatedMetadataJSON
,
OUTPUT_EDITOR_HEIGHT_MAGIC
,
PropertyFoldingState
,
SideBySideDiffElementViewModel
,
SingleSideDiffElementViewModel
}
from
'
vs/workbench/contrib/notebook/browser/diff/diffElementViewModel
'
;
import
{
CellDiffSideBySideRenderTemplate
,
CellDiffSingleSideRenderTemplate
,
DiffSide
,
DIFF_CELL_MARGIN
,
INotebookTextDiffEditor
,
NOTEBOOK_DIFF_CELL_PROPERTY
,
NOTEBOOK_DIFF_CELL_PROPERTY_EXPANDED
}
from
'
vs/workbench/contrib/notebook/browser/diff/notebookDiffEditorBrowser
'
;
import
{
EDITOR_BOTTOM_PADDING
}
from
'
vs/workbench/contrib/notebook/browser/constants
'
;
import
{
CodeEditorWidget
,
ICodeEditorWidgetOptions
}
from
'
vs/editor/browser/widget/codeEditorWidget
'
;
import
{
DiffEditorWidget
}
from
'
vs/editor/browser/widget/diffEditorWidget
'
;
import
{
IModelService
}
from
'
vs/editor/common/services/modelService
'
;
import
{
IModeService
}
from
'
vs/editor/common/services/modeService
'
;
import
{
format
}
from
'
vs/base/common/jsonFormatter
'
;
import
{
applyEdits
}
from
'
vs/base/common/jsonEdit
'
;
import
{
CellEditType
,
CellUri
,
NotebookCellMetadata
}
from
'
vs/workbench/contrib/notebook/common/notebookCommon
'
;
import
{
CellEditType
,
CellUri
,
IProcessedOutput
,
NotebookCellMetadata
}
from
'
vs/workbench/contrib/notebook/common/notebookCommon
'
;
import
{
ToolBar
}
from
'
vs/base/browser/ui/toolbar/toolbar
'
;
import
{
IContextMenuService
}
from
'
vs/platform/contextview/browser/contextView
'
;
import
{
IMenu
,
IMenuService
,
MenuId
,
MenuItemAction
}
from
'
vs/platform/actions/common/actions
'
;
...
...
@@ -566,13 +564,8 @@ abstract class AbstractElementRenderer extends Disposable {
}
}
private
_getFormatedOutputJSON
(
outputs
:
any
[])
{
const
content
=
JSON
.
stringify
(
outputs
);
const
edits
=
format
(
content
,
undefined
,
{});
const
source
=
applyEdits
(
content
,
edits
);
return
source
;
private
_getFormatedOutputJSON
(
outputs
:
IProcessedOutput
[])
{
return
JSON
.
stringify
(
outputs
,
undefined
,
'
\t
'
);
}
private
_buildOutputEditor
()
{
...
...
@@ -597,7 +590,7 @@ abstract class AbstractElementRenderer extends Disposable {
ignoreTrimWhitespace
:
false
,
automaticLayout
:
false
,
dimension
:
{
height
:
this
.
cell
.
layoutInfo
.
rawOutputHeight
||
lineHeight
*
lineCount
,
height
:
Math
.
min
(
OUTPUT_EDITOR_HEIGHT_MAGIC
,
this
.
cell
.
layoutInfo
.
rawOutputHeight
||
lineHeight
*
lineCount
)
,
width
:
this
.
cell
.
getComputedCellContainerWidth
(
this
.
notebookEditor
.
getLayoutInfo
(),
false
,
true
)
}
},
{
...
...
@@ -635,7 +628,7 @@ abstract class AbstractElementRenderer extends Disposable {
this
.
_outputEditor
=
this
.
instantiationService
.
createInstance
(
CodeEditorWidget
,
this
.
_outputEditorContainer
!
,
{
...
fixedEditorOptions
,
dimension
:
{
width
:
this
.
cell
.
getComputedCellContainerWidth
(
this
.
notebookEditor
.
getLayoutInfo
(),
false
,
this
.
cell
.
type
===
'
unchanged
'
||
this
.
cell
.
type
===
'
modified
'
)
-
32
,
width
:
Math
.
min
(
OUTPUT_EDITOR_HEIGHT_MAGIC
,
this
.
cell
.
getComputedCellContainerWidth
(
this
.
notebookEditor
.
getLayoutInfo
(),
false
,
this
.
cell
.
type
===
'
unchanged
'
||
this
.
cell
.
type
===
'
modified
'
)
-
32
)
,
height
:
this
.
cell
.
layoutInfo
.
rawOutputHeight
},
overflowWidgetsDomNode
:
this
.
notebookEditor
.
getOverflowContainerDomNode
()
...
...
src/vs/workbench/contrib/notebook/browser/diff/diffElementViewModel.ts
浏览文件 @
c4c5f45c
...
...
@@ -23,6 +23,8 @@ export enum PropertyFoldingState {
Collapsed
}
export
const
OUTPUT_EDITOR_HEIGHT_MAGIC
=
1440
;
type
ILayoutInfoDelta0
=
{
[
K
in
keyof
IDiffElementLayoutInfo
]?:
number
;
};
interface
ILayoutInfoDelta
extends
ILayoutInfoDelta0
{
rawOutputHeight
?:
number
;
...
...
@@ -39,7 +41,7 @@ export abstract class DiffElementViewModelBase extends Disposable {
protected
_layoutInfo
!
:
IDiffElementLayoutInfo
;
set
rawOutputHeight
(
height
:
number
)
{
this
.
_layout
({
rawOutputHeight
:
height
});
this
.
_layout
({
rawOutputHeight
:
Math
.
min
(
OUTPUT_EDITOR_HEIGHT_MAGIC
,
height
)
});
}
get
rawOutputHeight
()
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录