Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
2cfc8172
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,发现更多精彩内容 >>
提交
2cfc8172
编写于
7月 28, 2019
作者:
S
Sandeep Somavarapu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix #77088
上级
52f0c468
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
23 addition
and
9 deletion
+23
-9
src/vs/workbench/browser/parts/views/views.ts
src/vs/workbench/browser/parts/views/views.ts
+23
-9
未找到文件。
src/vs/workbench/browser/parts/views/views.ts
浏览文件 @
2cfc8172
...
...
@@ -238,6 +238,9 @@ export class ContributableViewsModel extends Disposable {
private
_onDidMove
=
this
.
_register
(
new
Emitter
<
{
from
:
IViewDescriptorRef
;
to
:
IViewDescriptorRef
;
}
>
());
readonly
onDidMove
:
Event
<
{
from
:
IViewDescriptorRef
;
to
:
IViewDescriptorRef
;
}
>
=
this
.
_onDidMove
.
event
;
private
_onDidChangeViewState
=
this
.
_register
(
new
Emitter
<
IViewDescriptorRef
>
());
protected
readonly
onDidChangeViewState
:
Event
<
IViewDescriptorRef
>
=
this
.
_onDidChangeViewState
.
event
;
constructor
(
container
:
ViewContainer
,
viewsService
:
IViewsService
,
...
...
@@ -301,8 +304,11 @@ export class ContributableViewsModel extends Disposable {
}
setCollapsed
(
id
:
string
,
collapsed
:
boolean
):
void
{
const
{
state
}
=
this
.
find
(
id
);
state
.
collapsed
=
collapsed
;
const
{
index
,
state
,
viewDescriptor
}
=
this
.
find
(
id
);
if
(
state
.
collapsed
!==
collapsed
)
{
state
.
collapsed
=
collapsed
;
this
.
_onDidChangeViewState
.
fire
({
viewDescriptor
,
index
});
}
}
getSize
(
id
:
string
):
number
|
undefined
{
...
...
@@ -316,8 +322,11 @@ export class ContributableViewsModel extends Disposable {
}
setSize
(
id
:
string
,
size
:
number
):
void
{
const
{
state
}
=
this
.
find
(
id
);
state
.
size
=
size
;
const
{
index
,
state
,
viewDescriptor
}
=
this
.
find
(
id
);
if
(
state
.
size
!==
size
)
{
state
.
size
=
size
;
this
.
_onDidChangeViewState
.
fire
({
viewDescriptor
,
index
});
}
}
move
(
from
:
string
,
to
:
string
):
void
{
...
...
@@ -474,12 +483,15 @@ export class PersistentContributableViewsModel extends ContributableViewsModel {
this
.
hiddenViewsStorageId
=
hiddenViewsStorageId
;
this
.
storageService
=
storageService
;
this
.
_register
(
this
.
onDidAdd
(
viewDescriptorRefs
=>
this
.
saveVisibilityStates
(
viewDescriptorRefs
.
map
(
r
=>
r
.
viewDescriptor
))));
this
.
_register
(
this
.
onDidRemove
(
viewDescriptorRefs
=>
this
.
saveVisibilityStates
(
viewDescriptorRefs
.
map
(
r
=>
r
.
viewDescriptor
))));
this
.
_register
(
this
.
storageService
.
onWillSaveState
(()
=>
this
.
saveViewsStates
()));
this
.
_register
(
Event
.
any
(
this
.
onDidAdd
,
this
.
onDidRemove
,
Event
.
map
(
this
.
onDidMove
,
({
from
,
to
})
=>
[
from
,
to
]),
Event
.
map
(
this
.
onDidChangeViewState
,
viewDescriptorRef
=>
[
viewDescriptorRef
]))
(
viewDescriptorRefs
=>
this
.
saveViewsStates
(
viewDescriptorRefs
.
map
(
r
=>
r
.
viewDescriptor
))));
}
private
saveViewsStates
():
void
{
private
saveViewsStates
(
viewDescriptors
:
IViewDescriptor
[]
):
void
{
const
storedViewsStates
:
{
[
id
:
string
]:
{
collapsed
:
boolean
,
size
?:
number
,
order
?:
number
}
}
=
{};
let
hasState
=
false
;
...
...
@@ -496,6 +508,8 @@ export class PersistentContributableViewsModel extends ContributableViewsModel {
}
else
{
this
.
storageService
.
remove
(
this
.
viewletStateStorageId
,
StorageScope
.
WORKSPACE
);
}
this
.
saveVisibilityStates
(
viewDescriptors
);
}
private
saveVisibilityStates
(
viewDescriptors
:
IViewDescriptor
[]):
void
{
...
...
@@ -725,4 +739,4 @@ export function createFileIconThemableTreeContainerScope(container: HTMLElement,
return
themeService
.
onDidFileIconThemeChange
(
onDidChangeFileIconTheme
);
}
registerSingleton
(
IViewsService
,
ViewsService
);
\ No newline at end of file
registerSingleton
(
IViewsService
,
ViewsService
);
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录