Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
30d11145
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,发现更多精彩内容 >>
提交
30d11145
编写于
5月 24, 2019
作者:
M
Matt Bierner
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Replacing a few instances of IDisposable[]
上级
95924674
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
61 addition
and
72 deletion
+61
-72
src/vs/base/browser/ui/menu/menu.ts
src/vs/base/browser/ui/menu/menu.ts
+9
-11
src/vs/base/browser/ui/sash/sash.ts
src/vs/base/browser/ui/sash/sash.ts
+7
-10
src/vs/editor/contrib/codeAction/test/codeAction.test.ts
src/vs/editor/contrib/codeAction/test/codeAction.test.ts
+5
-4
src/vs/editor/contrib/codeAction/test/codeActionModel.test.ts
...vs/editor/contrib/codeAction/test/codeActionModel.test.ts
+4
-4
src/vs/editor/contrib/dnd/dnd.ts
src/vs/editor/contrib/dnd/dnd.ts
+11
-12
src/vs/workbench/contrib/extensions/common/extensionsUtils.ts
...vs/workbench/contrib/extensions/common/extensionsUtils.ts
+8
-15
src/vs/workbench/contrib/preferences/browser/preferencesActions.ts
...rkbench/contrib/preferences/browser/preferencesActions.ts
+4
-4
src/vs/workbench/contrib/preferences/common/preferencesContribution.ts
...nch/contrib/preferences/common/preferencesContribution.ts
+3
-3
src/vs/workbench/contrib/terminal/browser/terminalLinkHandler.ts
...workbench/contrib/terminal/browser/terminalLinkHandler.ts
+4
-3
src/vs/workbench/services/textfile/test/textFileService.io.test.ts
...rkbench/services/textfile/test/textFileService.io.test.ts
+3
-3
src/vs/workbench/test/electron-browser/api/extHostSearch.test.ts
...workbench/test/electron-browser/api/extHostSearch.test.ts
+3
-3
未找到文件。
src/vs/base/browser/ui/menu/menu.ts
浏览文件 @
30d11145
...
...
@@ -12,7 +12,7 @@ import { ResolvedKeybinding, KeyCode } from 'vs/base/common/keyCodes';
import
{
addClass
,
EventType
,
EventHelper
,
EventLike
,
removeTabIndexAndUpdateFocus
,
isAncestor
,
hasClass
,
addDisposableListener
,
removeClass
,
append
,
$
,
addClasses
,
removeClasses
}
from
'
vs/base/browser/dom
'
;
import
{
StandardKeyboardEvent
}
from
'
vs/base/browser/keyboardEvent
'
;
import
{
RunOnceScheduler
}
from
'
vs/base/common/async
'
;
import
{
IDisposable
,
dispos
e
}
from
'
vs/base/common/lifecycle
'
;
import
{
DisposableStor
e
}
from
'
vs/base/common/lifecycle
'
;
import
{
Color
}
from
'
vs/base/common/color
'
;
import
{
DomScrollableElement
}
from
'
vs/base/browser/ui/scrollbar/scrollableElement
'
;
import
{
ScrollbarVisibility
,
ScrollEvent
}
from
'
vs/base/common/scrollable
'
;
...
...
@@ -71,7 +71,7 @@ interface ISubMenuData {
export
class
Menu
extends
ActionBar
{
private
mnemonics
:
Map
<
string
,
Array
<
BaseMenuActionViewItem
>>
;
private
menuDisposables
:
IDisposable
[]
;
private
readonly
menuDisposables
:
DisposableStore
;
private
scrollableElement
:
DomScrollableElement
;
private
menuElement
:
HTMLElement
;
private
scrollTopHold
:
number
|
undefined
;
...
...
@@ -79,7 +79,6 @@ export class Menu extends ActionBar {
private
readonly
_onScroll
:
Emitter
<
void
>
;
constructor
(
container
:
HTMLElement
,
actions
:
IAction
[],
options
:
IMenuOptions
=
{})
{
addClass
(
container
,
'
monaco-menu-container
'
);
container
.
setAttribute
(
'
role
'
,
'
presentation
'
);
const
menuElement
=
document
.
createElement
(
'
div
'
);
...
...
@@ -103,7 +102,7 @@ export class Menu extends ActionBar {
this
.
actionsList
.
tabIndex
=
0
;
this
.
menuDisposables
=
[]
;
this
.
menuDisposables
=
this
.
_register
(
new
DisposableStore
())
;
addDisposableListener
(
menuElement
,
EventType
.
KEY_DOWN
,
(
e
)
=>
{
const
event
=
new
StandardKeyboardEvent
(
e
);
...
...
@@ -217,9 +216,9 @@ export class Menu extends ActionBar {
menuElement
.
style
.
maxHeight
=
`
${
Math
.
max
(
10
,
window
.
innerHeight
-
container
.
getBoundingClientRect
().
top
-
30
)}
px`
;
this
.
scrollableElement
.
onScroll
(()
=>
{
this
.
menuDisposables
.
push
(
this
.
scrollableElement
.
onScroll
(()
=>
{
this
.
_onScroll
.
fire
();
},
this
,
this
.
menuDisposables
);
},
this
)
);
this
.
_register
(
addDisposableListener
(
this
.
menuElement
,
EventType
.
SCROLL
,
(
e
:
ScrollEvent
)
=>
{
if
(
this
.
scrollTopHold
!==
undefined
)
{
...
...
@@ -575,7 +574,7 @@ class SubmenuMenuActionViewItem extends BaseMenuActionViewItem {
private
mysubmenu
:
Menu
|
null
;
private
submenuContainer
:
HTMLElement
|
undefined
;
private
submenuIndicator
:
HTMLElement
;
private
submenuDisposables
:
IDisposable
[]
=
[]
;
private
readonly
submenuDisposables
=
this
.
_register
(
new
DisposableStore
())
;
private
mouseOver
:
boolean
;
private
showScheduler
:
RunOnceScheduler
;
private
hideScheduler
:
RunOnceScheduler
;
...
...
@@ -675,7 +674,7 @@ class SubmenuMenuActionViewItem extends BaseMenuActionViewItem {
this
.
parentData
.
submenu
=
undefined
;
if
(
this
.
submenuContainer
)
{
this
.
submenuDisposables
=
dispose
(
this
.
submenuDisposables
);
this
.
submenuDisposables
.
clear
(
);
this
.
submenuContainer
=
undefined
;
}
}
...
...
@@ -720,7 +719,7 @@ class SubmenuMenuActionViewItem extends BaseMenuActionViewItem {
this
.
parentData
.
submenu
=
undefined
;
}
this
.
submenuDisposables
=
dispose
(
this
.
submenuDisposables
);
this
.
submenuDisposables
.
clear
(
);
this
.
submenuContainer
=
undefined
;
}
}));
...
...
@@ -741,7 +740,7 @@ class SubmenuMenuActionViewItem extends BaseMenuActionViewItem {
this
.
parentData
.
submenu
=
undefined
;
}
this
.
submenuDisposables
=
dispose
(
this
.
submenuDisposables
);
this
.
submenuDisposables
.
clear
(
);
this
.
submenuContainer
=
undefined
;
}));
...
...
@@ -781,7 +780,6 @@ class SubmenuMenuActionViewItem extends BaseMenuActionViewItem {
}
if
(
this
.
submenuContainer
)
{
this
.
submenuDisposables
=
dispose
(
this
.
submenuDisposables
);
this
.
submenuContainer
=
undefined
;
}
}
...
...
src/vs/base/browser/ui/sash/sash.ts
浏览文件 @
30d11145
...
...
@@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
import
'
vs/css!./sash
'
;
import
{
IDisposable
,
dispose
,
Disposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
IDisposable
,
dispose
,
Disposable
,
DisposableStore
}
from
'
vs/base/common/lifecycle
'
;
import
{
isIPad
}
from
'
vs/base/browser/browser
'
;
import
{
isMacintosh
}
from
'
vs/base/common/platform
'
;
import
*
as
types
from
'
vs/base/common/types
'
;
...
...
@@ -95,14 +95,14 @@ export class Sash extends Disposable {
linkedSash
:
Sash
|
undefined
=
undefined
;
private
orthogonalStartSashDisposables
:
IDisposable
[]
=
[]
;
private
readonly
orthogonalStartSashDisposables
=
this
.
_register
(
new
DisposableStore
())
;
private
_orthogonalStartSash
:
Sash
|
undefined
;
get
orthogonalStartSash
():
Sash
|
undefined
{
return
this
.
_orthogonalStartSash
;
}
set
orthogonalStartSash
(
sash
:
Sash
|
undefined
)
{
this
.
orthogonalStartSashDisposables
=
dispose
(
this
.
orthogonalStartSashDisposables
);
this
.
orthogonalStartSashDisposables
.
clear
(
);
if
(
sash
)
{
sash
.
onDidEnablementChange
(
this
.
onOrthogonalStartSashEnablementChange
,
this
,
this
.
orthogonalStartSashDisposables
);
this
.
orthogonalStartSashDisposables
.
push
(
sash
.
onDidEnablementChange
(
this
.
onOrthogonalStartSashEnablementChange
,
this
)
);
this
.
onOrthogonalStartSashEnablementChange
(
sash
.
state
);
}
else
{
this
.
onOrthogonalStartSashEnablementChange
(
SashState
.
Disabled
);
...
...
@@ -111,14 +111,14 @@ export class Sash extends Disposable {
this
.
_orthogonalStartSash
=
sash
;
}
private
orthogonalEndSashDisposables
:
IDisposable
[]
=
[]
;
private
readonly
orthogonalEndSashDisposables
=
this
.
_register
(
new
DisposableStore
())
;
private
_orthogonalEndSash
:
Sash
|
undefined
;
get
orthogonalEndSash
():
Sash
|
undefined
{
return
this
.
_orthogonalEndSash
;
}
set
orthogonalEndSash
(
sash
:
Sash
|
undefined
)
{
this
.
orthogonalEndSashDisposables
=
dispose
(
this
.
orthogonalEndSashDisposables
);
this
.
orthogonalEndSashDisposables
.
clear
(
);
if
(
sash
)
{
sash
.
onDidEnablementChange
(
this
.
onOrthogonalEndSashEnablementChange
,
this
,
this
.
orthogonalEndSashDisposables
);
this
.
orthogonalEndSashDisposables
.
push
(
sash
.
onDidEnablementChange
(
this
.
onOrthogonalEndSashEnablementChange
,
this
)
);
this
.
onOrthogonalEndSashEnablementChange
(
sash
.
state
);
}
else
{
this
.
onOrthogonalEndSashEnablementChange
(
SashState
.
Disabled
);
...
...
@@ -384,9 +384,6 @@ export class Sash extends Disposable {
dispose
():
void
{
super
.
dispose
();
this
.
orthogonalStartSashDisposables
=
dispose
(
this
.
orthogonalStartSashDisposables
);
this
.
orthogonalEndSashDisposables
=
dispose
(
this
.
orthogonalEndSashDisposables
);
if
(
this
.
el
&&
this
.
el
.
parentElement
)
{
this
.
el
.
parentElement
.
removeChild
(
this
.
el
);
}
...
...
src/vs/editor/contrib/codeAction/test/codeAction.test.ts
浏览文件 @
30d11145
...
...
@@ -3,7 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import
*
as
assert
from
'
assert
'
;
import
{
dispose
,
IDisposabl
e
}
from
'
vs/base/common/lifecycle
'
;
import
{
DisposableStor
e
}
from
'
vs/base/common/lifecycle
'
;
import
{
URI
}
from
'
vs/base/common/uri
'
;
import
{
Range
}
from
'
vs/editor/common/core/range
'
;
import
{
TextModel
}
from
'
vs/editor/common/model/textModel
'
;
...
...
@@ -18,7 +18,7 @@ suite('CodeAction', () => {
let
langId
=
new
LanguageIdentifier
(
'
fooLang
'
,
17
);
let
uri
=
URI
.
parse
(
'
untitled:path
'
);
let
model
:
TextModel
;
let
disposables
:
IDisposable
[]
=
[]
;
const
disposables
=
new
DisposableStore
()
;
let
testData
=
{
diagnostics
:
{
abc
:
{
...
...
@@ -79,12 +79,13 @@ suite('CodeAction', () => {
};
setup
(
function
()
{
disposables
.
clear
();
model
=
TextModel
.
createFromString
(
'
test1
\n
test2
\n
test3
'
,
undefined
,
langId
,
uri
);
disposables
=
[
model
]
;
disposables
.
push
(
model
)
;
});
teardown
(
function
()
{
dispos
e
(
disposables
);
dispos
ables
.
clear
(
);
});
test
(
'
CodeActions are sorted by type, #38623
'
,
async
function
()
{
...
...
src/vs/editor/contrib/codeAction/test/codeActionModel.test.ts
浏览文件 @
30d11145
...
...
@@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
import
*
as
assert
from
'
assert
'
;
import
{
dispose
,
IDisposabl
e
}
from
'
vs/base/common/lifecycle
'
;
import
{
DisposableStor
e
}
from
'
vs/base/common/lifecycle
'
;
import
{
URI
}
from
'
vs/base/common/uri
'
;
import
{
ICodeEditor
}
from
'
vs/editor/browser/editorBrowser
'
;
import
{
Selection
}
from
'
vs/editor/common/core/selection
'
;
...
...
@@ -26,10 +26,10 @@ suite('CodeAction', () => {
let
model
:
TextModel
;
let
markerService
:
MarkerService
;
let
editor
:
ICodeEditor
;
let
disposables
:
IDisposable
[]
;
const
disposables
=
new
DisposableStore
()
;
setup
(()
=>
{
disposables
=
[]
;
disposables
.
clear
()
;
markerService
=
new
MarkerService
();
model
=
TextModel
.
createFromString
(
'
foobar foo bar
\n
farboo far boo
'
,
undefined
,
languageIdentifier
,
uri
);
editor
=
createTestCodeEditor
({
model
:
model
});
...
...
@@ -37,7 +37,7 @@ suite('CodeAction', () => {
});
teardown
(()
=>
{
dispos
e
(
disposables
);
dispos
ables
.
clear
(
);
editor
.
dispose
();
model
.
dispose
();
markerService
.
dispose
();
...
...
src/vs/editor/contrib/dnd/dnd.ts
浏览文件 @
30d11145
...
...
@@ -5,7 +5,7 @@
import
'
vs/css!./dnd
'
;
import
{
IKeyboardEvent
}
from
'
vs/base/browser/keyboardEvent
'
;
import
{
IDisposable
,
dispos
e
}
from
'
vs/base/common/lifecycle
'
;
import
{
Disposabl
e
}
from
'
vs/base/common/lifecycle
'
;
import
{
isMacintosh
}
from
'
vs/base/common/platform
'
;
import
{
KeyCode
}
from
'
vs/base/common/keyCodes
'
;
import
{
ICodeEditor
,
IEditorMouseEvent
,
IMouseTarget
,
MouseTargetType
}
from
'
vs/editor/browser/editorBrowser
'
;
...
...
@@ -28,12 +28,11 @@ function hasTriggerModifier(e: IKeyboardEvent | IMouseEvent): boolean {
}
}
export
class
DragAndDropController
implements
editorCommon
.
IEditorContribution
{
export
class
DragAndDropController
extends
Disposable
implements
editorCommon
.
IEditorContribution
{
private
static
readonly
ID
=
'
editor.contrib.dragAndDrop
'
;
private
readonly
_editor
:
ICodeEditor
;
private
_toUnhook
:
IDisposable
[];
private
_dragSelection
:
Selection
|
null
;
private
_dndDecorationIds
:
string
[];
private
_mouseDown
:
boolean
;
...
...
@@ -45,15 +44,15 @@ export class DragAndDropController implements editorCommon.IEditorContribution {
}
constructor
(
editor
:
ICodeEditor
)
{
super
();
this
.
_editor
=
editor
;
this
.
_toUnhook
=
[];
this
.
_toUnhook
.
push
(
this
.
_editor
.
onMouseDown
((
e
:
IEditorMouseEvent
)
=>
this
.
_onEditorMouseDown
(
e
)));
this
.
_toUnhook
.
push
(
this
.
_editor
.
onMouseUp
((
e
:
IEditorMouseEvent
)
=>
this
.
_onEditorMouseUp
(
e
)));
this
.
_toUnhook
.
push
(
this
.
_editor
.
onMouseDrag
((
e
:
IEditorMouseEvent
)
=>
this
.
_onEditorMouseDrag
(
e
)));
this
.
_toUnhook
.
push
(
this
.
_editor
.
onMouseDrop
((
e
:
IEditorMouseEvent
)
=>
this
.
_onEditorMouseDrop
(
e
)));
this
.
_toUnhook
.
push
(
this
.
_editor
.
onKeyDown
((
e
:
IKeyboardEvent
)
=>
this
.
onEditorKeyDown
(
e
)));
this
.
_toUnhook
.
push
(
this
.
_editor
.
onKeyUp
((
e
:
IKeyboardEvent
)
=>
this
.
onEditorKeyUp
(
e
)));
this
.
_toUnhook
.
push
(
this
.
_editor
.
onDidBlurEditorWidget
(()
=>
this
.
onEditorBlur
()));
this
.
_register
(
this
.
_editor
.
onMouseDown
((
e
:
IEditorMouseEvent
)
=>
this
.
_onEditorMouseDown
(
e
)));
this
.
_register
(
this
.
_editor
.
onMouseUp
((
e
:
IEditorMouseEvent
)
=>
this
.
_onEditorMouseUp
(
e
)));
this
.
_register
(
this
.
_editor
.
onMouseDrag
((
e
:
IEditorMouseEvent
)
=>
this
.
_onEditorMouseDrag
(
e
)));
this
.
_register
(
this
.
_editor
.
onMouseDrop
((
e
:
IEditorMouseEvent
)
=>
this
.
_onEditorMouseDrop
(
e
)));
this
.
_register
(
this
.
_editor
.
onKeyDown
((
e
:
IKeyboardEvent
)
=>
this
.
onEditorKeyDown
(
e
)));
this
.
_register
(
this
.
_editor
.
onKeyUp
((
e
:
IKeyboardEvent
)
=>
this
.
onEditorKeyUp
(
e
)));
this
.
_register
(
this
.
_editor
.
onDidBlurEditorWidget
(()
=>
this
.
onEditorBlur
()));
this
.
_dndDecorationIds
=
[];
this
.
_mouseDown
=
false
;
this
.
_modifierPressed
=
false
;
...
...
@@ -228,7 +227,7 @@ export class DragAndDropController implements editorCommon.IEditorContribution {
this
.
_dragSelection
=
null
;
this
.
_mouseDown
=
false
;
this
.
_modifierPressed
=
false
;
this
.
_toUnhook
=
dispose
(
this
.
_toUnhook
);
super
.
dispose
(
);
}
}
...
...
src/vs/workbench/contrib/extensions/common/extensionsUtils.ts
浏览文件 @
30d11145
...
...
@@ -7,7 +7,7 @@ import * as arrays from 'vs/base/common/arrays';
import
{
localize
}
from
'
vs/nls
'
;
import
{
Event
}
from
'
vs/base/common/event
'
;
import
{
onUnexpectedError
}
from
'
vs/base/common/errors
'
;
import
{
IDisposable
,
dispos
e
}
from
'
vs/base/common/lifecycle
'
;
import
{
Disposabl
e
}
from
'
vs/base/common/lifecycle
'
;
import
{
ITelemetryService
}
from
'
vs/platform/telemetry/common/telemetry
'
;
import
{
IExtensionManagementService
,
ILocalExtension
,
IExtensionEnablementService
,
IExtensionTipsService
,
IExtensionIdentifier
,
EnablementState
,
InstallOperation
}
from
'
vs/platform/extensionManagement/common/extensionManagement
'
;
import
{
ILifecycleService
}
from
'
vs/platform/lifecycle/common/lifecycle
'
;
...
...
@@ -22,9 +22,7 @@ export interface IExtensionStatus {
globallyEnabled
:
boolean
;
}
export
class
KeymapExtensions
implements
IWorkbenchContribution
{
private
disposables
:
IDisposable
[]
=
[];
export
class
KeymapExtensions
extends
Disposable
implements
IWorkbenchContribution
{
constructor
(
@
IInstantiationService
private
readonly
instantiationService
:
IInstantiationService
,
...
...
@@ -34,13 +32,12 @@ export class KeymapExtensions implements IWorkbenchContribution {
@
INotificationService
private
readonly
notificationService
:
INotificationService
,
@
ITelemetryService
private
readonly
telemetryService
:
ITelemetryService
,
)
{
this
.
disposables
.
push
(
lifecycleService
.
onShutdown
(()
=>
this
.
dispose
()),
instantiationService
.
invokeFunction
(
onExtensionChanged
)((
identifiers
=>
{
Promise
.
all
(
identifiers
.
map
(
identifier
=>
this
.
checkForOtherKeymaps
(
identifier
)))
.
then
(
undefined
,
onUnexpectedError
);
}))
);
super
();
this
.
_register
(
lifecycleService
.
onShutdown
(()
=>
this
.
dispose
()));
this
.
_register
(
instantiationService
.
invokeFunction
(
onExtensionChanged
)((
identifiers
=>
{
Promise
.
all
(
identifiers
.
map
(
identifier
=>
this
.
checkForOtherKeymaps
(
identifier
)))
.
then
(
undefined
,
onUnexpectedError
);
})));
}
private
checkForOtherKeymaps
(
extensionIdentifier
:
IExtensionIdentifier
):
Promise
<
void
>
{
...
...
@@ -87,10 +84,6 @@ export class KeymapExtensions implements IWorkbenchContribution {
}]
);
}
dispose
():
void
{
this
.
disposables
=
dispose
(
this
.
disposables
);
}
}
export
function
onExtensionChanged
(
accessor
:
ServicesAccessor
):
Event
<
IExtensionIdentifier
[]
>
{
...
...
src/vs/workbench/contrib/preferences/browser/preferencesActions.ts
浏览文件 @
30d11145
...
...
@@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
import
{
Action
}
from
'
vs/base/common/actions
'
;
import
{
dispose
,
IDisposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
dispose
,
IDisposable
,
DisposableStore
}
from
'
vs/base/common/lifecycle
'
;
import
{
URI
}
from
'
vs/base/common/uri
'
;
import
{
getIconClasses
}
from
'
vs/editor/common/services/getIconClasses
'
;
import
{
IModelService
}
from
'
vs/editor/common/services/modelService
'
;
...
...
@@ -164,7 +164,7 @@ export class OpenWorkspaceSettingsAction extends Action {
static
readonly
ID
=
'
workbench.action.openWorkspaceSettings
'
;
static
readonly
LABEL
=
nls
.
localize
(
'
openWorkspaceSettings
'
,
"
Open Workspace Settings
"
);
private
disposables
:
IDisposable
[]
=
[]
;
private
readonly
disposables
=
new
DisposableStore
()
;
constructor
(
id
:
string
,
...
...
@@ -174,7 +174,7 @@ export class OpenWorkspaceSettingsAction extends Action {
)
{
super
(
id
,
label
);
this
.
update
();
this
.
workspaceContextService
.
onDidChangeWorkbenchState
(()
=>
this
.
update
(),
this
,
this
.
disposables
);
this
.
disposables
.
push
(
this
.
workspaceContextService
.
onDidChangeWorkbenchState
(()
=>
this
.
update
(),
this
)
);
}
private
update
():
void
{
...
...
@@ -186,7 +186,7 @@ export class OpenWorkspaceSettingsAction extends Action {
}
dispose
():
void
{
this
.
disposables
=
dispose
(
this
.
disposables
);
this
.
disposables
.
dispose
(
);
super
.
dispose
();
}
}
...
...
src/vs/workbench/contrib/preferences/common/preferencesContribution.ts
浏览文件 @
30d11145
...
...
@@ -3,7 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import
{
dispose
,
IDisposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
dispose
,
IDisposable
,
DisposableStore
}
from
'
vs/base/common/lifecycle
'
;
import
{
isLinux
}
from
'
vs/base/common/platform
'
;
import
{
isEqual
}
from
'
vs/base/common/resources
'
;
import
{
endsWith
}
from
'
vs/base/common/strings
'
;
...
...
@@ -129,14 +129,14 @@ export class PreferencesContribution implements IWorkbenchContribution {
const
modelContent
=
JSON
.
stringify
(
schema
);
const
languageSelection
=
this
.
modeService
.
create
(
'
jsonc
'
);
const
model
=
this
.
modelService
.
createModel
(
modelContent
,
languageSelection
,
uri
);
const
disposables
:
IDisposable
[]
=
[]
;
const
disposables
=
new
DisposableStore
()
;
disposables
.
push
(
schemaRegistry
.
onDidChangeSchema
(
schemaUri
=>
{
if
(
schemaUri
===
uri
.
toString
())
{
schema
=
schemaRegistry
.
getSchemaContributions
().
schemas
[
uri
.
toString
()];
model
.
setValue
(
JSON
.
stringify
(
schema
));
}
}));
disposables
.
push
(
model
.
onWillDispose
(()
=>
dispos
e
(
disposables
)));
disposables
.
push
(
model
.
onWillDispose
(()
=>
dispos
ables
.
dispose
(
)));
return
model
;
}
...
...
src/vs/workbench/contrib/terminal/browser/terminalLinkHandler.ts
浏览文件 @
30d11145
...
...
@@ -6,7 +6,7 @@
import
*
as
nls
from
'
vs/nls
'
;
import
*
as
platform
from
'
vs/base/common/platform
'
;
import
{
URI
}
from
'
vs/base/common/uri
'
;
import
{
dispose
,
IDisposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
dispose
,
IDisposable
,
DisposableStore
}
from
'
vs/base/common/lifecycle
'
;
import
{
IOpenerService
}
from
'
vs/platform/opener/common/opener
'
;
import
{
TerminalWidgetManager
}
from
'
vs/workbench/contrib/terminal/browser/terminalWidgetManager
'
;
import
{
IConfigurationService
}
from
'
vs/platform/configuration/common/configuration
'
;
...
...
@@ -64,7 +64,7 @@ interface IPath {
}
export
class
TerminalLinkHandler
{
private
_hoverDisposables
:
IDisposable
[]
=
[]
;
private
readonly
_hoverDisposables
=
new
DisposableStore
()
;
private
_mouseMoveDisposable
:
IDisposable
;
private
_widgetManager
:
TerminalWidgetManager
;
private
_processCwd
:
string
;
...
...
@@ -177,7 +177,8 @@ export class TerminalLinkHandler {
public
dispose
():
void
{
this
.
_xterm
=
null
;
this
.
_hoverDisposables
=
dispose
(
this
.
_hoverDisposables
);
this
.
_hoverDisposables
.
dispose
();
this
.
_mouseMoveDisposable
=
dispose
(
this
.
_mouseMoveDisposable
);
}
...
...
src/vs/workbench/services/textfile/test/textFileService.io.test.ts
浏览文件 @
30d11145
...
...
@@ -17,7 +17,7 @@ import { ModelServiceImpl } from 'vs/editor/common/services/modelServiceImpl';
import
{
Schemas
}
from
'
vs/base/common/network
'
;
import
{
ServiceCollection
}
from
'
vs/platform/instantiation/common/serviceCollection
'
;
import
{
rimraf
,
RimRafMode
,
copy
,
readFile
,
exists
}
from
'
vs/base/node/pfs
'
;
import
{
dispose
,
IDisposabl
e
}
from
'
vs/base/common/lifecycle
'
;
import
{
DisposableStor
e
}
from
'
vs/base/common/lifecycle
'
;
import
{
FileService
}
from
'
vs/workbench/services/files/common/fileService
'
;
import
{
NullLogService
}
from
'
vs/platform/log/common/log
'
;
import
{
getRandomTestPath
}
from
'
vs/base/test/node/testUtils
'
;
...
...
@@ -76,7 +76,7 @@ suite('Files - TextFileService i/o', () => {
const
parentDir
=
getRandomTestPath
(
tmpdir
(),
'
vsctests
'
,
'
textfileservice
'
);
let
accessor
:
ServiceAccessor
;
let
disposables
:
IDisposable
[]
=
[]
;
const
disposables
=
new
DisposableStore
()
;
let
service
:
ITextFileService
;
let
testDir
:
string
;
...
...
@@ -108,7 +108,7 @@ suite('Files - TextFileService i/o', () => {
(
<
TextFileEditorModelManager
>
accessor
.
textFileService
.
models
).
dispose
();
accessor
.
untitledEditorService
.
revertAll
();
disposables
=
dispose
(
disposables
);
disposables
.
clear
(
);
await
rimraf
(
parentDir
,
RimRafMode
.
MOVE
);
});
...
...
src/vs/workbench/test/electron-browser/api/extHostSearch.test.ts
浏览文件 @
30d11145
...
...
@@ -7,7 +7,7 @@ import * as assert from 'assert';
import
{
mapArrayOrNot
}
from
'
vs/base/common/arrays
'
;
import
{
CancellationTokenSource
}
from
'
vs/base/common/cancellation
'
;
import
{
isPromiseCanceledError
}
from
'
vs/base/common/errors
'
;
import
{
dispos
e
}
from
'
vs/base/common/lifecycle
'
;
import
{
DisposableStor
e
}
from
'
vs/base/common/lifecycle
'
;
import
{
joinPath
}
from
'
vs/base/common/resources
'
;
import
{
URI
,
UriComponents
}
from
'
vs/base/common/uri
'
;
import
*
as
pfs
from
'
vs/base/node/pfs
'
;
...
...
@@ -21,7 +21,7 @@ import * as vscode from 'vscode';
let
rpcProtocol
:
TestRPCProtocol
;
let
extHostSearch
:
ExtHostSearch
;
let
disposables
:
vscode
.
Disposable
[]
=
[]
;
const
disposables
=
new
DisposableStore
()
;
let
mockMainThreadSearch
:
MockMainThreadSearch
;
class
MockMainThreadSearch
implements
MainThreadSearchShape
{
...
...
@@ -139,7 +139,7 @@ suite('ExtHostSearch', () => {
});
teardown
(()
=>
{
dispos
e
(
disposables
);
dispos
ables
.
clear
(
);
return
rpcProtocol
.
sync
();
});
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录