Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
1e2e8fb3
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,发现更多精彩内容 >>
提交
1e2e8fb3
编写于
5月 13, 2018
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
grid - drop editor group label
上级
01bf9616
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
6 addition
and
57 deletion
+6
-57
src/vs/workbench/browser/parts/editor/editorPicker.ts
src/vs/workbench/browser/parts/editor/editorPicker.ts
+1
-1
src/vs/workbench/browser/parts/editor2/nextEditorGroupView.ts
...vs/workbench/browser/parts/editor2/nextEditorGroupView.ts
+1
-3
src/vs/workbench/common/editor.ts
src/vs/workbench/common/editor.ts
+0
-2
src/vs/workbench/common/editor/editorStacksModel.ts
src/vs/workbench/common/editor/editorStacksModel.ts
+3
-31
src/vs/workbench/parts/files/electron-browser/views/openEditorsView.ts
...nch/parts/files/electron-browser/views/openEditorsView.ts
+1
-1
src/vs/workbench/test/browser/parts/editor/editorStacksModel.test.ts
...bench/test/browser/parts/editor/editorStacksModel.test.ts
+0
-19
未找到文件。
src/vs/workbench/browser/parts/editor/editorPicker.ts
浏览文件 @
1e2e8fb3
...
...
@@ -139,7 +139,7 @@ export abstract class BaseEditorPicker extends QuickOpenHandler {
let
lastGroup
:
IEditorGroup
;
entries
.
forEach
(
e
=>
{
if
(
!
lastGroup
||
lastGroup
!==
e
.
group
)
{
e
.
setGroupLabel
(
nls
.
localize
(
'
groupLabel
'
,
"
Group: {0}
"
,
e
.
group
.
label
));
e
.
setGroupLabel
(
nls
.
localize
(
'
groupLabel
'
,
"
Group: {0}
"
,
e
.
group
.
id
));
e
.
setShowBorder
(
!!
lastGroup
);
lastGroup
=
e
.
group
;
}
...
...
src/vs/workbench/browser/parts/editor2/nextEditorGroupView.ts
浏览文件 @
1e2e8fb3
...
...
@@ -126,11 +126,9 @@ export class NextEditorGroupView extends Themable implements INextEditorGroupVie
}
else
if
(
isSerializedEditorGroup
(
from
))
{
this
.
_group
=
this
.
_register
(
instantiationService
.
createInstance
(
EditorGroup
,
from
));
}
else
{
this
.
_group
=
this
.
_register
(
instantiationService
.
createInstance
(
EditorGroup
,
''
));
this
.
_group
=
this
.
_register
(
instantiationService
.
createInstance
(
EditorGroup
,
void
0
));
}
this
.
_group
.
label
=
`Group <
${
this
.
_group
.
id
}
>`
;
// TODO@grid find a way to have a proper label
this
.
disposedEditorsWorker
=
this
.
_register
(
new
RunOnceWorker
(
editors
=>
this
.
handleDisposedEditors
(
editors
),
0
));
this
.
create
();
...
...
src/vs/workbench/common/editor.ts
浏览文件 @
1e2e8fb3
...
...
@@ -786,9 +786,7 @@ export interface IEditorStacksModel {
}
export
interface
IEditorGroup
{
id
:
GroupIdentifier
;
label
:
string
;
count
:
number
;
activeEditor
:
IEditorInput
;
previewEditor
:
IEditorInput
;
...
...
src/vs/workbench/common/editor/editorStacksModel.ts
浏览文件 @
1e2e8fb3
...
...
@@ -39,7 +39,6 @@ export interface ISerializedEditorInput {
export
interface
ISerializedEditorGroup
{
id
:
number
;
label
:
string
;
editors
:
ISerializedEditorInput
[];
mru
:
number
[];
preview
:
number
;
...
...
@@ -87,7 +86,6 @@ export class EditorGroup extends Disposable implements IEditorGroup {
//#endregion
private
_id
:
GroupIdentifier
;
private
_label
:
string
;
private
editors
:
EditorInput
[]
=
[];
private
mru
:
EditorInput
[]
=
[];
...
...
@@ -99,7 +97,7 @@ export class EditorGroup extends Disposable implements IEditorGroup {
private
editorOpenPositioning
:
'
left
'
|
'
right
'
|
'
first
'
|
'
last
'
;
constructor
(
labelOrSerializedGroup
:
string
|
ISerializedEditorGroup
,
labelOrSerializedGroup
:
ISerializedEditorGroup
,
@
IInstantiationService
private
instantiationService
:
IInstantiationService
,
@
IConfigurationService
private
configurationService
:
IConfigurationService
)
{
...
...
@@ -109,7 +107,6 @@ export class EditorGroup extends Disposable implements IEditorGroup {
this
.
deserialize
(
labelOrSerializedGroup
);
}
else
{
this
.
_id
=
EditorGroup
.
IDS
++
;
this
.
_label
=
labelOrSerializedGroup
;
}
this
.
onConfigurationUpdated
();
...
...
@@ -128,14 +125,6 @@ export class EditorGroup extends Disposable implements IEditorGroup {
return
this
.
_id
;
}
get
label
():
string
{
return
this
.
_label
;
}
set
label
(
label
:
string
)
{
this
.
_label
=
label
;
}
get
count
():
number
{
return
this
.
editors
.
length
;
}
...
...
@@ -604,7 +593,7 @@ export class EditorGroup extends Disposable implements IEditorGroup {
}
clone
():
EditorGroup
{
const
group
=
this
.
instantiationService
.
createInstance
(
EditorGroup
,
''
);
const
group
=
this
.
instantiationService
.
createInstance
(
EditorGroup
,
void
0
);
group
.
editors
=
this
.
editors
.
slice
(
0
);
group
.
mru
=
this
.
mru
.
slice
(
0
);
group
.
mapResourceToEditorCount
=
this
.
mapResourceToEditorCount
.
clone
();
...
...
@@ -643,7 +632,6 @@ export class EditorGroup extends Disposable implements IEditorGroup {
return
{
id
:
this
.
id
,
label
:
this
.
label
,
editors
:
serializedEditors
,
mru
:
serializableMru
,
preview
:
serializablePreviewIndex
,
...
...
@@ -661,7 +649,6 @@ export class EditorGroup extends Disposable implements IEditorGroup {
this
.
_id
=
EditorGroup
.
IDS
++
;
// backwards compatibility
}
this
.
_label
=
data
.
label
;
this
.
editors
=
data
.
editors
.
map
(
e
=>
{
const
factory
=
registry
.
getEditorInputFactory
(
e
.
id
);
if
(
factory
)
{
...
...
@@ -858,10 +845,7 @@ export class EditorStacksModel implements IEditorStacksModel {
renameGroup
(
group
:
EditorGroup
,
label
:
string
):
void
{
this
.
ensureLoaded
();
if
(
group
.
label
!==
label
)
{
group
.
label
=
label
;
this
.
fireEvent
(
this
.
_onGroupRenamed
,
group
,
false
);
}
this
.
fireEvent
(
this
.
_onGroupRenamed
,
group
,
false
);
}
closeGroup
(
group
:
EditorGroup
):
void
{
...
...
@@ -1166,10 +1150,6 @@ export class EditorStacksModel implements IEditorStacksModel {
return
6
;
// Invalid preview editor
}
if
(
serialized
.
groups
.
some
(
g
=>
!
g
.
label
))
{
return
7
;
// Group without label
}
return
0
;
}
...
...
@@ -1259,14 +1239,6 @@ export class EditorStacksModel implements IEditorStacksModel {
}
this
.
groups
.
forEach
(
g
=>
{
let
label
=
`Group:
${
g
.
label
}
`
;
if
(
this
.
_activeGroup
===
g
)
{
label
=
`
${
label
}
[active]`
;
}
lines
.
push
(
label
);
g
.
getEditors
().
forEach
(
e
=>
{
let
label
=
`\t
${
e
.
getName
()}
`
;
...
...
src/vs/workbench/parts/files/electron-browser/views/openEditorsView.ts
浏览文件 @
1e2e8fb3
...
...
@@ -506,7 +506,7 @@ class EditorGroupRenderer implements IRenderer<IEditorGroup, IEditorGroupTemplat
renderElement
(
editorGroup
:
IEditorGroup
,
index
:
number
,
templateData
:
IEditorGroupTemplateData
):
void
{
templateData
.
editorGroup
=
editorGroup
;
templateData
.
name
.
textContent
=
editorGroup
.
label
;
templateData
.
name
.
textContent
=
`Group <
${
editorGroup
.
id
}
>`
;
templateData
.
actionBar
.
context
=
{
groupId
:
editorGroup
.
id
};
}
...
...
src/vs/workbench/test/browser/parts/editor/editorStacksModel.test.ts
浏览文件 @
1e2e8fb3
...
...
@@ -293,19 +293,6 @@ suite('Editor Stacks Model', () => {
assert
.
equal
(
events
.
moved
.
length
,
2
);
});
test
(
'
Groups - Move Groups
'
,
function
()
{
const
model
=
create
();
const
events
=
modelListener
(
model
);
model
.
openGroup
(
'
first
'
);
const
group2
=
model
.
openGroup
(
'
second
'
);
model
.
renameGroup
(
group2
,
'
renamed
'
);
assert
.
equal
(
group2
.
label
,
'
renamed
'
);
assert
.
equal
(
group2
,
events
.
renamed
[
0
]);
});
test
(
'
Groups - Position of Group
'
,
function
()
{
const
model
=
create
();
...
...
@@ -1222,7 +1209,6 @@ suite('Editor Stacks Model', () => {
assert
.
equal
(
group
.
count
,
1
);
assert
.
equal
(
group
.
activeEditor
.
matches
(
input1
),
true
);
assert
.
equal
(
group
.
previewEditor
.
matches
(
input1
),
true
);
assert
.
equal
(
group
.
label
,
'
group
'
);
assert
.
equal
(
group
.
isActive
(
input1
),
true
);
lifecycle
.
fireShutdown
();
...
...
@@ -1237,7 +1223,6 @@ suite('Editor Stacks Model', () => {
assert
.
equal
(
group
.
count
,
1
);
assert
.
equal
(
group
.
activeEditor
.
matches
(
input1
),
true
);
assert
.
equal
(
group
.
previewEditor
.
matches
(
input1
),
true
);
assert
.
equal
(
group
.
label
,
'
group
'
);
assert
.
equal
(
group
.
isActive
(
input1
),
true
);
});
...
...
@@ -1286,8 +1271,6 @@ suite('Editor Stacks Model', () => {
assert
.
equal
(
group2
.
activeEditor
.
matches
(
g2_input1
),
true
);
assert
.
equal
(
group1
.
previewEditor
.
matches
(
g1_input2
),
true
);
assert
.
equal
(
group2
.
previewEditor
.
matches
(
g2_input2
),
true
);
assert
.
equal
(
group1
.
label
,
'
group1
'
);
assert
.
equal
(
group2
.
label
,
'
group2
'
);
assert
.
equal
(
group1
.
getEditors
(
true
)[
0
].
matches
(
g1_input2
),
true
);
assert
.
equal
(
group1
.
getEditors
(
true
)[
1
].
matches
(
g1_input1
),
true
);
...
...
@@ -1312,8 +1295,6 @@ suite('Editor Stacks Model', () => {
assert
.
equal
(
group2
.
activeEditor
.
matches
(
g2_input1
),
true
);
assert
.
equal
(
group1
.
previewEditor
.
matches
(
g1_input2
),
true
);
assert
.
equal
(
group2
.
previewEditor
.
matches
(
g2_input2
),
true
);
assert
.
equal
(
group1
.
label
,
'
group1
'
);
assert
.
equal
(
group2
.
label
,
'
group2
'
);
assert
.
equal
(
group1
.
getEditors
(
true
)[
0
].
matches
(
g1_input2
),
true
);
assert
.
equal
(
group1
.
getEditors
(
true
)[
1
].
matches
(
g1_input1
),
true
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录