Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
徽霖
Vscode
提交
4eb2bf39
V
Vscode
项目概览
徽霖
/
Vscode
通知
9
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,发现更多精彩内容 >>
提交
4eb2bf39
编写于
7月 15, 2019
作者:
M
Matt Bierner
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Use DisposableStore
上级
e93afe17
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
18 addition
and
18 deletion
+18
-18
src/vs/base/browser/ui/sash/sash.ts
src/vs/base/browser/ui/sash/sash.ts
+2
-2
src/vs/workbench/api/node/extHostTask.ts
src/vs/workbench/api/node/extHostTask.ts
+6
-6
src/vs/workbench/contrib/files/browser/views/explorerDecorationsProvider.ts
...ontrib/files/browser/views/explorerDecorationsProvider.ts
+7
-7
src/vs/workbench/contrib/scm/browser/dirtydiffDecorator.ts
src/vs/workbench/contrib/scm/browser/dirtydiffDecorator.ts
+3
-3
未找到文件。
src/vs/base/browser/ui/sash/sash.ts
浏览文件 @
4eb2bf39
...
...
@@ -260,7 +260,7 @@ export class Sash extends Disposable {
style
.
innerHTML
=
`* { cursor:
${
cursor
}
!important; }`
;
};
const
disposables
:
IDisposable
[]
=
[]
;
const
disposables
=
new
DisposableStore
()
;
updateStyle
();
...
...
@@ -284,7 +284,7 @@ export class Sash extends Disposable {
removeClass
(
this
.
el
,
'
active
'
);
this
.
_onDidEnd
.
fire
();
dispos
e
(
disposables
);
dispos
ables
.
dispose
(
);
for
(
const
iframe
of
iframes
)
{
iframe
.
style
.
pointerEvents
=
'
auto
'
;
...
...
src/vs/workbench/api/node/extHostTask.ts
浏览文件 @
4eb2bf39
...
...
@@ -31,7 +31,7 @@ import { ExtHostConfiguration } from 'vs/workbench/api/common/extHostConfigurati
import
{
ExtHostTerminalService
,
ExtHostTerminal
}
from
'
vs/workbench/api/node/extHostTerminalService
'
;
import
{
IWorkspaceFolder
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
CancellationToken
,
CancellationTokenSource
}
from
'
vs/base/common/cancellation
'
;
import
{
IDisposable
,
dispos
e
}
from
'
vs/base/common/lifecycle
'
;
import
{
IDisposable
,
DisposableStor
e
}
from
'
vs/base/common/lifecycle
'
;
import
{
IExtensionDescription
}
from
'
vs/platform/extensions/common/extensions
'
;
namespace
TaskDefinitionDTO
{
...
...
@@ -377,7 +377,7 @@ class CustomExecutionData implements IDisposable {
private
static
waitForDimensionsTimeoutInMs
:
number
=
5000
;
private
_cancellationSource
?:
CancellationTokenSource
;
private
readonly
_onTaskExecutionComplete
:
Emitter
<
CustomExecutionData
>
=
new
Emitter
<
CustomExecutionData
>
();
private
readonly
_disposables
:
IDisposable
[]
=
[]
;
private
readonly
_disposables
=
new
DisposableStore
()
;
private
terminal
?:
vscode
.
Terminal
;
private
terminalId
?:
number
;
public
result
:
number
|
undefined
;
...
...
@@ -389,7 +389,7 @@ class CustomExecutionData implements IDisposable {
public
dispose
():
void
{
this
.
_cancellationSource
=
undefined
;
dispose
(
this
.
_disposables
);
this
.
_disposables
.
dispose
(
);
}
public
get
onTaskExecutionComplete
():
Event
<
CustomExecutionData
>
{
...
...
@@ -426,7 +426,7 @@ class CustomExecutionData implements IDisposable {
const
callbackTerminals
:
vscode
.
Terminal
[]
=
this
.
terminalService
.
terminals
.
filter
((
terminal
)
=>
terminal
.
_id
===
terminalId
);
if
(
!
callbackTerminals
||
callbackTerminals
.
length
===
0
)
{
this
.
_disposables
.
push
(
this
.
terminalService
.
onDidOpenTerminal
(
this
.
onDidOpenTerminal
.
bind
(
this
)));
this
.
_disposables
.
add
(
this
.
terminalService
.
onDidOpenTerminal
(
this
.
onDidOpenTerminal
.
bind
(
this
)));
return
;
}
...
...
@@ -462,9 +462,9 @@ class CustomExecutionData implements IDisposable {
}
this
.
_cancellationSource
=
new
CancellationTokenSource
();
this
.
_disposables
.
push
(
this
.
_cancellationSource
);
this
.
_disposables
.
add
(
this
.
_cancellationSource
);
this
.
_disposables
.
push
(
this
.
terminalService
.
onDidCloseTerminal
(
this
.
onDidCloseTerminal
.
bind
(
this
)));
this
.
_disposables
.
add
(
this
.
terminalService
.
onDidCloseTerminal
(
this
.
onDidCloseTerminal
.
bind
(
this
)));
// Regardless of how the task completes, we are done with this custom execution task.
this
.
customExecution
.
callback
(
terminalRenderer
,
this
.
_cancellationSource
.
token
).
then
(
...
...
src/vs/workbench/contrib/files/browser/views/explorerDecorationsProvider.ts
浏览文件 @
4eb2bf39
...
...
@@ -9,23 +9,23 @@ import { localize } from 'vs/nls';
import
{
IWorkspaceContextService
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
IDecorationsProvider
,
IDecorationData
}
from
'
vs/workbench/services/decorations/browser/decorations
'
;
import
{
listInvalidItemForeground
}
from
'
vs/platform/theme/common/colorRegistry
'
;
import
{
dispose
,
IDisposabl
e
}
from
'
vs/base/common/lifecycle
'
;
import
{
DisposableStor
e
}
from
'
vs/base/common/lifecycle
'
;
import
{
IExplorerService
}
from
'
vs/workbench/contrib/files/common/files
'
;
export
class
ExplorerDecorationsProvider
implements
IDecorationsProvider
{
readonly
label
:
string
=
localize
(
'
label
'
,
"
Explorer
"
);
private
_onDidChange
=
new
Emitter
<
URI
[]
>
();
private
toDispose
:
IDisposable
[]
;
private
readonly
toDispose
=
new
DisposableStore
()
;
constructor
(
@
IExplorerService
private
explorerService
:
IExplorerService
,
@
IWorkspaceContextService
contextService
:
IWorkspaceContextService
)
{
this
.
toDispose
=
[]
;
this
.
toDispose
.
push
(
contextService
.
onDidChangeWorkspaceFolders
(
e
=>
{
this
.
toDispose
.
add
(
this
.
_onDidChange
)
;
this
.
toDispose
.
add
(
contextService
.
onDidChangeWorkspaceFolders
(
e
=>
{
this
.
_onDidChange
.
fire
(
e
.
changed
.
concat
(
e
.
added
).
map
(
wf
=>
wf
.
uri
));
}));
this
.
toDispose
.
push
(
explorerService
.
onDidChangeItem
(
change
=>
{
this
.
toDispose
.
add
(
explorerService
.
onDidChangeItem
(
change
=>
{
if
(
change
.
item
)
{
this
.
_onDidChange
.
fire
([
change
.
item
.
resource
]);
}
...
...
@@ -55,7 +55,7 @@ export class ExplorerDecorationsProvider implements IDecorationsProvider {
return
undefined
;
}
dispose
():
IDisposable
[]
{
return
dispose
(
this
.
toDispose
);
dispose
():
void
{
this
.
toDispose
.
dispose
(
);
}
}
src/vs/workbench/contrib/scm/browser/dirtydiffDecorator.ts
浏览文件 @
4eb2bf39
...
...
@@ -1158,7 +1158,7 @@ export class DirtyDiffWorkbenchController extends Disposable implements ext.IWor
private
enabled
=
false
;
private
models
:
ITextModel
[]
=
[];
private
items
:
{
[
modelId
:
string
]:
DirtyDiffItem
;
}
=
Object
.
create
(
null
);
private
transientDisposables
:
IDisposable
[]
=
[]
;
private
readonly
transientDisposables
=
this
.
_register
(
new
DisposableStore
())
;
private
stylesheet
:
HTMLStyleElement
;
constructor
(
...
...
@@ -1204,7 +1204,7 @@ export class DirtyDiffWorkbenchController extends Disposable implements ext.IWor
this
.
disable
();
}
this
.
transientDisposables
.
push
(
this
.
editorService
.
onDidVisibleEditorsChange
(()
=>
this
.
onEditorsChanged
()));
this
.
transientDisposables
.
add
(
this
.
editorService
.
onDidVisibleEditorsChange
(()
=>
this
.
onEditorsChanged
()));
this
.
onEditorsChanged
();
this
.
enabled
=
true
;
}
...
...
@@ -1214,7 +1214,7 @@ export class DirtyDiffWorkbenchController extends Disposable implements ext.IWor
return
;
}
this
.
transientDisposables
=
dispose
(
this
.
transientDisposables
);
this
.
transientDisposables
.
clear
(
);
this
.
models
.
forEach
(
m
=>
this
.
items
[
m
.
id
].
dispose
());
this
.
models
=
[];
this
.
items
=
Object
.
create
(
null
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录