Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
cd9f8897
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,体验更适合开发者的 AI 搜索 >>
提交
cd9f8897
编写于
2月 22, 2016
作者:
M
Martin Aeschlimann
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Rename INewConstructorSignature to IConstructorSignature
上级
802111cc
变更
16
隐藏空白更改
内联
并排
Showing
16 changed file
with
128 addition
and
125 deletion
+128
-125
src/vs/editor/browser/editorBrowser.ts
src/vs/editor/browser/editorBrowser.ts
+2
-2
src/vs/editor/browser/editorBrowserExtensions.ts
src/vs/editor/browser/editorBrowserExtensions.ts
+2
-2
src/vs/editor/common/editorCommon.ts
src/vs/editor/common/editorCommon.ts
+3
-3
src/vs/platform/actions/common/actions.ts
src/vs/platform/actions/common/actions.ts
+1
-1
src/vs/platform/instantiation/common/descriptors.ts
src/vs/platform/instantiation/common/descriptors.ts
+53
-53
src/vs/platform/instantiation/common/extensions.ts
src/vs/platform/instantiation/common/extensions.ts
+2
-2
src/vs/platform/instantiation/common/instantiation.ts
src/vs/platform/instantiation/common/instantiation.ts
+19
-19
src/vs/platform/instantiation/common/instantiationService.ts
src/vs/platform/instantiation/common/instantiationService.ts
+15
-12
src/vs/platform/platform.ts
src/vs/platform/platform.ts
+4
-4
src/vs/platform/thread/common/abstractThreadService.ts
src/vs/platform/thread/common/abstractThreadService.ts
+5
-5
src/vs/platform/thread/common/thread.ts
src/vs/platform/thread/common/thread.ts
+5
-5
src/vs/workbench/browser/actionBarRegistry.ts
src/vs/workbench/browser/actionBarRegistry.ts
+5
-5
src/vs/workbench/browser/parts/editor/baseEditor.ts
src/vs/workbench/browser/parts/editor/baseEditor.ts
+5
-5
src/vs/workbench/browser/parts/statusbar/statusbar.ts
src/vs/workbench/browser/parts/statusbar/statusbar.ts
+2
-2
src/vs/workbench/common/contributions.ts
src/vs/workbench/common/contributions.ts
+2
-2
src/vs/workbench/parts/files/browser/fileActions.ts
src/vs/workbench/parts/files/browser/fileActions.ts
+3
-3
未找到文件。
src/vs/editor/browser/editorBrowser.ts
浏览文件 @
cd9f8897
...
...
@@ -8,7 +8,7 @@ import {IEmitterEvent, IEventEmitter} from 'vs/base/common/eventEmitter';
import
{
IDisposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
IKeyboardEvent
}
from
'
vs/base/browser/keyboardEvent
'
;
import
{
IMouseEvent
}
from
'
vs/base/browser/mouseEvent
'
;
import
{
IInstantiationService
,
I
New
ConstructorSignature1
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
IInstantiationService
,
IConstructorSignature1
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
*
as
editorCommon
from
'
vs/editor/common/editorCommon
'
;
export
interface
IDynamicViewOverlay
extends
IDisposable
{
...
...
@@ -475,7 +475,7 @@ export interface IEditorMouseEvent {
target
:
IMouseTarget
;
}
export
type
ISimpleEditorContributionCtor
=
I
New
ConstructorSignature1
<
ICodeEditor
,
editorCommon
.
IEditorContribution
>
;
export
type
ISimpleEditorContributionCtor
=
IConstructorSignature1
<
ICodeEditor
,
editorCommon
.
IEditorContribution
>
;
/**
* An editor contribution descriptor that will be used to construct editor contributions
...
...
src/vs/editor/browser/editorBrowserExtensions.ts
浏览文件 @
cd9f8897
...
...
@@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
'
use strict
'
;
import
{
IInstantiationService
,
I
New
ConstructorSignature1
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
IInstantiationService
,
IConstructorSignature1
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
Registry
}
from
'
vs/platform/platform
'
;
import
{
IEditorContribution
}
from
'
vs/editor/common/editorCommon
'
;
import
{
ICodeEditor
,
IEditorContributionDescriptor
,
ISimpleEditorContributionCtor
}
from
'
vs/editor/browser/editorBrowser
'
;
...
...
@@ -28,7 +28,7 @@ class SimpleEditorContributionDescriptor implements IEditorContributionDescripto
public
createInstance
(
instantiationService
:
IInstantiationService
,
editor
:
ICodeEditor
):
IEditorContribution
{
// cast added to help the compiler, can remove once IConstructorSignature1 has been removed
return
instantiationService
.
createInstance
(
<
I
New
ConstructorSignature1
<
ICodeEditor
,
IEditorContribution
>>
this
.
_ctor
,
editor
);
return
instantiationService
.
createInstance
(
<
IConstructorSignature1
<
ICodeEditor
,
IEditorContribution
>>
this
.
_ctor
,
editor
);
}
}
...
...
src/vs/editor/common/editorCommon.ts
浏览文件 @
cd9f8897
...
...
@@ -12,7 +12,7 @@ import {KeyCode, KeyMod} from 'vs/base/common/keyCodes';
import
{
IDisposable
}
from
'
vs/base/common/lifecycle
'
;
import
URI
from
'
vs/base/common/uri
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
IInstantiationService
,
I
NewConstructorSignature1
,
INew
ConstructorSignature2
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
IInstantiationService
,
I
ConstructorSignature1
,
I
ConstructorSignature2
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
*
as
TokensBinaryEncoding
from
'
vs/editor/common/model/tokensBinaryEncoding
'
;
import
{
ILineContext
,
IMode
,
IModeTransition
,
IToken
}
from
'
vs/editor/common/modes
'
;
...
...
@@ -2748,9 +2748,9 @@ export interface IEditorActionDescriptorData {
label
:
string
;
}
export
type
IEditorActionContributionCtor
=
I
New
ConstructorSignature2
<
IEditorActionDescriptorData
,
ICommonCodeEditor
,
IEditorContribution
>
;
export
type
IEditorActionContributionCtor
=
IConstructorSignature2
<
IEditorActionDescriptorData
,
ICommonCodeEditor
,
IEditorContribution
>
;
export
type
ICommonEditorContributionCtor
=
I
New
ConstructorSignature1
<
ICommonCodeEditor
,
IEditorContribution
>
;
export
type
ICommonEditorContributionCtor
=
IConstructorSignature1
<
ICommonCodeEditor
,
IEditorContribution
>
;
/**
* An editor contribution descriptor that will be used to construct editor contributions
...
...
src/vs/platform/actions/common/actions.ts
浏览文件 @
cd9f8897
...
...
@@ -31,7 +31,7 @@ export class SyncActionDescriptor {
private
_keybindingContext
:
KbExpr
;
private
_keybindingWeight
:
number
;
constructor
(
ctor
:
Instantiation
.
I
New
ConstructorSignature2
<
string
,
string
,
Actions
.
Action
>
,
constructor
(
ctor
:
Instantiation
.
IConstructorSignature2
<
string
,
string
,
Actions
.
Action
>
,
id
:
string
,
label
:
string
,
keybindings
?:
IKeybindings
,
keybindingContext
?:
KbExpr
,
keybindingWeight
?:
number
)
{
this
.
_id
=
id
;
...
...
src/vs/platform/instantiation/common/descriptors.ts
浏览文件 @
cd9f8897
...
...
@@ -70,59 +70,59 @@ export class SyncDescriptor<T> extends AbstractDescriptor<T> implements objects.
export
interface
CreateSyncFunc
{
<
T
>
(
ctor
:
instantiation
.
I
New
ConstructorSignature0
<
T
>
):
SyncDescriptor0
<
T
>
;
<
A1
,
T
>
(
ctor
:
instantiation
.
I
New
ConstructorSignature1
<
A1
,
T
>
):
SyncDescriptor1
<
A1
,
T
>
;
<
A1
,
T
>
(
ctor
:
instantiation
.
I
New
ConstructorSignature1
<
A1
,
T
>
,
a1
:
A1
):
SyncDescriptor0
<
T
>
;
<
A1
,
A2
,
T
>
(
ctor
:
instantiation
.
I
New
ConstructorSignature2
<
A1
,
A2
,
T
>
):
SyncDescriptor2
<
A1
,
A2
,
T
>
;
<
A1
,
A2
,
T
>
(
ctor
:
instantiation
.
I
New
ConstructorSignature2
<
A1
,
A2
,
T
>
,
a1
:
A1
):
SyncDescriptor1
<
A2
,
T
>
;
<
A1
,
A2
,
T
>
(
ctor
:
instantiation
.
I
New
ConstructorSignature2
<
A1
,
A2
,
T
>
,
a1
:
A1
,
a2
:
A2
):
SyncDescriptor0
<
T
>
;
<
A1
,
A2
,
A3
,
T
>
(
ctor
:
instantiation
.
I
New
ConstructorSignature3
<
A1
,
A2
,
A3
,
T
>
):
SyncDescriptor3
<
A1
,
A2
,
A3
,
T
>
;
<
A1
,
A2
,
A3
,
T
>
(
ctor
:
instantiation
.
I
New
ConstructorSignature3
<
A1
,
A2
,
A3
,
T
>
,
a1
:
A1
):
SyncDescriptor2
<
A2
,
A3
,
T
>
;
<
A1
,
A2
,
A3
,
T
>
(
ctor
:
instantiation
.
I
New
ConstructorSignature3
<
A1
,
A2
,
A3
,
T
>
,
a1
:
A1
,
a2
:
A2
):
SyncDescriptor1
<
A3
,
T
>
;
<
A1
,
A2
,
A3
,
T
>
(
ctor
:
instantiation
.
I
New
ConstructorSignature3
<
A1
,
A2
,
A3
,
T
>
,
a1
:
A1
,
a2
:
A2
,
a3
:
A3
):
SyncDescriptor0
<
T
>
;
<
A1
,
A2
,
A3
,
A4
,
T
>
(
ctor
:
instantiation
.
I
New
ConstructorSignature4
<
A1
,
A2
,
A3
,
A4
,
T
>
):
SyncDescriptor4
<
A1
,
A2
,
A3
,
A4
,
T
>
;
<
A1
,
A2
,
A3
,
A4
,
T
>
(
ctor
:
instantiation
.
I
New
ConstructorSignature4
<
A1
,
A2
,
A3
,
A4
,
T
>
,
a1
:
A1
):
SyncDescriptor3
<
A2
,
A3
,
A4
,
T
>
;
<
A1
,
A2
,
A3
,
A4
,
T
>
(
ctor
:
instantiation
.
I
New
ConstructorSignature4
<
A1
,
A2
,
A3
,
A4
,
T
>
,
a1
:
A1
,
a2
:
A2
):
SyncDescriptor2
<
A3
,
A4
,
T
>
;
<
A1
,
A2
,
A3
,
A4
,
T
>
(
ctor
:
instantiation
.
I
New
ConstructorSignature4
<
A1
,
A2
,
A3
,
A4
,
T
>
,
a1
:
A1
,
a2
:
A2
,
a3
:
A3
):
SyncDescriptor1
<
A4
,
T
>
;
<
A1
,
A2
,
A3
,
A4
,
T
>
(
ctor
:
instantiation
.
I
New
ConstructorSignature4
<
A1
,
A2
,
A3
,
A4
,
T
>
,
a1
:
A1
,
a2
:
A2
,
a3
:
A3
,
a4
:
A4
):
SyncDescriptor0
<
T
>
;
<
A1
,
A2
,
A3
,
A4
,
A5
,
T
>
(
ctor
:
instantiation
.
I
New
ConstructorSignature5
<
A1
,
A2
,
A3
,
A4
,
A5
,
T
>
):
SyncDescriptor5
<
A1
,
A2
,
A3
,
A4
,
A5
,
T
>
;
<
A1
,
A2
,
A3
,
A4
,
A5
,
T
>
(
ctor
:
instantiation
.
I
New
ConstructorSignature5
<
A1
,
A2
,
A3
,
A4
,
A5
,
T
>
,
a1
:
A1
):
SyncDescriptor4
<
A2
,
A3
,
A4
,
A5
,
T
>
;
<
A1
,
A2
,
A3
,
A4
,
A5
,
T
>
(
ctor
:
instantiation
.
I
New
ConstructorSignature5
<
A1
,
A2
,
A3
,
A4
,
A5
,
T
>
,
a1
:
A1
,
a2
:
A2
):
SyncDescriptor3
<
A3
,
A4
,
A5
,
T
>
;
<
A1
,
A2
,
A3
,
A4
,
A5
,
T
>
(
ctor
:
instantiation
.
I
New
ConstructorSignature5
<
A1
,
A2
,
A3
,
A4
,
A5
,
T
>
,
a1
:
A1
,
a2
:
A2
,
a3
:
A3
):
SyncDescriptor2
<
A4
,
A5
,
T
>
;
<
A1
,
A2
,
A3
,
A4
,
A5
,
T
>
(
ctor
:
instantiation
.
I
New
ConstructorSignature5
<
A1
,
A2
,
A3
,
A4
,
A5
,
T
>
,
a1
:
A1
,
a2
:
A2
,
a3
:
A3
,
a4
:
A4
):
SyncDescriptor1
<
A5
,
T
>
;
<
A1
,
A2
,
A3
,
A4
,
A5
,
T
>
(
ctor
:
instantiation
.
I
New
ConstructorSignature5
<
A1
,
A2
,
A3
,
A4
,
A5
,
T
>
,
a1
:
A1
,
a2
:
A2
,
a3
:
A3
,
a4
:
A4
,
a5
:
A5
):
SyncDescriptor0
<
T
>
;
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
T
>
(
ctor
:
instantiation
.
I
New
ConstructorSignature6
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
T
>
):
SyncDescriptor6
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
T
>
;
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
T
>
(
ctor
:
instantiation
.
I
New
ConstructorSignature6
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
T
>
,
a1
:
A1
):
SyncDescriptor5
<
A2
,
A3
,
A4
,
A5
,
A6
,
T
>
;
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
T
>
(
ctor
:
instantiation
.
I
New
ConstructorSignature6
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
T
>
,
a1
:
A1
,
a2
:
A2
):
SyncDescriptor4
<
A3
,
A4
,
A5
,
A6
,
T
>
;
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
T
>
(
ctor
:
instantiation
.
I
New
ConstructorSignature6
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
T
>
,
a1
:
A1
,
a2
:
A2
,
a3
:
A3
):
SyncDescriptor3
<
A4
,
A5
,
A6
,
T
>
;
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
T
>
(
ctor
:
instantiation
.
I
New
ConstructorSignature6
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
T
>
,
a1
:
A1
,
a2
:
A2
,
a3
:
A3
,
a4
:
A4
):
SyncDescriptor2
<
A5
,
A6
,
T
>
;
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
T
>
(
ctor
:
instantiation
.
I
New
ConstructorSignature6
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
T
>
,
a1
:
A1
,
a2
:
A2
,
a3
:
A3
,
a4
:
A4
,
a5
:
A5
):
SyncDescriptor1
<
A6
,
T
>
;
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
T
>
(
ctor
:
instantiation
.
I
New
ConstructorSignature6
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
T
>
,
a1
:
A1
,
a2
:
A2
,
a3
:
A3
,
a4
:
A4
,
a5
:
A5
,
a6
:
A6
):
SyncDescriptor0
<
T
>
;
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
T
>
(
ctor
:
instantiation
.
I
New
ConstructorSignature7
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
T
>
):
SyncDescriptor7
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
T
>
;
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
T
>
(
ctor
:
instantiation
.
I
New
ConstructorSignature7
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
T
>
,
a1
:
A1
):
SyncDescriptor6
<
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
T
>
;
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
T
>
(
ctor
:
instantiation
.
I
New
ConstructorSignature7
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
T
>
,
a1
:
A1
,
a2
:
A2
):
SyncDescriptor5
<
A3
,
A4
,
A5
,
A6
,
A7
,
T
>
;
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
T
>
(
ctor
:
instantiation
.
I
New
ConstructorSignature7
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
T
>
,
a1
:
A1
,
a2
:
A2
,
a3
:
A3
):
SyncDescriptor4
<
A4
,
A5
,
A6
,
A7
,
T
>
;
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
T
>
(
ctor
:
instantiation
.
I
New
ConstructorSignature7
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
T
>
,
a1
:
A1
,
a2
:
A2
,
a3
:
A3
,
a4
:
A4
):
SyncDescriptor3
<
A5
,
A6
,
A7
,
T
>
;
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
T
>
(
ctor
:
instantiation
.
I
New
ConstructorSignature7
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
T
>
,
a1
:
A1
,
a2
:
A2
,
a3
:
A3
,
a4
:
A4
,
a5
:
A5
):
SyncDescriptor2
<
A6
,
A7
,
T
>
;
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
T
>
(
ctor
:
instantiation
.
I
New
ConstructorSignature7
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
T
>
,
a1
:
A1
,
a2
:
A2
,
a3
:
A3
,
a4
:
A4
,
a5
:
A5
,
a6
:
A6
):
SyncDescriptor1
<
A7
,
T
>
;
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
T
>
(
ctor
:
instantiation
.
I
New
ConstructorSignature7
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
T
>
,
a1
:
A1
,
a2
:
A2
,
a3
:
A3
,
a4
:
A4
,
a5
:
A5
,
a6
:
A6
,
a7
:
A7
):
SyncDescriptor0
<
T
>
;
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
A8
,
T
>
(
ctor
:
instantiation
.
I
New
ConstructorSignature8
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
A8
,
T
>
):
SyncDescriptor8
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
A8
,
T
>
;
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
A8
,
T
>
(
ctor
:
instantiation
.
I
New
ConstructorSignature8
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
A8
,
T
>
,
a1
:
A1
):
SyncDescriptor7
<
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
A8
,
T
>
;
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
A8
,
T
>
(
ctor
:
instantiation
.
I
New
ConstructorSignature8
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
A8
,
T
>
,
a1
:
A1
,
a2
:
A2
):
SyncDescriptor6
<
A3
,
A4
,
A5
,
A6
,
A7
,
A8
,
T
>
;
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
A8
,
T
>
(
ctor
:
instantiation
.
I
New
ConstructorSignature8
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
A8
,
T
>
,
a1
:
A1
,
a2
:
A2
,
a3
:
A3
):
SyncDescriptor5
<
A4
,
A5
,
A6
,
A7
,
A8
,
T
>
;
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
A8
,
T
>
(
ctor
:
instantiation
.
I
New
ConstructorSignature8
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
A8
,
T
>
,
a1
:
A1
,
a2
:
A2
,
a3
:
A3
,
a4
:
A4
):
SyncDescriptor4
<
A5
,
A6
,
A7
,
A8
,
T
>
;
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
A8
,
T
>
(
ctor
:
instantiation
.
I
New
ConstructorSignature8
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
A8
,
T
>
,
a1
:
A1
,
a2
:
A2
,
a3
:
A3
,
a4
:
A4
,
a5
:
A5
):
SyncDescriptor3
<
A6
,
A7
,
A8
,
T
>
;
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
A8
,
T
>
(
ctor
:
instantiation
.
I
New
ConstructorSignature8
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
A8
,
T
>
,
a1
:
A1
,
a2
:
A2
,
a3
:
A3
,
a4
:
A4
,
a5
:
A5
,
a6
:
A6
):
SyncDescriptor2
<
A7
,
A8
,
T
>
;
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
A8
,
T
>
(
ctor
:
instantiation
.
I
New
ConstructorSignature8
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
A8
,
T
>
,
a1
:
A1
,
a2
:
A2
,
a3
:
A3
,
a4
:
A4
,
a5
:
A5
,
a6
:
A6
,
a7
:
A7
):
SyncDescriptor1
<
A8
,
T
>
;
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
A8
,
T
>
(
ctor
:
instantiation
.
I
New
ConstructorSignature8
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
A8
,
T
>
,
a1
:
A1
,
a2
:
A2
,
a3
:
A3
,
a4
:
A4
,
a5
:
A5
,
a6
:
A6
,
a7
:
A7
,
a8
:
A8
):
SyncDescriptor0
<
T
>
;
<
T
>
(
ctor
:
instantiation
.
IConstructorSignature0
<
T
>
):
SyncDescriptor0
<
T
>
;
<
A1
,
T
>
(
ctor
:
instantiation
.
IConstructorSignature1
<
A1
,
T
>
):
SyncDescriptor1
<
A1
,
T
>
;
<
A1
,
T
>
(
ctor
:
instantiation
.
IConstructorSignature1
<
A1
,
T
>
,
a1
:
A1
):
SyncDescriptor0
<
T
>
;
<
A1
,
A2
,
T
>
(
ctor
:
instantiation
.
IConstructorSignature2
<
A1
,
A2
,
T
>
):
SyncDescriptor2
<
A1
,
A2
,
T
>
;
<
A1
,
A2
,
T
>
(
ctor
:
instantiation
.
IConstructorSignature2
<
A1
,
A2
,
T
>
,
a1
:
A1
):
SyncDescriptor1
<
A2
,
T
>
;
<
A1
,
A2
,
T
>
(
ctor
:
instantiation
.
IConstructorSignature2
<
A1
,
A2
,
T
>
,
a1
:
A1
,
a2
:
A2
):
SyncDescriptor0
<
T
>
;
<
A1
,
A2
,
A3
,
T
>
(
ctor
:
instantiation
.
IConstructorSignature3
<
A1
,
A2
,
A3
,
T
>
):
SyncDescriptor3
<
A1
,
A2
,
A3
,
T
>
;
<
A1
,
A2
,
A3
,
T
>
(
ctor
:
instantiation
.
IConstructorSignature3
<
A1
,
A2
,
A3
,
T
>
,
a1
:
A1
):
SyncDescriptor2
<
A2
,
A3
,
T
>
;
<
A1
,
A2
,
A3
,
T
>
(
ctor
:
instantiation
.
IConstructorSignature3
<
A1
,
A2
,
A3
,
T
>
,
a1
:
A1
,
a2
:
A2
):
SyncDescriptor1
<
A3
,
T
>
;
<
A1
,
A2
,
A3
,
T
>
(
ctor
:
instantiation
.
IConstructorSignature3
<
A1
,
A2
,
A3
,
T
>
,
a1
:
A1
,
a2
:
A2
,
a3
:
A3
):
SyncDescriptor0
<
T
>
;
<
A1
,
A2
,
A3
,
A4
,
T
>
(
ctor
:
instantiation
.
IConstructorSignature4
<
A1
,
A2
,
A3
,
A4
,
T
>
):
SyncDescriptor4
<
A1
,
A2
,
A3
,
A4
,
T
>
;
<
A1
,
A2
,
A3
,
A4
,
T
>
(
ctor
:
instantiation
.
IConstructorSignature4
<
A1
,
A2
,
A3
,
A4
,
T
>
,
a1
:
A1
):
SyncDescriptor3
<
A2
,
A3
,
A4
,
T
>
;
<
A1
,
A2
,
A3
,
A4
,
T
>
(
ctor
:
instantiation
.
IConstructorSignature4
<
A1
,
A2
,
A3
,
A4
,
T
>
,
a1
:
A1
,
a2
:
A2
):
SyncDescriptor2
<
A3
,
A4
,
T
>
;
<
A1
,
A2
,
A3
,
A4
,
T
>
(
ctor
:
instantiation
.
IConstructorSignature4
<
A1
,
A2
,
A3
,
A4
,
T
>
,
a1
:
A1
,
a2
:
A2
,
a3
:
A3
):
SyncDescriptor1
<
A4
,
T
>
;
<
A1
,
A2
,
A3
,
A4
,
T
>
(
ctor
:
instantiation
.
IConstructorSignature4
<
A1
,
A2
,
A3
,
A4
,
T
>
,
a1
:
A1
,
a2
:
A2
,
a3
:
A3
,
a4
:
A4
):
SyncDescriptor0
<
T
>
;
<
A1
,
A2
,
A3
,
A4
,
A5
,
T
>
(
ctor
:
instantiation
.
IConstructorSignature5
<
A1
,
A2
,
A3
,
A4
,
A5
,
T
>
):
SyncDescriptor5
<
A1
,
A2
,
A3
,
A4
,
A5
,
T
>
;
<
A1
,
A2
,
A3
,
A4
,
A5
,
T
>
(
ctor
:
instantiation
.
IConstructorSignature5
<
A1
,
A2
,
A3
,
A4
,
A5
,
T
>
,
a1
:
A1
):
SyncDescriptor4
<
A2
,
A3
,
A4
,
A5
,
T
>
;
<
A1
,
A2
,
A3
,
A4
,
A5
,
T
>
(
ctor
:
instantiation
.
IConstructorSignature5
<
A1
,
A2
,
A3
,
A4
,
A5
,
T
>
,
a1
:
A1
,
a2
:
A2
):
SyncDescriptor3
<
A3
,
A4
,
A5
,
T
>
;
<
A1
,
A2
,
A3
,
A4
,
A5
,
T
>
(
ctor
:
instantiation
.
IConstructorSignature5
<
A1
,
A2
,
A3
,
A4
,
A5
,
T
>
,
a1
:
A1
,
a2
:
A2
,
a3
:
A3
):
SyncDescriptor2
<
A4
,
A5
,
T
>
;
<
A1
,
A2
,
A3
,
A4
,
A5
,
T
>
(
ctor
:
instantiation
.
IConstructorSignature5
<
A1
,
A2
,
A3
,
A4
,
A5
,
T
>
,
a1
:
A1
,
a2
:
A2
,
a3
:
A3
,
a4
:
A4
):
SyncDescriptor1
<
A5
,
T
>
;
<
A1
,
A2
,
A3
,
A4
,
A5
,
T
>
(
ctor
:
instantiation
.
IConstructorSignature5
<
A1
,
A2
,
A3
,
A4
,
A5
,
T
>
,
a1
:
A1
,
a2
:
A2
,
a3
:
A3
,
a4
:
A4
,
a5
:
A5
):
SyncDescriptor0
<
T
>
;
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
T
>
(
ctor
:
instantiation
.
IConstructorSignature6
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
T
>
):
SyncDescriptor6
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
T
>
;
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
T
>
(
ctor
:
instantiation
.
IConstructorSignature6
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
T
>
,
a1
:
A1
):
SyncDescriptor5
<
A2
,
A3
,
A4
,
A5
,
A6
,
T
>
;
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
T
>
(
ctor
:
instantiation
.
IConstructorSignature6
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
T
>
,
a1
:
A1
,
a2
:
A2
):
SyncDescriptor4
<
A3
,
A4
,
A5
,
A6
,
T
>
;
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
T
>
(
ctor
:
instantiation
.
IConstructorSignature6
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
T
>
,
a1
:
A1
,
a2
:
A2
,
a3
:
A3
):
SyncDescriptor3
<
A4
,
A5
,
A6
,
T
>
;
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
T
>
(
ctor
:
instantiation
.
IConstructorSignature6
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
T
>
,
a1
:
A1
,
a2
:
A2
,
a3
:
A3
,
a4
:
A4
):
SyncDescriptor2
<
A5
,
A6
,
T
>
;
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
T
>
(
ctor
:
instantiation
.
IConstructorSignature6
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
T
>
,
a1
:
A1
,
a2
:
A2
,
a3
:
A3
,
a4
:
A4
,
a5
:
A5
):
SyncDescriptor1
<
A6
,
T
>
;
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
T
>
(
ctor
:
instantiation
.
IConstructorSignature6
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
T
>
,
a1
:
A1
,
a2
:
A2
,
a3
:
A3
,
a4
:
A4
,
a5
:
A5
,
a6
:
A6
):
SyncDescriptor0
<
T
>
;
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
T
>
(
ctor
:
instantiation
.
IConstructorSignature7
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
T
>
):
SyncDescriptor7
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
T
>
;
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
T
>
(
ctor
:
instantiation
.
IConstructorSignature7
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
T
>
,
a1
:
A1
):
SyncDescriptor6
<
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
T
>
;
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
T
>
(
ctor
:
instantiation
.
IConstructorSignature7
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
T
>
,
a1
:
A1
,
a2
:
A2
):
SyncDescriptor5
<
A3
,
A4
,
A5
,
A6
,
A7
,
T
>
;
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
T
>
(
ctor
:
instantiation
.
IConstructorSignature7
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
T
>
,
a1
:
A1
,
a2
:
A2
,
a3
:
A3
):
SyncDescriptor4
<
A4
,
A5
,
A6
,
A7
,
T
>
;
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
T
>
(
ctor
:
instantiation
.
IConstructorSignature7
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
T
>
,
a1
:
A1
,
a2
:
A2
,
a3
:
A3
,
a4
:
A4
):
SyncDescriptor3
<
A5
,
A6
,
A7
,
T
>
;
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
T
>
(
ctor
:
instantiation
.
IConstructorSignature7
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
T
>
,
a1
:
A1
,
a2
:
A2
,
a3
:
A3
,
a4
:
A4
,
a5
:
A5
):
SyncDescriptor2
<
A6
,
A7
,
T
>
;
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
T
>
(
ctor
:
instantiation
.
IConstructorSignature7
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
T
>
,
a1
:
A1
,
a2
:
A2
,
a3
:
A3
,
a4
:
A4
,
a5
:
A5
,
a6
:
A6
):
SyncDescriptor1
<
A7
,
T
>
;
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
T
>
(
ctor
:
instantiation
.
IConstructorSignature7
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
T
>
,
a1
:
A1
,
a2
:
A2
,
a3
:
A3
,
a4
:
A4
,
a5
:
A5
,
a6
:
A6
,
a7
:
A7
):
SyncDescriptor0
<
T
>
;
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
A8
,
T
>
(
ctor
:
instantiation
.
IConstructorSignature8
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
A8
,
T
>
):
SyncDescriptor8
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
A8
,
T
>
;
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
A8
,
T
>
(
ctor
:
instantiation
.
IConstructorSignature8
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
A8
,
T
>
,
a1
:
A1
):
SyncDescriptor7
<
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
A8
,
T
>
;
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
A8
,
T
>
(
ctor
:
instantiation
.
IConstructorSignature8
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
A8
,
T
>
,
a1
:
A1
,
a2
:
A2
):
SyncDescriptor6
<
A3
,
A4
,
A5
,
A6
,
A7
,
A8
,
T
>
;
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
A8
,
T
>
(
ctor
:
instantiation
.
IConstructorSignature8
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
A8
,
T
>
,
a1
:
A1
,
a2
:
A2
,
a3
:
A3
):
SyncDescriptor5
<
A4
,
A5
,
A6
,
A7
,
A8
,
T
>
;
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
A8
,
T
>
(
ctor
:
instantiation
.
IConstructorSignature8
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
A8
,
T
>
,
a1
:
A1
,
a2
:
A2
,
a3
:
A3
,
a4
:
A4
):
SyncDescriptor4
<
A5
,
A6
,
A7
,
A8
,
T
>
;
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
A8
,
T
>
(
ctor
:
instantiation
.
IConstructorSignature8
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
A8
,
T
>
,
a1
:
A1
,
a2
:
A2
,
a3
:
A3
,
a4
:
A4
,
a5
:
A5
):
SyncDescriptor3
<
A6
,
A7
,
A8
,
T
>
;
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
A8
,
T
>
(
ctor
:
instantiation
.
IConstructorSignature8
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
A8
,
T
>
,
a1
:
A1
,
a2
:
A2
,
a3
:
A3
,
a4
:
A4
,
a5
:
A5
,
a6
:
A6
):
SyncDescriptor2
<
A7
,
A8
,
T
>
;
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
A8
,
T
>
(
ctor
:
instantiation
.
IConstructorSignature8
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
A8
,
T
>
,
a1
:
A1
,
a2
:
A2
,
a3
:
A3
,
a4
:
A4
,
a5
:
A5
,
a6
:
A6
,
a7
:
A7
):
SyncDescriptor1
<
A8
,
T
>
;
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
A8
,
T
>
(
ctor
:
instantiation
.
IConstructorSignature8
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
A8
,
T
>
,
a1
:
A1
,
a2
:
A2
,
a3
:
A3
,
a4
:
A4
,
a5
:
A5
,
a6
:
A6
,
a7
:
A7
,
a8
:
A8
):
SyncDescriptor0
<
T
>
;
}
export
const
createSyncDescriptor
:
CreateSyncFunc
=
<
T
>
(
ctor
:
any
,
...
staticArguments
:
any
[]):
any
=>
{
return
new
SyncDescriptor
<
T
>
(
ctor
,
...
staticArguments
);
...
...
src/vs/platform/instantiation/common/extensions.ts
浏览文件 @
cd9f8897
...
...
@@ -5,7 +5,7 @@
'
use strict
'
;
import
{
SyncDescriptor
}
from
'
./descriptors
'
;
import
{
ServiceIdentifier
,
I
New
ConstructorSignature0
}
from
'
./instantiation
'
;
import
{
ServiceIdentifier
,
IConstructorSignature0
}
from
'
./instantiation
'
;
export
const
Services
=
'
di.services
'
;
...
...
@@ -16,7 +16,7 @@ export interface IServiceContribution<T> {
const
_registry
:
IServiceContribution
<
any
>
[]
=
[];
export
function
registerSingleton
<
T
>
(
id
:
ServiceIdentifier
<
T
>
,
ctor
:
I
New
ConstructorSignature0
<
T
>
):
void
{
export
function
registerSingleton
<
T
>
(
id
:
ServiceIdentifier
<
T
>
,
ctor
:
IConstructorSignature0
<
T
>
):
void
{
_registry
.
push
({
id
,
descriptor
:
new
SyncDescriptor
<
T
>
(
ctor
)
});
}
...
...
src/vs/platform/instantiation/common/instantiation.ts
浏览文件 @
cd9f8897
...
...
@@ -27,39 +27,39 @@ export namespace _util {
// ----------------------- interfaces -----------------------
export
interface
I
New
ConstructorSignature0
<
T
>
{
export
interface
IConstructorSignature0
<
T
>
{
new
(...
services
:
{
serviceId
:
ServiceIdentifier
<
any
>
;
}[]):
T
;
}
export
interface
I
New
ConstructorSignature1
<
A1
,
T
>
{
export
interface
IConstructorSignature1
<
A1
,
T
>
{
new
(
first
:
A1
,
...
services
:
{
serviceId
:
ServiceIdentifier
<
any
>
;
}[]):
T
;
}
export
interface
I
New
ConstructorSignature2
<
A1
,
A2
,
T
>
{
export
interface
IConstructorSignature2
<
A1
,
A2
,
T
>
{
new
(
first
:
A1
,
second
:
A2
,
...
services
:
{
serviceId
:
ServiceIdentifier
<
any
>
;
}[]):
T
;
}
export
interface
I
New
ConstructorSignature3
<
A1
,
A2
,
A3
,
T
>
{
export
interface
IConstructorSignature3
<
A1
,
A2
,
A3
,
T
>
{
new
(
first
:
A1
,
second
:
A2
,
third
:
A3
,
...
services
:
{
serviceId
:
ServiceIdentifier
<
any
>
;
}[]):
T
;
}
export
interface
I
New
ConstructorSignature4
<
A1
,
A2
,
A3
,
A4
,
T
>
{
export
interface
IConstructorSignature4
<
A1
,
A2
,
A3
,
A4
,
T
>
{
new
(
first
:
A1
,
second
:
A2
,
third
:
A3
,
forth
:
A4
,
...
services
:
{
serviceId
:
ServiceIdentifier
<
any
>
;
}[]):
T
;
}
export
interface
I
New
ConstructorSignature5
<
A1
,
A2
,
A3
,
A4
,
A5
,
T
>
{
export
interface
IConstructorSignature5
<
A1
,
A2
,
A3
,
A4
,
A5
,
T
>
{
new
(
first
:
A1
,
second
:
A2
,
third
:
A3
,
forth
:
A4
,
fifth
:
A5
,
...
services
:
{
serviceId
:
ServiceIdentifier
<
any
>
;
}[]):
T
;
}
export
interface
I
New
ConstructorSignature6
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
T
>
{
export
interface
IConstructorSignature6
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
T
>
{
new
(
first
:
A1
,
second
:
A2
,
third
:
A3
,
forth
:
A4
,
fifth
:
A5
,
sixth
:
A6
,
...
services
:
{
serviceId
:
ServiceIdentifier
<
any
>
;
}[]):
T
;
}
export
interface
I
New
ConstructorSignature7
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
T
>
{
export
interface
IConstructorSignature7
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
T
>
{
new
(
first
:
A1
,
second
:
A2
,
third
:
A3
,
forth
:
A4
,
fifth
:
A5
,
sixth
:
A6
,
seventh
:
A7
,
...
services
:
{
serviceId
:
ServiceIdentifier
<
any
>
;
}[]):
T
;
}
export
interface
I
New
ConstructorSignature8
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
A8
,
T
>
{
export
interface
IConstructorSignature8
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
A8
,
T
>
{
new
(
first
:
A1
,
second
:
A2
,
third
:
A3
,
forth
:
A4
,
fifth
:
A5
,
sixth
:
A6
,
seventh
:
A7
,
eigth
:
A8
,
...
services
:
{
serviceId
:
ServiceIdentifier
<
any
>
;
}[]):
T
;
}
...
...
@@ -117,7 +117,7 @@ export interface IInstantiationService {
*/
getInstance
<
T
>
(
id
:
ServiceIdentifier
<
T
>
):
T
;
/**
* Synchronously creates an instance that is denoted by
* the descriptor
...
...
@@ -132,15 +132,15 @@ export interface IInstantiationService {
createInstance
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
T
>
(
descriptor
:
descriptors
.
SyncDescriptor7
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
T
>
,
a1
:
A1
,
a2
:
A2
,
a3
:
A3
,
a4
:
A4
,
a5
:
A5
,
a6
:
A6
,
a7
:
A7
):
T
;
createInstance
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
A8
,
T
>
(
descriptor
:
descriptors
.
SyncDescriptor8
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
A8
,
T
>
,
a1
:
A1
,
a2
:
A2
,
a3
:
A3
,
a4
:
A4
,
a5
:
A5
,
a6
:
A6
,
a7
:
A7
,
a8
:
A8
):
T
;
createInstance
<
T
>
(
ctor
:
I
New
ConstructorSignature0
<
T
>
):
T
;
createInstance
<
A1
,
T
>
(
ctor
:
I
New
ConstructorSignature1
<
A1
,
T
>
,
first
:
A1
):
T
;
createInstance
<
A1
,
A2
,
T
>
(
ctor
:
I
New
ConstructorSignature2
<
A1
,
A2
,
T
>
,
first
:
A1
,
second
:
A2
):
T
;
createInstance
<
A1
,
A2
,
A3
,
T
>
(
ctor
:
I
New
ConstructorSignature3
<
A1
,
A2
,
A3
,
T
>
,
first
:
A1
,
second
:
A2
,
third
:
A3
):
T
;
createInstance
<
A1
,
A2
,
A3
,
A4
,
T
>
(
ctor
:
I
New
ConstructorSignature4
<
A1
,
A2
,
A3
,
A4
,
T
>
,
first
:
A1
,
second
:
A2
,
third
:
A3
,
fourth
:
A4
):
T
;
createInstance
<
A1
,
A2
,
A3
,
A4
,
A5
,
T
>
(
ctor
:
I
New
ConstructorSignature5
<
A1
,
A2
,
A3
,
A4
,
A5
,
T
>
,
first
:
A1
,
second
:
A2
,
third
:
A3
,
fourth
:
A4
,
fifth
:
A5
):
T
;
createInstance
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
T
>
(
ctor
:
I
New
ConstructorSignature6
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
T
>
,
first
:
A1
,
second
:
A2
,
third
:
A3
,
fourth
:
A4
,
fifth
:
A5
,
sixth
:
A6
):
T
;
createInstance
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
T
>
(
ctor
:
I
New
ConstructorSignature7
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
T
>
,
first
:
A1
,
second
:
A2
,
third
:
A3
,
fourth
:
A4
,
fifth
:
A5
,
sixth
:
A6
,
seventh
:
A7
):
T
;
createInstance
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
A8
,
T
>
(
ctor
:
I
New
ConstructorSignature8
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
A8
,
T
>
,
first
:
A1
,
second
:
A2
,
third
:
A3
,
fourth
:
A4
,
fifth
:
A5
,
sixth
:
A6
,
seventh
:
A7
,
eigth
:
A8
):
T
;
createInstance
<
T
>
(
ctor
:
IConstructorSignature0
<
T
>
):
T
;
createInstance
<
A1
,
T
>
(
ctor
:
IConstructorSignature1
<
A1
,
T
>
,
first
:
A1
):
T
;
createInstance
<
A1
,
A2
,
T
>
(
ctor
:
IConstructorSignature2
<
A1
,
A2
,
T
>
,
first
:
A1
,
second
:
A2
):
T
;
createInstance
<
A1
,
A2
,
A3
,
T
>
(
ctor
:
IConstructorSignature3
<
A1
,
A2
,
A3
,
T
>
,
first
:
A1
,
second
:
A2
,
third
:
A3
):
T
;
createInstance
<
A1
,
A2
,
A3
,
A4
,
T
>
(
ctor
:
IConstructorSignature4
<
A1
,
A2
,
A3
,
A4
,
T
>
,
first
:
A1
,
second
:
A2
,
third
:
A3
,
fourth
:
A4
):
T
;
createInstance
<
A1
,
A2
,
A3
,
A4
,
A5
,
T
>
(
ctor
:
IConstructorSignature5
<
A1
,
A2
,
A3
,
A4
,
A5
,
T
>
,
first
:
A1
,
second
:
A2
,
third
:
A3
,
fourth
:
A4
,
fifth
:
A5
):
T
;
createInstance
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
T
>
(
ctor
:
IConstructorSignature6
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
T
>
,
first
:
A1
,
second
:
A2
,
third
:
A3
,
fourth
:
A4
,
fifth
:
A5
,
sixth
:
A6
):
T
;
createInstance
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
T
>
(
ctor
:
IConstructorSignature7
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
T
>
,
first
:
A1
,
second
:
A2
,
third
:
A3
,
fourth
:
A4
,
fifth
:
A5
,
sixth
:
A6
,
seventh
:
A7
):
T
;
createInstance
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
A8
,
T
>
(
ctor
:
IConstructorSignature8
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
A8
,
T
>
,
first
:
A1
,
second
:
A2
,
third
:
A3
,
fourth
:
A4
,
fifth
:
A5
,
sixth
:
A6
,
seventh
:
A7
,
eigth
:
A8
):
T
;
/**
* Asynchronously creates an instance that is denoted by
...
...
src/vs/platform/instantiation/common/instantiationService.ts
浏览文件 @
cd9f8897
...
...
@@ -207,7 +207,10 @@ class ServicesMap {
allArguments
=
[
descriptor
.
ctor
,
this
/*this === ctx*/
];
allArguments
.
push
.
apply
(
allArguments
,
descriptor
.
staticArguments
());
allArguments
.
push
.
apply
(
allArguments
,
args
);
console
.
warn
(
'
using OLD INJECTION STYLE for
'
+
descriptor
.
ctor
.
name
);
if
(
allArguments
.
length
>
1
)
{
console
.
warn
(
'
using OLD INJECTION STYLE for
'
+
descriptor
.
ctor
.
name
);
}
}
return
this
.
_lock
.
runUnlocked
(()
=>
{
...
...
@@ -255,16 +258,16 @@ class InstantiationService implements IInstantiationService {
let
result
=
this
.
_servicesMap
.
lock
.
runUnlocked
(()
=>
this
.
_servicesMap
[
name
]);
return
result
;
}
createInstance
<
T
>
(
ctor
:
instantiation
.
I
New
ConstructorSignature0
<
T
>
,
...
rest
:
any
[]):
T
;
createInstance
<
A1
,
T
>
(
ctor
:
instantiation
.
I
New
ConstructorSignature1
<
A1
,
T
>
,
...
rest
:
any
[]):
T
;
createInstance
<
A1
,
A2
,
T
>
(
ctor
:
instantiation
.
I
New
ConstructorSignature2
<
A1
,
A2
,
T
>
,
...
rest
:
any
[]):
T
;
createInstance
<
A1
,
A2
,
A3
,
T
>
(
ctor
:
instantiation
.
I
New
ConstructorSignature3
<
A1
,
A2
,
A3
,
T
>
,
...
rest
:
any
[]):
T
;
createInstance
<
A1
,
A2
,
A3
,
A4
,
T
>
(
ctor
:
instantiation
.
I
New
ConstructorSignature4
<
A1
,
A2
,
A3
,
A4
,
T
>
,
first
:
A1
,
second
:
A2
,
third
:
A3
,
fourth
:
A4
):
T
;
createInstance
<
A1
,
A2
,
A3
,
A4
,
A5
,
T
>
(
ctor
:
instantiation
.
I
New
ConstructorSignature5
<
A1
,
A2
,
A3
,
A4
,
A5
,
T
>
,
first
:
A1
,
second
:
A2
,
third
:
A3
,
fourth
:
A4
,
fifth
:
A5
):
T
;
createInstance
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
T
>
(
ctor
:
instantiation
.
I
New
ConstructorSignature6
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
T
>
,
first
:
A1
,
second
:
A2
,
third
:
A3
,
fourth
:
A4
,
fifth
:
A5
,
sixth
:
A6
):
T
;
createInstance
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
T
>
(
ctor
:
instantiation
.
I
New
ConstructorSignature7
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
T
>
,
first
:
A1
,
second
:
A2
,
third
:
A3
,
fourth
:
A4
,
fifth
:
A5
,
sixth
:
A6
,
seventh
:
A7
):
T
;
createInstance
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
A8
,
T
>
(
ctor
:
instantiation
.
I
New
ConstructorSignature8
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
A8
,
T
>
,
first
:
A1
,
second
:
A2
,
third
:
A3
,
fourth
:
A4
,
fifth
:
A5
,
sixth
:
A6
,
seventh
:
A7
,
eigth
:
A8
):
T
;
createInstance
<
T
>
(
ctor
:
instantiation
.
IConstructorSignature0
<
T
>
,
...
rest
:
any
[]):
T
;
createInstance
<
A1
,
T
>
(
ctor
:
instantiation
.
IConstructorSignature1
<
A1
,
T
>
,
...
rest
:
any
[]):
T
;
createInstance
<
A1
,
A2
,
T
>
(
ctor
:
instantiation
.
IConstructorSignature2
<
A1
,
A2
,
T
>
,
...
rest
:
any
[]):
T
;
createInstance
<
A1
,
A2
,
A3
,
T
>
(
ctor
:
instantiation
.
IConstructorSignature3
<
A1
,
A2
,
A3
,
T
>
,
...
rest
:
any
[]):
T
;
createInstance
<
A1
,
A2
,
A3
,
A4
,
T
>
(
ctor
:
instantiation
.
IConstructorSignature4
<
A1
,
A2
,
A3
,
A4
,
T
>
,
first
:
A1
,
second
:
A2
,
third
:
A3
,
fourth
:
A4
):
T
;
createInstance
<
A1
,
A2
,
A3
,
A4
,
A5
,
T
>
(
ctor
:
instantiation
.
IConstructorSignature5
<
A1
,
A2
,
A3
,
A4
,
A5
,
T
>
,
first
:
A1
,
second
:
A2
,
third
:
A3
,
fourth
:
A4
,
fifth
:
A5
):
T
;
createInstance
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
T
>
(
ctor
:
instantiation
.
IConstructorSignature6
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
T
>
,
first
:
A1
,
second
:
A2
,
third
:
A3
,
fourth
:
A4
,
fifth
:
A5
,
sixth
:
A6
):
T
;
createInstance
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
T
>
(
ctor
:
instantiation
.
IConstructorSignature7
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
T
>
,
first
:
A1
,
second
:
A2
,
third
:
A3
,
fourth
:
A4
,
fifth
:
A5
,
sixth
:
A6
,
seventh
:
A7
):
T
;
createInstance
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
A8
,
T
>
(
ctor
:
instantiation
.
IConstructorSignature8
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
A8
,
T
>
,
first
:
A1
,
second
:
A2
,
third
:
A3
,
fourth
:
A4
,
fifth
:
A5
,
sixth
:
A6
,
seventh
:
A7
,
eigth
:
A8
):
T
;
createInstance
<
T
>
(
descriptor
:
descriptors
.
SyncDescriptor0
<
T
>
):
T
;
createInstance
<
A1
,
T
>
(
descriptor
:
descriptors
.
SyncDescriptor1
<
A1
,
T
>
,
a1
:
A1
):
T
;
...
...
@@ -300,7 +303,7 @@ class InstantiationService implements IInstantiationService {
}
else
if
(
param
instanceof
descriptors
.
AsyncDescriptor
)
{
return
this
.
_createInstanceAsync
(
<
descriptors
.
AsyncDescriptor
<
T
>>
param
,
rest
);
}
else
{
return
this
.
_servicesMap
.
createInstance
(
new
descriptors
.
SyncDescriptor
(
<
instantiation
.
I
New
ConstructorSignature0
<
T
>>
param
),
rest
);
return
this
.
_servicesMap
.
createInstance
(
new
descriptors
.
SyncDescriptor
(
<
instantiation
.
IConstructorSignature0
<
T
>>
param
),
rest
);
}
}
...
...
src/vs/platform/platform.ts
浏览文件 @
cd9f8897
...
...
@@ -6,7 +6,7 @@
import
Types
=
require
(
'
vs/base/common/types
'
);
import
Assert
=
require
(
'
vs/base/common/assert
'
);
import
{
IInstantiationService
,
I
New
ConstructorSignature0
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
IInstantiationService
,
IConstructorSignature0
}
from
'
vs/platform/instantiation/common/instantiation
'
;
export
interface
IRegistry
{
...
...
@@ -62,7 +62,7 @@ export var Registry = <IRegistry>new RegistryImpl();
* A base class for registries that leverage the instantiation service to create instances.
*/
export
class
BaseRegistry
<
T
>
{
private
toBeInstantiated
:
I
New
ConstructorSignature0
<
T
>
[]
=
[];
private
toBeInstantiated
:
IConstructorSignature0
<
T
>
[]
=
[];
private
instances
:
T
[]
=
[];
private
instantiationService
:
IInstantiationService
;
...
...
@@ -75,12 +75,12 @@ export class BaseRegistry<T> {
}
}
private
instantiate
(
ctor
:
I
New
ConstructorSignature0
<
T
>
):
void
{
private
instantiate
(
ctor
:
IConstructorSignature0
<
T
>
):
void
{
let
instance
=
this
.
instantiationService
.
createInstance
(
ctor
);
this
.
instances
.
push
(
instance
);
}
_register
(
ctor
:
I
New
ConstructorSignature0
<
T
>
):
void
{
_register
(
ctor
:
IConstructorSignature0
<
T
>
):
void
{
if
(
this
.
instantiationService
)
{
this
.
instantiate
(
ctor
);
}
else
{
...
...
src/vs/platform/thread/common/abstractThreadService.ts
浏览文件 @
cd9f8897
...
...
@@ -34,10 +34,10 @@ export abstract class AbstractThreadService implements remote.IManyHandler {
this
.
_instantiationService
=
service
;
}
createInstance
<
T
extends
IThreadSynchronizableObject
>
(
ctor
:
instantiation
.
I
New
ConstructorSignature0
<
T
>
):
T
;
createInstance
<
A1
,
T
extends
IThreadSynchronizableObject
>
(
ctor
:
instantiation
.
I
New
ConstructorSignature1
<
A1
,
T
>
,
a1
:
A1
):
T
;
createInstance
<
A1
,
A2
,
T
extends
IThreadSynchronizableObject
>
(
ctor
:
instantiation
.
I
New
ConstructorSignature2
<
A1
,
A2
,
T
>
,
a1
:
A1
,
a2
:
A2
):
T
;
createInstance
<
A1
,
A2
,
A3
,
T
extends
IThreadSynchronizableObject
>
(
ctor
:
instantiation
.
I
New
ConstructorSignature3
<
A1
,
A2
,
A3
,
T
>
,
a1
:
A1
,
a2
:
A2
,
a3
:
A3
):
T
;
createInstance
<
T
extends
IThreadSynchronizableObject
>
(
ctor
:
instantiation
.
IConstructorSignature0
<
T
>
):
T
;
createInstance
<
A1
,
T
extends
IThreadSynchronizableObject
>
(
ctor
:
instantiation
.
IConstructorSignature1
<
A1
,
T
>
,
a1
:
A1
):
T
;
createInstance
<
A1
,
A2
,
T
extends
IThreadSynchronizableObject
>
(
ctor
:
instantiation
.
IConstructorSignature2
<
A1
,
A2
,
T
>
,
a1
:
A1
,
a2
:
A2
):
T
;
createInstance
<
A1
,
A2
,
A3
,
T
extends
IThreadSynchronizableObject
>
(
ctor
:
instantiation
.
IConstructorSignature3
<
A1
,
A2
,
A3
,
T
>
,
a1
:
A1
,
a2
:
A2
,
a3
:
A3
):
T
;
createInstance
<
T
extends
IThreadSynchronizableObject
>
(
descriptor
:
AsyncDescriptor0
<
T
>
):
T
;
createInstance
<
A1
,
T
extends
IThreadSynchronizableObject
>
(
descriptor
:
AsyncDescriptor1
<
A1
,
T
>
,
a1
:
A1
):
T
;
...
...
@@ -130,7 +130,7 @@ export abstract class AbstractThreadService implements remote.IManyHandler {
return
result
;
}
getRemotable
<
T
>
(
ctor
:
instantiation
.
I
New
ConstructorSignature0
<
T
>
):
T
{
getRemotable
<
T
>
(
ctor
:
instantiation
.
IConstructorSignature0
<
T
>
):
T
{
let
id
=
Remotable
.
getId
(
ctor
);
if
(
!
id
)
{
throw
new
Error
(
'
Unknown Remotable: <<
'
+
id
+
'
>>
'
);
...
...
src/vs/platform/thread/common/thread.ts
浏览文件 @
cd9f8897
...
...
@@ -24,10 +24,10 @@ export interface IThreadService {
OneWorker
(
obj
:
IThreadSynchronizableObject
,
methodName
:
string
,
target
:
Function
,
param
:
any
[],
affinity
:
ThreadAffinity
):
TPromise
<
any
>
;
AllWorkers
(
obj
:
IThreadSynchronizableObject
,
methodName
:
string
,
target
:
Function
,
param
:
any
[]):
TPromise
<
any
>
;
createInstance
<
T
extends
IThreadSynchronizableObject
>
(
ctor
:
instantiation
.
I
New
ConstructorSignature0
<
T
>
):
T
;
createInstance
<
A1
,
T
extends
IThreadSynchronizableObject
>
(
ctor
:
instantiation
.
I
New
ConstructorSignature1
<
A1
,
T
>
,
a1
:
A1
):
T
;
createInstance
<
A1
,
A2
,
T
extends
IThreadSynchronizableObject
>
(
ctor
:
instantiation
.
I
New
ConstructorSignature2
<
A1
,
A2
,
T
>
,
a1
:
A1
,
a2
:
A2
):
T
;
createInstance
<
A1
,
A2
,
A3
,
T
extends
IThreadSynchronizableObject
>
(
ctor
:
instantiation
.
I
New
ConstructorSignature3
<
A1
,
A2
,
A3
,
T
>
,
a1
:
A1
,
a2
:
A2
,
a3
:
A3
):
T
;
createInstance
<
T
extends
IThreadSynchronizableObject
>
(
ctor
:
instantiation
.
IConstructorSignature0
<
T
>
):
T
;
createInstance
<
A1
,
T
extends
IThreadSynchronizableObject
>
(
ctor
:
instantiation
.
IConstructorSignature1
<
A1
,
T
>
,
a1
:
A1
):
T
;
createInstance
<
A1
,
A2
,
T
extends
IThreadSynchronizableObject
>
(
ctor
:
instantiation
.
IConstructorSignature2
<
A1
,
A2
,
T
>
,
a1
:
A1
,
a2
:
A2
):
T
;
createInstance
<
A1
,
A2
,
A3
,
T
extends
IThreadSynchronizableObject
>
(
ctor
:
instantiation
.
IConstructorSignature3
<
A1
,
A2
,
A3
,
T
>
,
a1
:
A1
,
a2
:
A2
,
a3
:
A3
):
T
;
createInstance
<
T
extends
IThreadSynchronizableObject
>
(
descriptor
:
descriptors
.
AsyncDescriptor0
<
T
>
):
T
;
createInstance
<
A1
,
T
extends
IThreadSynchronizableObject
>
(
descriptor
:
descriptors
.
AsyncDescriptor1
<
A1
,
T
>
,
a1
:
A1
):
T
;
...
...
@@ -36,7 +36,7 @@ export interface IThreadService {
// --- END deprecated methods
getRemotable
<
T
>
(
ctor
:
instantiation
.
I
New
ConstructorSignature0
<
T
>
):
T
;
getRemotable
<
T
>
(
ctor
:
instantiation
.
IConstructorSignature0
<
T
>
):
T
;
registerRemotableInstance
(
ctor
:
any
,
instance
:
any
):
void
;
}
...
...
src/vs/workbench/browser/actionBarRegistry.ts
浏览文件 @
cd9f8897
...
...
@@ -12,7 +12,7 @@ import {Action, IAction} from 'vs/base/common/actions';
import
{
BaseActionItem
,
Separator
}
from
'
vs/base/browser/ui/actionbar/actionbar
'
;
import
{
IActionProvider
}
from
'
vs/base/parts/tree/browser/actionsRenderer
'
;
import
{
ITree
}
from
'
vs/base/parts/tree/browser/tree
'
;
import
{
IInstantiationService
,
I
New
ConstructorSignature0
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
IInstantiationService
,
IConstructorSignature0
}
from
'
vs/platform/instantiation/common/instantiation
'
;
/**
* The action bar contributor allows to add actions to an actionbar in a given context.
...
...
@@ -270,7 +270,7 @@ export interface IActionBarRegistry {
* Registers an Actionbar contributor. It will be called to contribute actions to all the action bars
* that are used in the Monaco Workbench in the given scope.
*/
registerActionBarContributor
(
scope
:
string
,
ctor
:
I
New
ConstructorSignature0
<
ActionBarContributor
>
):
void
;
registerActionBarContributor
(
scope
:
string
,
ctor
:
IConstructorSignature0
<
ActionBarContributor
>
):
void
;
/**
* Returns an array of registered action bar contributors known to the workbench for the given scope.
...
...
@@ -281,7 +281,7 @@ export interface IActionBarRegistry {
}
class
ActionBarRegistry
implements
IActionBarRegistry
{
private
actionBarContributorConstructors
:
{
scope
:
string
;
ctor
:
I
New
ConstructorSignature0
<
ActionBarContributor
>
;
}[]
=
[];
private
actionBarContributorConstructors
:
{
scope
:
string
;
ctor
:
IConstructorSignature0
<
ActionBarContributor
>
;
}[]
=
[];
private
actionBarContributorInstances
:
{
[
scope
:
string
]:
ActionBarContributor
[]
}
=
{};
private
instantiationService
:
IInstantiationService
;
...
...
@@ -294,7 +294,7 @@ class ActionBarRegistry implements IActionBarRegistry {
}
}
private
createActionBarContributor
(
scope
:
string
,
ctor
:
I
New
ConstructorSignature0
<
ActionBarContributor
>
):
void
{
private
createActionBarContributor
(
scope
:
string
,
ctor
:
IConstructorSignature0
<
ActionBarContributor
>
):
void
{
let
instance
=
this
.
instantiationService
.
createInstance
(
ctor
);
let
target
=
<
ActionBarContributor
[]
>
collections
.
lookupOrInsert
(
this
.
actionBarContributorInstances
,
scope
,
[]);
target
.
push
(
instance
);
...
...
@@ -347,7 +347,7 @@ class ActionBarRegistry implements IActionBarRegistry {
return
null
;
}
public
registerActionBarContributor
(
scope
:
string
,
ctor
:
I
New
ConstructorSignature0
<
ActionBarContributor
>
):
void
{
public
registerActionBarContributor
(
scope
:
string
,
ctor
:
IConstructorSignature0
<
ActionBarContributor
>
):
void
{
if
(
!
this
.
instantiationService
)
{
this
.
actionBarContributorConstructors
.
push
({
scope
:
scope
,
...
...
src/vs/workbench/browser/parts/editor/baseEditor.ts
浏览文件 @
cd9f8897
...
...
@@ -14,7 +14,7 @@ import {Registry} from 'vs/platform/platform';
import
{
Panel
}
from
'
vs/workbench/browser/panel
'
;
import
{
EditorInput
,
IFileEditorInput
,
EditorOptions
}
from
'
vs/workbench/common/editor
'
;
import
{
IEditor
,
Position
,
POSITIONS
}
from
'
vs/platform/editor/common/editor
'
;
import
{
IInstantiationService
,
I
New
ConstructorSignature0
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
IInstantiationService
,
IConstructorSignature0
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
SyncDescriptor
,
AsyncDescriptor
}
from
'
vs/platform/instantiation/common/descriptors
'
;
import
{
ITelemetryService
}
from
'
vs/platform/telemetry/common/telemetry
'
;
...
...
@@ -225,7 +225,7 @@ export interface IEditorRegistry {
* @param editorInputId the identifier of the editor input
* @param factory the editor input factory for serialization/deserialization
*/
registerEditorInputFactory
(
editorInputId
:
string
,
ctor
:
I
New
ConstructorSignature0
<
IEditorInputFactory
>
):
void
;
registerEditorInputFactory
(
editorInputId
:
string
,
ctor
:
IConstructorSignature0
<
IEditorInputFactory
>
):
void
;
/**
* Returns the editor input factory for the given editor input.
...
...
@@ -258,7 +258,7 @@ class EditorRegistry implements IEditorRegistry {
private
editors
:
EditorDescriptor
[];
private
instantiationService
:
IInstantiationService
;
private
defaultFileInputDescriptor
:
AsyncDescriptor
<
IFileEditorInput
>
;
private
editorInputFactoryConstructors
:
{
[
editorInputId
:
string
]:
I
New
ConstructorSignature0
<
IEditorInputFactory
>
}
=
Object
.
create
(
null
);
private
editorInputFactoryConstructors
:
{
[
editorInputId
:
string
]:
IConstructorSignature0
<
IEditorInputFactory
>
}
=
Object
.
create
(
null
);
private
editorInputFactoryInstances
:
{
[
editorInputId
:
string
]:
IEditorInputFactory
}
=
Object
.
create
(
null
);
constructor
()
{
...
...
@@ -276,7 +276,7 @@ class EditorRegistry implements IEditorRegistry {
this
.
editorInputFactoryConstructors
=
{};
}
private
createEditorInputFactory
(
editorInputId
:
string
,
ctor
:
I
New
ConstructorSignature0
<
IEditorInputFactory
>
):
void
{
private
createEditorInputFactory
(
editorInputId
:
string
,
ctor
:
IConstructorSignature0
<
IEditorInputFactory
>
):
void
{
let
instance
=
this
.
instantiationService
.
createInstance
(
ctor
);
this
.
editorInputFactoryInstances
[
editorInputId
]
=
instance
;
}
...
...
@@ -388,7 +388,7 @@ class EditorRegistry implements IEditorRegistry {
return
this
.
defaultFileInputDescriptor
;
}
public
registerEditorInputFactory
(
editorInputId
:
string
,
ctor
:
I
New
ConstructorSignature0
<
IEditorInputFactory
>
):
void
{
public
registerEditorInputFactory
(
editorInputId
:
string
,
ctor
:
IConstructorSignature0
<
IEditorInputFactory
>
):
void
{
if
(
!
this
.
instantiationService
)
{
this
.
editorInputFactoryConstructors
[
editorInputId
]
=
ctor
;
}
else
{
...
...
src/vs/workbench/browser/parts/statusbar/statusbar.ts
浏览文件 @
cd9f8897
...
...
@@ -10,7 +10,7 @@ import {IDisposable} from 'vs/base/common/lifecycle';
import
statusbarService
=
require
(
'
vs/workbench/services/statusbar/common/statusbarService
'
);
/* tslint:enable:no-unused-variable */
import
{
SyncDescriptor0
,
createSyncDescriptor
}
from
'
vs/platform/instantiation/common/descriptors
'
;
import
{
I
New
ConstructorSignature0
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
IConstructorSignature0
}
from
'
vs/platform/instantiation/common/instantiation
'
;
export
interface
IStatusbarItem
{
render
(
element
:
HTMLElement
):
IDisposable
;
...
...
@@ -24,7 +24,7 @@ export class StatusbarItemDescriptor {
public
alignment
:
StatusbarAlignment
;
public
priority
:
number
;
constructor
(
ctor
:
I
New
ConstructorSignature0
<
IStatusbarItem
>
,
alignment
?:
StatusbarAlignment
,
priority
?:
number
)
{
constructor
(
ctor
:
IConstructorSignature0
<
IStatusbarItem
>
,
alignment
?:
StatusbarAlignment
,
priority
?:
number
)
{
this
.
syncDescriptor
=
createSyncDescriptor
(
ctor
);
this
.
alignment
=
alignment
||
StatusbarAlignment
.
LEFT
;
this
.
priority
=
priority
||
0
;
...
...
src/vs/workbench/common/contributions.ts
浏览文件 @
cd9f8897
...
...
@@ -5,7 +5,7 @@
'
use strict
'
;
import
{
Registry
,
BaseRegistry
}
from
'
vs/platform/platform
'
;
import
{
IInstantiationService
,
I
New
ConstructorSignature0
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
IInstantiationService
,
IConstructorSignature0
}
from
'
vs/platform/instantiation/common/instantiation
'
;
// --- Workbench Contribution Registry
...
...
@@ -24,7 +24,7 @@ export namespace Extensions {
export
const
Workbench
=
'
workbench.contributions.kind
'
;
}
export
type
IWorkbenchContributionSignature
=
I
New
ConstructorSignature0
<
IWorkbenchContribution
>
;
export
type
IWorkbenchContributionSignature
=
IConstructorSignature0
<
IWorkbenchContribution
>
;
export
interface
IWorkbenchContributionsRegistry
{
...
...
src/vs/workbench/parts/files/browser/fileActions.ts
浏览文件 @
cd9f8897
...
...
@@ -43,7 +43,7 @@ import {IPartService} from 'vs/workbench/services/part/common/partService';
import
{
IStorageService
}
from
'
vs/platform/storage/common/storage
'
;
import
{
IResourceInput
,
Position
,
IEditor
}
from
'
vs/platform/editor/common/editor
'
;
import
{
IEventService
}
from
'
vs/platform/event/common/event
'
;
import
{
IInstantiationService
,
I
New
ConstructorSignature2
,
INullService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
IInstantiationService
,
IConstructorSignature2
,
INullService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
IMessageService
,
IMessageWithAction
,
IConfirmation
,
Severity
,
CancelAction
}
from
'
vs/platform/message/common/message
'
;
import
{
IProgressService
,
IProgressRunner
}
from
'
vs/platform/progress/common/progress
'
;
import
{
IWorkspaceContextService
}
from
'
vs/platform/workspace/common/workspace
'
;
...
...
@@ -546,7 +546,7 @@ export abstract class BaseGlobalNewAction extends Action {
});
}
protected
abstract
getAction
():
I
New
ConstructorSignature2
<
ITree
,
IFileStat
,
Action
>
;
protected
abstract
getAction
():
IConstructorSignature2
<
ITree
,
IFileStat
,
Action
>
;
public
dispose
():
void
{
super
.
dispose
();
...
...
@@ -589,7 +589,7 @@ export class GlobalNewFolderAction extends BaseGlobalNewAction {
public
static
ID
=
'
workbench.action.files.newFolder
'
;
public
static
LABEL
=
nls
.
localize
(
'
newFolder
'
,
"
New Folder
"
);
protected
getAction
():
I
New
ConstructorSignature2
<
ITree
,
IFileStat
,
Action
>
{
protected
getAction
():
IConstructorSignature2
<
ITree
,
IFileStat
,
Action
>
{
return
NewFolderAction
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录