Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
d57db504
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,发现更多精彩内容 >>
提交
d57db504
编写于
6月 05, 2019
作者:
M
Matt Bierner
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fixing a few possible leaked disposables
上级
3d3f1bae
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
39 addition
and
33 deletion
+39
-33
src/vs/editor/contrib/find/simpleFindWidget.ts
src/vs/editor/contrib/find/simpleFindWidget.ts
+6
-6
src/vs/editor/contrib/suggest/suggestWidget.ts
src/vs/editor/contrib/suggest/suggestWidget.ts
+6
-4
src/vs/platform/actions/common/menuService.ts
src/vs/platform/actions/common/menuService.ts
+8
-13
src/vs/workbench/browser/parts/editor/tabsTitleControl.ts
src/vs/workbench/browser/parts/editor/tabsTitleControl.ts
+1
-1
src/vs/workbench/contrib/extensions/electron-browser/extensionsList.ts
...nch/contrib/extensions/electron-browser/extensionsList.ts
+3
-3
src/vs/workbench/contrib/quickopen/browser/commandsHandler.ts
...vs/workbench/contrib/quickopen/browser/commandsHandler.ts
+10
-4
src/vs/workbench/contrib/webview/electron-browser/webviewElement.ts
...kbench/contrib/webview/electron-browser/webviewElement.ts
+5
-2
未找到文件。
src/vs/editor/contrib/find/simpleFindWidget.ts
浏览文件 @
d57db504
...
...
@@ -99,29 +99,29 @@ export abstract class SimpleFindWidget extends Widget {
}
}));
const
prevBtn
=
new
SimpleButton
({
const
prevBtn
=
this
.
_register
(
new
SimpleButton
({
label
:
NLS_PREVIOUS_MATCH_BTN_LABEL
,
className
:
'
previous
'
,
onTrigger
:
()
=>
{
this
.
find
(
true
);
}
});
})
)
;
const
nextBtn
=
new
SimpleButton
({
const
nextBtn
=
this
.
_register
(
new
SimpleButton
({
label
:
NLS_NEXT_MATCH_BTN_LABEL
,
className
:
'
next
'
,
onTrigger
:
()
=>
{
this
.
find
(
false
);
}
});
})
)
;
const
closeBtn
=
new
SimpleButton
({
const
closeBtn
=
this
.
_register
(
new
SimpleButton
({
label
:
NLS_CLOSE_BTN_LABEL
,
className
:
'
close-fw
'
,
onTrigger
:
()
=>
{
this
.
hide
();
}
});
})
)
;
this
.
_innerDomNode
=
document
.
createElement
(
'
div
'
);
this
.
_innerDomNode
.
classList
.
add
(
'
simple-find-part
'
);
...
...
src/vs/editor/contrib/suggest/suggestWidget.ts
浏览文件 @
d57db504
...
...
@@ -103,7 +103,9 @@ class Renderer implements IListRenderer<CompletionItem, ISuggestionTemplateData>
renderTemplate
(
container
:
HTMLElement
):
ISuggestionTemplateData
{
const
data
=
<
ISuggestionTemplateData
>
Object
.
create
(
null
);
data
.
disposables
=
[];
const
disposables
=
new
DisposableStore
();
data
.
disposables
=
[
disposables
];
data
.
root
=
container
;
addClass
(
data
.
root
,
'
show-file-icons
'
);
...
...
@@ -114,7 +116,7 @@ class Renderer implements IListRenderer<CompletionItem, ISuggestionTemplateData>
const
main
=
append
(
text
,
$
(
'
.main
'
));
data
.
iconLabel
=
new
IconLabel
(
main
,
{
supportHighlights
:
true
});
d
ata
.
disposables
.
push
(
data
.
iconLabel
);
d
isposables
.
add
(
data
.
iconLabel
);
data
.
typeLabel
=
append
(
main
,
$
(
'
span.type-label
'
));
...
...
@@ -142,9 +144,9 @@ class Renderer implements IListRenderer<CompletionItem, ISuggestionTemplateData>
configureFont
();
Event
.
chain
<
IConfigurationChangedEvent
>
(
this
.
editor
.
onDidChangeConfiguration
.
bind
(
this
.
editor
))
disposables
.
add
(
Event
.
chain
<
IConfigurationChangedEvent
>
(
this
.
editor
.
onDidChangeConfiguration
.
bind
(
this
.
editor
))
.
filter
(
e
=>
e
.
fontInfo
||
e
.
contribInfo
)
.
on
(
configureFont
,
null
,
data
.
disposables
);
.
on
(
configureFont
,
null
)
);
return
data
;
}
...
...
src/vs/platform/actions/common/menuService.ts
浏览文件 @
d57db504
...
...
@@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
import
{
Emitter
,
Event
}
from
'
vs/base/common/event
'
;
import
{
dispose
,
I
Disposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
Disposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
IMenu
,
IMenuActionOptions
,
IMenuItem
,
IMenuService
,
isIMenuItem
,
ISubmenuItem
,
MenuId
,
MenuItemAction
,
MenuRegistry
,
SubmenuItemAction
}
from
'
vs/platform/actions/common/actions
'
;
import
{
ICommandService
}
from
'
vs/platform/commands/common/commands
'
;
import
{
ContextKeyExpr
,
IContextKeyService
,
IContextKeyChangeEvent
}
from
'
vs/platform/contextkey/common/contextkey
'
;
...
...
@@ -27,10 +27,9 @@ export class MenuService implements IMenuService {
type
MenuItemGroup
=
[
string
,
Array
<
IMenuItem
|
ISubmenuItem
>
];
class
Menu
implements
IMenu
{
class
Menu
extends
Disposable
implements
IMenu
{
private
readonly
_onDidChange
=
new
Emitter
<
IMenu
|
undefined
>
();
private
readonly
_disposables
:
IDisposable
[]
=
[];
private
readonly
_onDidChange
=
this
.
_register
(
new
Emitter
<
IMenu
|
undefined
>
());
private
_menuGroups
:
MenuItemGroup
[];
private
_contextKeys
:
Set
<
string
>
;
...
...
@@ -40,23 +39,24 @@ class Menu implements IMenu {
@
ICommandService
private
readonly
_commandService
:
ICommandService
,
@
IContextKeyService
private
readonly
_contextKeyService
:
IContextKeyService
)
{
super
();
this
.
_build
();
// rebuild this menu whenever the menu registry reports an
// event for this MenuId
Event
.
debounce
(
this
.
_register
(
Event
.
debounce
(
Event
.
filter
(
MenuRegistry
.
onDidChangeMenu
,
menuId
=>
menuId
===
this
.
_id
),
()
=>
{
},
50
)(
this
.
_build
,
this
,
this
.
_disposables
);
)(
this
.
_build
,
this
)
);
// when context keys change we need to check if the menu also
// has changed
Event
.
debounce
<
IContextKeyChangeEvent
,
boolean
>
(
this
.
_register
(
Event
.
debounce
<
IContextKeyChangeEvent
,
boolean
>
(
this
.
_contextKeyService
.
onDidChangeContext
,
(
last
,
event
)
=>
last
||
event
.
affectsSome
(
this
.
_contextKeys
),
50
)(
e
=>
e
&&
this
.
_onDidChange
.
fire
(
undefined
),
this
,
this
.
_disposables
);
)(
e
=>
e
&&
this
.
_onDidChange
.
fire
(
undefined
),
this
)
);
}
private
_build
():
void
{
...
...
@@ -95,11 +95,6 @@ class Menu implements IMenu {
this
.
_onDidChange
.
fire
(
this
);
}
dispose
()
{
dispose
(
this
.
_disposables
);
this
.
_onDidChange
.
dispose
();
}
get
onDidChange
():
Event
<
IMenu
|
undefined
>
{
return
this
.
_onDidChange
.
event
;
}
...
...
src/vs/workbench/browser/parts/editor/tabsTitleControl.ts
浏览文件 @
d57db504
...
...
@@ -107,7 +107,7 @@ export class TabsTitleControl extends TitleControl {
this
.
registerTabsContainerListeners
();
// Tabs Scrollbar
this
.
tabsScrollbar
=
this
.
createTabsScrollbar
(
this
.
tabsContainer
);
this
.
tabsScrollbar
=
this
.
_register
(
this
.
createTabsScrollbar
(
this
.
tabsContainer
)
);
tabsAndActionsContainer
.
appendChild
(
this
.
tabsScrollbar
.
getDomNode
());
// Editor Toolbar Container
...
...
src/vs/workbench/contrib/extensions/electron-browser/extensionsList.ts
浏览文件 @
d57db504
...
...
@@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
import
{
append
,
$
,
addClass
,
removeClass
,
toggleClass
}
from
'
vs/base/browser/dom
'
;
import
{
IDisposable
,
dispose
}
from
'
vs/base/common/lifecycle
'
;
import
{
IDisposable
,
dispose
,
combinedDisposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
Action
}
from
'
vs/base/common/actions
'
;
import
{
ActionBar
}
from
'
vs/base/browser/ui/actionbar/actionbar
'
;
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
...
...
@@ -116,10 +116,10 @@ export class Renderer implements IPagedRenderer<IExtension, ITemplateData> {
const
extensionContainers
:
ExtensionContainers
=
this
.
instantiationService
.
createInstance
(
ExtensionContainers
,
[...
actions
,
...
widgets
,
disabledLabelAction
]);
actionbar
.
push
(
actions
,
actionOptions
);
const
disposables
=
[...
actions
,
...
widgets
,
actionbar
,
extensionContainers
]
;
const
disposables
=
combinedDisposable
(...
actions
,
...
widgets
,
actionbar
,
extensionContainers
)
;
return
{
root
,
element
,
icon
,
name
,
installCount
,
ratings
,
author
,
description
,
disposables
,
actionbar
,
root
,
element
,
icon
,
name
,
installCount
,
ratings
,
author
,
description
,
disposables
:
[
disposables
]
,
actionbar
,
extensionDisposables
:
[],
set
extension
(
extension
:
IExtension
)
{
extensionContainers
.
extension
=
extension
;
...
...
src/vs/workbench/contrib/quickopen/browser/commandsHandler.ts
浏览文件 @
d57db504
...
...
@@ -30,7 +30,7 @@ import { ICodeEditor } from 'vs/editor/browser/editorBrowser';
import
{
INotificationService
}
from
'
vs/platform/notification/common/notification
'
;
import
{
CancellationToken
}
from
'
vs/base/common/cancellation
'
;
import
{
IExtensionService
}
from
'
vs/workbench/services/extensions/common/extensions
'
;
import
{
Disposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
Disposable
,
DisposableStore
,
IDisposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
timeout
}
from
'
vs/base/common/async
'
;
export
const
ALL_COMMANDS_PREFIX
=
'
>
'
;
...
...
@@ -377,12 +377,14 @@ class ActionCommandEntry extends BaseCommandEntry {
const
wordFilter
=
or
(
matchesPrefix
,
matchesWords
,
matchesContiguousSubString
);
export
class
CommandsHandler
extends
QuickOpenHandler
{
export
class
CommandsHandler
extends
QuickOpenHandler
implements
IDisposable
{
static
readonly
ID
=
'
workbench.picker.commands
'
;
private
commandHistoryEnabled
:
boolean
;
private
commandsHistory
:
CommandsHistory
;
private
readonly
commandsHistory
:
CommandsHistory
;
private
readonly
disposables
=
new
DisposableStore
();
private
waitedForExtensionsRegistered
:
boolean
;
...
...
@@ -396,7 +398,7 @@ export class CommandsHandler extends QuickOpenHandler {
)
{
super
();
this
.
commandsHistory
=
this
.
instantiationService
.
createInstance
(
CommandsHistory
);
this
.
commandsHistory
=
this
.
disposables
.
add
(
this
.
instantiationService
.
createInstance
(
CommandsHistory
)
);
this
.
extensionService
.
whenInstalledExtensionsRegistered
().
then
(()
=>
this
.
waitedForExtensionsRegistered
=
true
);
...
...
@@ -588,6 +590,10 @@ export class CommandsHandler extends QuickOpenHandler {
getEmptyLabel
(
searchString
:
string
):
string
{
return
nls
.
localize
(
'
noCommandsMatching
'
,
"
No commands matching
"
);
}
dispose
()
{
this
.
disposables
.
dispose
();
}
}
registerEditorAction
(
CommandPaletteEditorAction
);
src/vs/workbench/contrib/webview/electron-browser/webviewElement.ts
浏览文件 @
d57db504
...
...
@@ -532,10 +532,13 @@ export class WebviewElement extends Disposable implements Webview {
if
(
this
.
_webview
.
parentElement
)
{
this
.
_webview
.
parentElement
.
removeChild
(
this
.
_webview
);
}
this
.
_webview
=
undefined
;
}
this
.
_webview
=
undefined
;
this
.
_webviewFindWidget
=
undefined
;
if
(
this
.
_webviewFindWidget
)
{
this
.
_webviewFindWidget
.
dispose
();
this
.
_webviewFindWidget
=
undefined
;
}
super
.
dispose
();
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录