Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
54d778bc
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,发现更多精彩内容 >>
提交
54d778bc
编写于
7月 13, 2016
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
get rid of instantiation service array
上级
2c994ae4
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
12 addition
and
10 deletion
+12
-10
src/vs/workbench/browser/parts/editor/sideBySideEditorControl.ts
...workbench/browser/parts/editor/sideBySideEditorControl.ts
+12
-10
未找到文件。
src/vs/workbench/browser/parts/editor/sideBySideEditorControl.ts
浏览文件 @
54d778bc
...
...
@@ -86,6 +86,7 @@ export class SideBySideEditorControl implements ISideBySideEditorControl, IVerti
private
static
TITLE_AREA_CONTROL_KEY
=
'
__titleAreaControl
'
;
private
static
PROGRESS_BAR_CONTROL_KEY
=
'
__progressBar
'
;
private
static
INSTANTIATION_SERVICE_KEY
=
'
__instantiationService
'
;
private
static
MIN_EDITOR_WIDTH
=
170
;
private
static
EDITOR_TITLE_HEIGHT
=
35
;
...
...
@@ -97,8 +98,6 @@ export class SideBySideEditorControl implements ISideBySideEditorControl, IVerti
private
dimension
:
Dimension
;
private
dragging
:
boolean
;
private
instantiationServices
:
IInstantiationService
[];
private
silos
:
Builder
[];
private
siloWidths
:
number
[];
private
siloInitialRatios
:
number
[];
...
...
@@ -138,8 +137,6 @@ export class SideBySideEditorControl implements ISideBySideEditorControl, IVerti
this
.
parent
=
parent
;
this
.
dimension
=
new
Dimension
(
0
,
0
);
this
.
instantiationServices
=
[];
this
.
silos
=
[];
this
.
siloWidths
=
[];
...
...
@@ -734,13 +731,14 @@ export class SideBySideEditorControl implements ISideBySideEditorControl, IVerti
const
useTabs
=
!!
this
.
configurationService
.
getConfiguration
<
IWorkbenchEditorConfiguration
>
().
workbench
.
editor
.
showTabs
;
POSITIONS
.
forEach
(
position
=>
{
// Containers (
for title and editor
)
// Containers (
they contain everything and can move between silos
)
const
container
=
$
(
this
.
silos
[
position
]).
div
({
'
class
'
:
'
container
'
});
// InstantiationServices
this
.
instantiationServices
[
position
]
=
this
.
instantiationService
.
createChild
(
new
ServiceCollection
(
const
instantiationService
=
this
.
instantiationService
.
createChild
(
new
ServiceCollection
(
[
IKeybindingService
,
this
.
keybindingService
.
createScoped
(
container
.
getHTMLElement
())]
));
container
.
setProperty
(
SideBySideEditorControl
.
INSTANTIATION_SERVICE_KEY
,
instantiationService
);
// associate with container
// Title containers
const
titleContainer
=
$
(
container
).
div
({
'
class
'
:
'
title
'
});
...
...
@@ -1008,7 +1006,7 @@ export class SideBySideEditorControl implements ISideBySideEditorControl, IVerti
private
createTitleControl
(
position
:
Position
,
container
:
Builder
):
void
{
const
useTabs
=
!!
this
.
configurationService
.
getConfiguration
<
IWorkbenchEditorConfiguration
>
().
workbench
.
editor
.
showTabs
;
const
titleAreaControl
=
this
.
instantiationServices
[
position
]
.
createInstance
<
ITitleAreaControl
>
(
useTabs
?
TabsTitleControl
:
NoTabsTitleControl
);
const
titleAreaControl
=
this
.
getInstantiationService
(
position
)
.
createInstance
<
ITitleAreaControl
>
(
useTabs
?
TabsTitleControl
:
NoTabsTitleControl
);
titleAreaControl
.
create
(
container
.
getHTMLElement
());
titleAreaControl
.
setContext
(
this
.
stacks
.
groupAt
(
position
));
titleAreaControl
.
refresh
();
...
...
@@ -1594,15 +1592,19 @@ export class SideBySideEditorControl implements ISideBySideEditorControl, IVerti
}
public
getInstantiationService
(
position
:
Position
):
IInstantiationService
{
return
this
.
instantiationServices
[
position
]
;
return
this
.
getFromContainer
(
position
,
SideBySideEditorControl
.
INSTANTIATION_SERVICE_KEY
)
;
}
public
getProgressBar
(
position
:
Position
):
ProgressBar
{
return
this
.
silos
[
position
].
child
().
getProperty
(
SideBySideEditorControl
.
PROGRESS_BAR_CONTROL_KEY
);
return
this
.
getFromContainer
(
position
,
SideBySideEditorControl
.
PROGRESS_BAR_CONTROL_KEY
);
}
private
getTitleAreaControl
(
position
:
Position
):
ITitleAreaControl
{
return
this
.
silos
[
position
].
child
().
getProperty
(
SideBySideEditorControl
.
TITLE_AREA_CONTROL_KEY
);
return
this
.
getFromContainer
(
position
,
SideBySideEditorControl
.
TITLE_AREA_CONTROL_KEY
);
}
private
getFromContainer
(
position
:
Position
,
key
:
string
):
any
{
return
this
.
silos
[
position
].
child
().
getProperty
(
key
);
}
public
updateProgress
(
position
:
Position
,
state
:
ProgressState
):
void
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录