Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
b9a061c1
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,发现更多精彩内容 >>
提交
b9a061c1
编写于
11月 29, 2019
作者:
P
Peng Lyu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Improve scrolling performance.
上级
5be4214c
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
26 addition
and
24 deletion
+26
-24
src/vs/workbench/contrib/notebook/browser/notebook.css
src/vs/workbench/contrib/notebook/browser/notebook.css
+3
-0
src/vs/workbench/contrib/notebook/browser/notebookEditor.ts
src/vs/workbench/contrib/notebook/browser/notebookEditor.ts
+23
-24
未找到文件。
src/vs/workbench/contrib/notebook/browser/notebook.css
浏览文件 @
b9a061c1
...
...
@@ -15,3 +15,6 @@
padding
:
8px
;
}
.cell
{
transform
:
translate3d
(
0
,
0
,
0
);
}
src/vs/workbench/contrib/notebook/browser/notebookEditor.ts
浏览文件 @
b9a061c1
...
...
@@ -14,18 +14,18 @@ import { EditorOptions } from 'vs/workbench/common/editor';
import
{
CancellationToken
}
from
'
vs/base/common/cancellation
'
;
import
{
IConfigurationService
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
CodeEditorWidget
}
from
'
vs/editor/browser/widget/codeEditorWidget
'
;
import
{
CodeEditorWidget
,
ICodeEditorWidgetOptions
}
from
'
vs/editor/browser/widget/codeEditorWidget
'
;
import
*
as
marked
from
'
vs/base/common/marked/marked
'
;
import
{
IModelService
}
from
'
vs/editor/common/services/modelService
'
;
import
{
URI
}
from
'
vs/base/common/uri
'
;
import
{
IModeService
}
from
'
vs/editor/common/services/modeService
'
;
import
{
deepClone
}
from
'
vs/base/common/objects
'
;
import
{
IEditorOptions
,
EditorOption
}
from
'
vs/editor/common/config/editorOptions
'
;
import
{
isObject
}
from
'
vs/base/common/types
'
;
import
{
getExtraColor
}
from
'
vs/workbench/contrib/welcome/walkThrough/common/walkThroughUtils
'
;
import
{
textLinkForeground
,
textLinkActiveForeground
,
focusBorder
,
textPreformatForeground
,
contrastBorder
,
textBlockQuoteBackground
,
textBlockQuoteBorder
,
editorBackground
,
foreground
}
from
'
vs/platform/theme/common/colorRegistry
'
;
import
{
IListRenderer
,
IListVirtualDelegate
}
from
'
vs/base/browser/ui/list/list
'
;
import
{
WorkbenchList
}
from
'
vs/platform/list/browser/listService
'
;
import
{
getSimpleCodeEditorWidgetOptions
}
from
'
vs/workbench/contrib/codeEditor/browser/simpleEditorOptions
'
;
const
$
=
DOM
.
$
;
...
...
@@ -99,6 +99,7 @@ export class MarkdownCellRenderer implements IListRenderer<Cell, CellRenderTempl
export
class
CodeCellRenderer
implements
IListRenderer
<
Cell
,
CellRenderTemplate
>
{
static
readonly
TEMPLATE_ID
=
'
code_cell
'
;
private
editorOptions
:
IEditorOptions
;
private
widgetOptions
:
ICodeEditorWidgetOptions
;
constructor
(
@
IConfigurationService
private
readonly
configurationService
:
IConfigurationService
,
...
...
@@ -107,7 +108,24 @@ export class CodeCellRenderer implements IListRenderer<Cell, CellRenderTemplate>
@
IModeService
private
readonly
modeService
:
IModeService
)
{
const
language
=
'
python
'
;
this
.
editorOptions
=
deepClone
(
this
.
configurationService
.
getValue
<
IEditorOptions
>
(
'
editor
'
,
{
overrideIdentifier
:
language
}));
const
editorOptions
=
deepClone
(
this
.
configurationService
.
getValue
<
IEditorOptions
>
(
'
editor
'
,
{
overrideIdentifier
:
language
}));
this
.
editorOptions
=
{
...
editorOptions
,
scrollBeyondLastLine
:
false
,
scrollbar
:
{
verticalScrollbarSize
:
14
,
horizontal
:
'
auto
'
,
useShadows
:
true
,
verticalHasArrows
:
false
,
horizontalHasArrows
:
false
},
overviewRulerLanes
:
3
,
fixedOverflowWidgets
:
true
,
lineNumbersMinChars
:
1
,
minimap
:
{
enabled
:
false
},
};
this
.
widgetOptions
=
getSimpleCodeEditorWidgetOptions
();
}
get
templateId
()
{
...
...
@@ -127,8 +145,7 @@ export class CodeCellRenderer implements IListRenderer<Cell, CellRenderTemplate>
}
renderElement
(
element
:
Cell
,
index
:
number
,
templateData
:
CellRenderTemplate
,
height
:
number
|
undefined
):
void
{
const
codeConfig
=
this
.
getEditorOptions
(
'
python
'
);
const
codeConfig
=
this
.
editorOptions
;
const
innerContent
=
templateData
.
cellContainer
;
const
width
=
innerContent
.
clientWidth
;
const
lineHeight
=
codeConfig
.
lineHeight
!
;
...
...
@@ -140,7 +157,7 @@ export class CodeCellRenderer implements IListRenderer<Cell, CellRenderTemplate>
width
:
width
,
height
:
totalHeight
}
},
{}
);
},
this
.
widgetOptions
);
const
resource
=
URI
.
parse
(
`notebookcell-
${
index
}
-
${
Date
.
now
()}
.js`
);
const
model
=
this
.
modelService
.
createModel
(
element
.
value
,
this
.
modeService
.
createByFilepathOrFirstLine
(
resource
),
resource
,
false
);
editor
.
setModel
(
model
);
...
...
@@ -162,24 +179,6 @@ export class CodeCellRenderer implements IListRenderer<Cell, CellRenderTemplate>
disposeTemplate
(
templateData
:
CellRenderTemplate
):
void
{
// throw nerendererw Error('Method not implemented.');
}
private
getEditorOptions
(
language
:
string
):
IEditorOptions
{
return
{
...
this
.
editorOptions
,
scrollBeyondLastLine
:
false
,
scrollbar
:
{
verticalScrollbarSize
:
14
,
horizontal
:
'
auto
'
,
useShadows
:
true
,
verticalHasArrows
:
false
,
horizontalHasArrows
:
false
},
overviewRulerLanes
:
3
,
fixedOverflowWidgets
:
true
,
lineNumbersMinChars
:
1
,
minimap
:
{
enabled
:
false
},
};
}
}
export
class
NotebookEditor
extends
BaseEditor
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录