Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
a67b138d
V
vscode
项目概览
掘金者说
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
a67b138d
编写于
7月 03, 2019
作者:
J
Joao Moreno
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
use es6 maps in mainThreadSCM
related to #76442
上级
638d3996
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
22 addition
and
24 deletion
+22
-24
src/vs/workbench/api/browser/mainThreadSCM.ts
src/vs/workbench/api/browser/mainThreadSCM.ts
+22
-24
未找到文件。
src/vs/workbench/api/browser/mainThreadSCM.ts
浏览文件 @
a67b138d
...
...
@@ -266,8 +266,8 @@ class MainThreadSCMProvider implements ISCMProvider {
export
class
MainThreadSCM
implements
MainThreadSCMShape
{
private
readonly
_proxy
:
ExtHostSCMShape
;
private
_repositories
:
{
[
handle
:
number
]:
ISCMRepository
;
}
=
Object
.
create
(
null
);
private
_inputDisposables
:
{
[
handle
:
number
]:
IDisposable
;
}
=
Object
.
create
(
null
);
private
_repositories
=
new
Map
<
number
,
ISCMRepository
>
(
);
private
_inputDisposables
=
new
Map
<
number
,
IDisposable
>
(
);
private
readonly
_disposables
=
new
DisposableStore
();
constructor
(
...
...
@@ -281,13 +281,11 @@ export class MainThreadSCM implements MainThreadSCMShape {
}
dispose
():
void
{
Object
.
keys
(
this
.
_repositories
)
.
forEach
(
id
=>
this
.
_repositories
[
id
].
dispose
());
this
.
_repositories
=
Object
.
create
(
null
);
this
.
_repositories
.
forEach
(
r
=>
r
.
dispose
());
this
.
_repositories
.
clear
();
Object
.
keys
(
this
.
_inputDisposables
)
.
forEach
(
id
=>
this
.
_inputDisposables
[
id
].
dispose
());
this
.
_inputDisposables
=
Object
.
create
(
null
);
this
.
_inputDisposables
.
forEach
(
d
=>
d
.
dispose
());
this
.
_inputDisposables
.
clear
();
this
.
_disposables
.
dispose
();
}
...
...
@@ -295,14 +293,14 @@ export class MainThreadSCM implements MainThreadSCMShape {
$registerSourceControl
(
handle
:
number
,
id
:
string
,
label
:
string
,
rootUri
:
UriComponents
|
undefined
):
void
{
const
provider
=
new
MainThreadSCMProvider
(
this
.
_proxy
,
handle
,
id
,
label
,
rootUri
&&
URI
.
revive
(
rootUri
),
this
.
scmService
);
const
repository
=
this
.
scmService
.
registerSCMProvider
(
provider
);
this
.
_repositories
[
handle
]
=
repository
;
this
.
_repositories
.
set
(
handle
,
repository
)
;
const
inputDisposable
=
repository
.
input
.
onDidChange
(
value
=>
this
.
_proxy
.
$onInputBoxValueChange
(
handle
,
value
));
this
.
_inputDisposables
[
handle
]
=
inputDisposable
;
this
.
_inputDisposables
.
set
(
handle
,
inputDisposable
)
;
}
$updateSourceControl
(
handle
:
number
,
features
:
SCMProviderFeatures
):
void
{
const
repository
=
this
.
_repositories
[
handle
]
;
const
repository
=
this
.
_repositories
.
get
(
handle
)
;
if
(
!
repository
)
{
return
;
...
...
@@ -313,21 +311,21 @@ export class MainThreadSCM implements MainThreadSCMShape {
}
$unregisterSourceControl
(
handle
:
number
):
void
{
const
repository
=
this
.
_repositories
[
handle
]
;
const
repository
=
this
.
_repositories
.
get
(
handle
)
;
if
(
!
repository
)
{
return
;
}
this
.
_inputDisposables
[
handle
]
.
dispose
();
delete
this
.
_inputDisposables
[
handle
]
;
this
.
_inputDisposables
.
get
(
handle
)
!
.
dispose
();
this
.
_inputDisposables
.
delete
(
handle
)
;
repository
.
dispose
();
delete
this
.
_repositories
[
handle
]
;
this
.
_repositories
.
delete
(
handle
)
;
}
$registerGroup
(
sourceControlHandle
:
number
,
groupHandle
:
number
,
id
:
string
,
label
:
string
):
void
{
const
repository
=
this
.
_repositories
[
sourceControlHandle
]
;
const
repository
=
this
.
_repositories
.
get
(
sourceControlHandle
)
;
if
(
!
repository
)
{
return
;
...
...
@@ -338,7 +336,7 @@ export class MainThreadSCM implements MainThreadSCMShape {
}
$updateGroup
(
sourceControlHandle
:
number
,
groupHandle
:
number
,
features
:
SCMGroupFeatures
):
void
{
const
repository
=
this
.
_repositories
[
sourceControlHandle
]
;
const
repository
=
this
.
_repositories
.
get
(
sourceControlHandle
)
;
if
(
!
repository
)
{
return
;
...
...
@@ -349,7 +347,7 @@ export class MainThreadSCM implements MainThreadSCMShape {
}
$updateGroupLabel
(
sourceControlHandle
:
number
,
groupHandle
:
number
,
label
:
string
):
void
{
const
repository
=
this
.
_repositories
[
sourceControlHandle
]
;
const
repository
=
this
.
_repositories
.
get
(
sourceControlHandle
)
;
if
(
!
repository
)
{
return
;
...
...
@@ -360,7 +358,7 @@ export class MainThreadSCM implements MainThreadSCMShape {
}
$spliceResourceStates
(
sourceControlHandle
:
number
,
splices
:
SCMRawResourceSplices
[]):
void
{
const
repository
=
this
.
_repositories
[
sourceControlHandle
]
;
const
repository
=
this
.
_repositories
.
get
(
sourceControlHandle
)
;
if
(
!
repository
)
{
return
;
...
...
@@ -371,7 +369,7 @@ export class MainThreadSCM implements MainThreadSCMShape {
}
$unregisterGroup
(
sourceControlHandle
:
number
,
handle
:
number
):
void
{
const
repository
=
this
.
_repositories
[
sourceControlHandle
]
;
const
repository
=
this
.
_repositories
.
get
(
sourceControlHandle
)
;
if
(
!
repository
)
{
return
;
...
...
@@ -382,7 +380,7 @@ export class MainThreadSCM implements MainThreadSCMShape {
}
$setInputBoxValue
(
sourceControlHandle
:
number
,
value
:
string
):
void
{
const
repository
=
this
.
_repositories
[
sourceControlHandle
]
;
const
repository
=
this
.
_repositories
.
get
(
sourceControlHandle
)
;
if
(
!
repository
)
{
return
;
...
...
@@ -392,7 +390,7 @@ export class MainThreadSCM implements MainThreadSCMShape {
}
$setInputBoxPlaceholder
(
sourceControlHandle
:
number
,
placeholder
:
string
):
void
{
const
repository
=
this
.
_repositories
[
sourceControlHandle
]
;
const
repository
=
this
.
_repositories
.
get
(
sourceControlHandle
)
;
if
(
!
repository
)
{
return
;
...
...
@@ -402,7 +400,7 @@ export class MainThreadSCM implements MainThreadSCMShape {
}
$setInputBoxVisibility
(
sourceControlHandle
:
number
,
visible
:
boolean
):
void
{
const
repository
=
this
.
_repositories
[
sourceControlHandle
]
;
const
repository
=
this
.
_repositories
.
get
(
sourceControlHandle
)
;
if
(
!
repository
)
{
return
;
...
...
@@ -412,7 +410,7 @@ export class MainThreadSCM implements MainThreadSCMShape {
}
$setValidationProviderIsEnabled
(
sourceControlHandle
:
number
,
enabled
:
boolean
):
void
{
const
repository
=
this
.
_repositories
[
sourceControlHandle
]
;
const
repository
=
this
.
_repositories
.
get
(
sourceControlHandle
)
;
if
(
!
repository
)
{
return
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录