Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
11fbd970
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,发现更多精彩内容 >>
提交
11fbd970
编写于
4月 29, 2018
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
grid - introduce some simple tests for next editor part
上级
35a8792d
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
67 addition
and
10 deletion
+67
-10
src/vs/workbench/browser/parts/editor2/nextEditorPart.ts
src/vs/workbench/browser/parts/editor2/nextEditorPart.ts
+14
-6
src/vs/workbench/services/editor/common/nextEditorGroupsService.ts
...rkbench/services/editor/common/nextEditorGroupsService.ts
+3
-3
src/vs/workbench/test/browser/parts/editor/editorStacksModel.test.ts
...bench/test/browser/parts/editor/editorStacksModel.test.ts
+0
-1
src/vs/workbench/test/browser/parts/editor2/nextEditorPart.test.ts
...rkbench/test/browser/parts/editor2/nextEditorPart.test.ts
+50
-0
未找到文件。
src/vs/workbench/browser/parts/editor2/nextEditorPart.ts
浏览文件 @
11fbd970
...
...
@@ -63,12 +63,12 @@ export class NextEditorPart extends Part implements INextEditorGroupsService {
return
this
.
_groups
.
get
(
identifier
);
}
isGroupActive
(
identifier
:
GroupIdentifier
):
boolean
{
return
this
.
_activeGroup
&&
this
.
_activeGroup
.
id
===
identifier
;
isGroupActive
(
group
:
NextEditorGroupView
|
GroupIdentifier
):
boolean
{
return
this
.
_activeGroup
&&
this
.
_activeGroup
===
this
.
asGroupView
(
group
)
;
}
setGroupActive
(
identifier
:
GroupIdentifier
):
NextEditorGroupView
{
const
groupView
=
this
.
getGroup
(
identifier
);
setGroupActive
(
group
:
NextEditorGroupView
|
GroupIdentifier
):
NextEditorGroupView
{
const
groupView
=
this
.
asGroupView
(
group
);
if
(
groupView
)
{
this
.
doSetGroupActive
(
groupView
);
}
...
...
@@ -76,11 +76,11 @@ export class NextEditorPart extends Part implements INextEditorGroupsService {
return
groupView
;
}
addGroup
(
fromGroup
:
NextEditorGroupView
,
direction
:
Direction
):
NextEditorGroupView
{
addGroup
(
fromGroup
:
NextEditorGroupView
|
GroupIdentifier
,
direction
:
Direction
):
NextEditorGroupView
{
const
groupView
=
this
.
doCreateGroupView
();
this
.
gridWidget
.
splitView
(
this
.
_groups
.
get
(
fromGroup
.
id
),
this
.
asGroupView
(
fromGroup
),
this
.
toGridViewDirection
(
direction
),
groupView
,
direction
===
Direction
.
DOWN
?
this
.
dimension
.
height
/
2
:
this
.
dimension
.
width
/
2
/* TODO@grid what size? */
);
...
...
@@ -97,6 +97,14 @@ export class NextEditorPart extends Part implements INextEditorGroupsService {
}
}
private
asGroupView
(
group
:
NextEditorGroupView
|
GroupIdentifier
):
NextEditorGroupView
{
if
(
typeof
group
===
'
number
'
)
{
return
this
.
getGroup
(
group
);
}
return
group
;
}
private
doCreateGridView
():
void
{
// Container
...
...
src/vs/workbench/services/editor/common/nextEditorGroupsService.ts
浏览文件 @
11fbd970
...
...
@@ -46,8 +46,8 @@ export interface INextEditorGroupsService {
getGroup
(
identifier
:
GroupIdentifier
):
INextEditorGroup
;
isGroupActive
(
identifier
:
GroupIdentifier
):
boolean
;
setGroupActive
(
identifier
:
GroupIdentifier
):
INextEditorGroup
;
isGroupActive
(
group
:
INextEditorGroup
|
GroupIdentifier
):
boolean
;
setGroupActive
(
group
:
INextEditorGroup
|
GroupIdentifier
):
INextEditorGroup
;
addGroup
(
fromGroup
:
INextEditorGroup
,
direction
:
Direction
):
INextEditorGroup
;
addGroup
(
fromGroup
:
INextEditorGroup
|
GroupIdentifier
,
direction
:
Direction
):
INextEditorGroup
;
}
\ No newline at end of file
src/vs/workbench/test/browser/parts/editor/editorStacksModel.test.ts
浏览文件 @
11fbd970
...
...
@@ -151,7 +151,6 @@ class TestFileEditorInput extends EditorInput implements IFileEditorInput {
return
other
&&
this
.
id
===
other
.
id
&&
other
instanceof
TestFileEditorInput
;
}
public
setEncoding
(
encoding
:
string
)
{
}
...
...
src/vs/workbench/test/browser/parts/editor2/nextEditorPart.test.ts
0 → 100644
浏览文件 @
11fbd970
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'
use strict
'
;
import
*
as
assert
from
'
assert
'
;
import
{
NextEditorPart
}
from
'
vs/workbench/browser/parts/editor2/nextEditorPart
'
;
import
{
workbenchInstantiationService
}
from
'
vs/workbench/test/workbenchTestServices
'
;
import
{
Direction
}
from
'
vs/workbench/services/editor/common/nextEditorGroupsService
'
;
import
{
Dimension
}
from
'
vs/base/browser/dom
'
;
suite
(
'
editor2 tests
'
,
()
=>
{
test
(
'
Groups basics
'
,
function
()
{
const
instantiationService
=
workbenchInstantiationService
();
const
part
=
instantiationService
.
createInstance
(
NextEditorPart
,
'
id
'
);
part
.
create
(
document
.
createElement
(
'
div
'
));
part
.
layout
(
new
Dimension
(
400
,
300
));
let
activeGroupChangeCounter
=
0
;
const
activeGroupChangeListener
=
part
.
onDidActiveGroupChange
(()
=>
{
activeGroupChangeCounter
++
;
});
// always a root group
const
rootGroup
=
part
.
groups
[
0
];
assert
.
equal
(
part
.
groups
.
length
,
1
);
assert
.
ok
(
part
.
isGroupActive
(
rootGroup
));
const
rightGroup
=
part
.
addGroup
(
rootGroup
,
Direction
.
RIGHT
);
assert
.
equal
(
part
.
groups
.
length
,
2
);
assert
.
ok
(
part
.
isGroupActive
(
rootGroup
));
assert
.
equal
(
activeGroupChangeCounter
,
0
);
part
.
setGroupActive
(
rightGroup
);
assert
.
ok
(
part
.
isGroupActive
(
rightGroup
));
assert
.
equal
(
activeGroupChangeCounter
,
1
);
const
downGroup
=
part
.
addGroup
(
rightGroup
,
Direction
.
DOWN
);
assert
.
equal
(
part
.
groups
.
length
,
3
);
assert
.
ok
(
part
.
isGroupActive
(
rightGroup
));
assert
.
ok
(
!
downGroup
.
activeEditor
);
activeGroupChangeListener
.
dispose
();
});
});
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录