Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
ebccd57e
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,发现更多精彩内容 >>
提交
ebccd57e
编写于
8月 25, 2020
作者:
R
rebornix
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
insert/delete background colors for cells.
上级
e64c80c1
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
72 addition
and
2 deletion
+72
-2
src/vs/workbench/contrib/notebook/browser/diff/cellComponents.ts
...workbench/contrib/notebook/browser/diff/cellComponents.ts
+5
-1
src/vs/workbench/contrib/notebook/browser/diff/notebookTextDiffEditor.ts
...h/contrib/notebook/browser/diff/notebookTextDiffEditor.ts
+67
-1
未找到文件。
src/vs/workbench/contrib/notebook/browser/diff/cellComponents.ts
浏览文件 @
ebccd57e
...
...
@@ -5,13 +5,14 @@
import
*
as
DOM
from
'
vs/base/browser/dom
'
;
import
{
Disposable
,
DisposableStore
}
from
'
vs/base/common/lifecycle
'
;
import
{
Range
}
from
'
vs/editor/common/core/range
'
;
import
{
IDiffEditorOptions
,
IEditorOptions
}
from
'
vs/editor/common/config/editorOptions
'
;
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
CellDiffViewModel
,
PropertyFoldingState
}
from
'
vs/workbench/contrib/notebook/browser/diff/celllDiffViewModel
'
;
import
{
CellDiffRenderTemplate
,
CellDiffViewModelLayoutChangeEvent
,
DIFF_CELL_MARGIN
,
INotebookTextDiffEditor
}
from
'
vs/workbench/contrib/notebook/browser/diff/common
'
;
import
{
EDITOR_BOTTOM_PADDING
,
EDITOR_TOP_PADDING
}
from
'
vs/workbench/contrib/notebook/browser/constants
'
;
import
{
CodeEditorWidget
}
from
'
vs/editor/browser/widget/codeEditorWidget
'
;
import
{
DiffEditorWidget
}
from
'
vs/editor/browser/widget/diffEditorWidget
'
;
import
{
D
ECORATIONS
,
D
iffEditorWidget
}
from
'
vs/editor/browser/widget/diffEditorWidget
'
;
import
{
renderCodicons
}
from
'
vs/base/common/codicons
'
;
import
{
IModelService
}
from
'
vs/editor/common/services/modelService
'
;
import
{
IModeService
}
from
'
vs/editor/common/services/modeService
'
;
...
...
@@ -19,6 +20,7 @@ import { format } from 'vs/base/common/jsonFormatter';
import
{
applyEdits
}
from
'
vs/base/common/jsonEdit
'
;
import
{
NotebookCellMetadata
}
from
'
vs/workbench/contrib/notebook/common/notebookCommon
'
;
import
{
hash
}
from
'
vs/base/common/hash
'
;
import
{
Constants
}
from
'
vs/base/common/uint
'
;
const
fixedDiffEditorOptions
:
IDiffEditorOptions
=
{
...
...
@@ -604,6 +606,7 @@ export class DeletedCell extends AbstractCellRenderer {
}
styleContainer
(
container
:
HTMLElement
)
{
DOM
.
addClass
(
container
,
'
removed
'
);
}
buildSourceEditor
(
sourceContainer
:
HTMLElement
):
void
{
...
...
@@ -689,6 +692,7 @@ export class InsertCell extends AbstractCellRenderer {
}
styleContainer
(
container
:
HTMLElement
):
void
{
DOM
.
addClass
(
container
,
'
inserted
'
);
}
buildSourceEditor
(
sourceContainer
:
HTMLElement
):
void
{
...
...
src/vs/workbench/contrib/notebook/browser/diff/notebookTextDiffEditor.ts
浏览文件 @
ebccd57e
...
...
@@ -18,7 +18,7 @@ import { CellDiffViewModel } from 'vs/workbench/contrib/notebook/browser/diff/ce
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
CellDiffRenderer
,
NotebookCellTextDiffListDelegate
,
NotebookTextDiffList
}
from
'
vs/workbench/contrib/notebook/browser/diff/notebookTextDiffList
'
;
import
{
IContextKeyService
}
from
'
vs/platform/contextkey/common/contextkey
'
;
import
{
diffDiagonalFill
,
editorBackground
,
focusBorder
,
foreground
}
from
'
vs/platform/theme/common/colorRegistry
'
;
import
{
diffDiagonalFill
,
diffInserted
,
diffRemoved
,
editorBackground
,
focusBorder
,
foreground
}
from
'
vs/platform/theme/common/colorRegistry
'
;
import
{
INotebookEditorWorkerService
}
from
'
vs/workbench/contrib/notebook/common/services/notebookWorkerService
'
;
import
{
IConfigurationService
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
IEditorOptions
}
from
'
vs/editor/common/config/editorOptions
'
;
...
...
@@ -318,5 +318,71 @@ registerThemingParticipant((theme, collector) => {
}
`
);
const
added
=
theme
.
getColor
(
diffInserted
);
if
(
added
)
{
collector
.
addRule
(
`
.notebook-text-diff-editor .cell-body .cell-diff-editor-container.inserted .source-container { background-color:
${
added
}
; }
.notebook-text-diff-editor .cell-body .cell-diff-editor-container.inserted .source-container .monaco-editor .margin,
.notebook-text-diff-editor .cell-body .cell-diff-editor-container.inserted .source-container .monaco-editor .monaco-editor-background {
background-color:
${
added
}
;
}
`
);
collector
.
addRule
(
`
.notebook-text-diff-editor .cell-body .cell-diff-editor-container.inserted .metadata-editor-container { background-color:
${
added
}
; }
.notebook-text-diff-editor .cell-body .cell-diff-editor-container.inserted .metadata-editor-container .monaco-editor .margin,
.notebook-text-diff-editor .cell-body .cell-diff-editor-container.inserted .metadata-editor-container .monaco-editor .monaco-editor-background {
background-color:
${
added
}
;
}
`
);
collector
.
addRule
(
`
.notebook-text-diff-editor .cell-body .cell-diff-editor-container.inserted .output-editor-container { background-color:
${
added
}
; }
.notebook-text-diff-editor .cell-body .cell-diff-editor-container.inserted .output-editor-container .monaco-editor .margin,
.notebook-text-diff-editor .cell-body .cell-diff-editor-container.inserted .output-editor-container .monaco-editor .monaco-editor-background {
background-color:
${
added
}
;
}
`
);
collector
.
addRule
(
`
.notebook-text-diff-editor .cell-body .cell-diff-editor-container.inserted .metadata-header-container { background-color:
${
added
}
; }
.notebook-text-diff-editor .cell-body .cell-diff-editor-container.inserted .output-header-container { background-color:
${
added
}
; }
`
);
}
const
removed
=
theme
.
getColor
(
diffRemoved
);
if
(
added
)
{
collector
.
addRule
(
`
.notebook-text-diff-editor .cell-body .cell-diff-editor-container.removed .source-container { background-color:
${
removed
}
; }
.notebook-text-diff-editor .cell-body .cell-diff-editor-container.removed .source-container .monaco-editor .margin,
.notebook-text-diff-editor .cell-body .cell-diff-editor-container.removed .source-container .monaco-editor .monaco-editor-background {
background-color:
${
removed
}
;
}
`
);
collector
.
addRule
(
`
.notebook-text-diff-editor .cell-body .cell-diff-editor-container.removed .metadata-editor-container { background-color:
${
removed
}
; }
.notebook-text-diff-editor .cell-body .cell-diff-editor-container.removed .metadata-editor-container .monaco-editor .margin,
.notebook-text-diff-editor .cell-body .cell-diff-editor-container.removed .metadata-editor-container .monaco-editor .monaco-editor-background {
background-color:
${
removed
}
;
}
`
);
collector
.
addRule
(
`
.notebook-text-diff-editor .cell-body .cell-diff-editor-container.removed .output-editor-container { background-color:
${
removed
}
; }
.notebook-text-diff-editor .cell-body .cell-diff-editor-container.removed .output-editor-container .monaco-editor .margin,
.notebook-text-diff-editor .cell-body .cell-diff-editor-container.removed .output-editor-container .monaco-editor .monaco-editor-background {
background-color:
${
removed
}
;
}
`
);
collector
.
addRule
(
`
.notebook-text-diff-editor .cell-body .cell-diff-editor-container.removed .metadata-header-container { background-color:
${
removed
}
; }
.notebook-text-diff-editor .cell-body .cell-diff-editor-container.removed .output-header-container { background-color:
${
removed
}
; }
`
);
}
collector
.
addRule
(
`.notebook-text-diff-editor .cell-body { margin:
${
DIFF_CELL_MARGIN
}
px; }`
);
});
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录