Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
a99eeae9
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 搜索 >>
提交
a99eeae9
编写于
8月 16, 2017
作者:
A
Alex Dima
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
More adoption of @extHostNamedCustomer
上级
4d5ded68
变更
30
隐藏空白更改
内联
并排
Showing
30 changed file
with
197 addition
and
136 deletion
+197
-136
src/vs/workbench/api/electron-browser/extensionHost.contribution.ts
...kbench/api/electron-browser/extensionHost.contribution.ts
+17
-52
src/vs/workbench/api/electron-browser/mainThreadConfiguration.ts
...workbench/api/electron-browser/mainThreadConfiguration.ts
+1
-1
src/vs/workbench/api/electron-browser/mainThreadCredentials.ts
...s/workbench/api/electron-browser/mainThreadCredentials.ts
+1
-1
src/vs/workbench/api/electron-browser/mainThreadDebugService.ts
.../workbench/api/electron-browser/mainThreadDebugService.ts
+1
-1
src/vs/workbench/api/electron-browser/mainThreadDiagnostics.ts
...s/workbench/api/electron-browser/mainThreadDiagnostics.ts
+7
-2
src/vs/workbench/api/electron-browser/mainThreadDocumentContentProviders.ts
...pi/electron-browser/mainThreadDocumentContentProviders.ts
+11
-4
src/vs/workbench/api/electron-browser/mainThreadErrors.ts
src/vs/workbench/api/electron-browser/mainThreadErrors.ts
+7
-3
src/vs/workbench/api/electron-browser/mainThreadExtensionService.ts
...kbench/api/electron-browser/mainThreadExtensionService.ts
+11
-3
src/vs/workbench/api/electron-browser/mainThreadLanguageFeatures.ts
...kbench/api/electron-browser/mainThreadLanguageFeatures.ts
+1
-1
src/vs/workbench/api/electron-browser/mainThreadLanguages.ts
src/vs/workbench/api/electron-browser/mainThreadLanguages.ts
+7
-1
src/vs/workbench/api/electron-browser/mainThreadMessageService.ts
...orkbench/api/electron-browser/mainThreadMessageService.ts
+7
-1
src/vs/workbench/api/electron-browser/mainThreadOutputService.ts
...workbench/api/electron-browser/mainThreadOutputService.ts
+8
-1
src/vs/workbench/api/electron-browser/mainThreadProgress.ts
src/vs/workbench/api/electron-browser/mainThreadProgress.ts
+4
-1
src/vs/workbench/api/electron-browser/mainThreadQuickOpen.ts
src/vs/workbench/api/electron-browser/mainThreadQuickOpen.ts
+1
-1
src/vs/workbench/api/electron-browser/mainThreadSCM.ts
src/vs/workbench/api/electron-browser/mainThreadSCM.ts
+17
-12
src/vs/workbench/api/electron-browser/mainThreadSaveParticipant.ts
...rkbench/api/electron-browser/mainThreadSaveParticipant.ts
+2
-2
src/vs/workbench/api/electron-browser/mainThreadStatusBar.ts
src/vs/workbench/api/electron-browser/mainThreadStatusBar.ts
+4
-1
src/vs/workbench/api/electron-browser/mainThreadStorage.ts
src/vs/workbench/api/electron-browser/mainThreadStorage.ts
+10
-2
src/vs/workbench/api/electron-browser/mainThreadTask.ts
src/vs/workbench/api/electron-browser/mainThreadTask.ts
+19
-4
src/vs/workbench/api/electron-browser/mainThreadTelemetry.ts
src/vs/workbench/api/electron-browser/mainThreadTelemetry.ts
+10
-5
src/vs/workbench/api/electron-browser/mainThreadTerminalService.ts
...rkbench/api/electron-browser/mainThreadTerminalService.ts
+8
-4
src/vs/workbench/api/electron-browser/mainThreadTreeViews.ts
src/vs/workbench/api/electron-browser/mainThreadTreeViews.ts
+10
-4
src/vs/workbench/api/electron-browser/mainThreadWorkspace.ts
src/vs/workbench/api/electron-browser/mainThreadWorkspace.ts
+11
-6
src/vs/workbench/api/node/extHost.api.impl.ts
src/vs/workbench/api/node/extHost.api.impl.ts
+2
-2
src/vs/workbench/api/node/extHost.protocol.ts
src/vs/workbench/api/node/extHost.protocol.ts
+3
-3
src/vs/workbench/api/node/extHostDocumentContentProviders.ts
src/vs/workbench/api/node/extHostDocumentContentProviders.ts
+3
-4
src/vs/workbench/api/node/extHostExtensionService.ts
src/vs/workbench/api/node/extHostExtensionService.ts
+6
-6
src/vs/workbench/node/extensionHostMain.ts
src/vs/workbench/node/extensionHostMain.ts
+1
-1
src/vs/workbench/test/electron-browser/api/extHostMessagerService.test.ts
.../test/electron-browser/api/extHostMessagerService.test.ts
+6
-6
src/vs/workbench/test/electron-browser/api/mainThreadDiagnostics.test.ts
...h/test/electron-browser/api/mainThreadDiagnostics.test.ts
+1
-1
未找到文件。
src/vs/workbench/api/electron-browser/extensionHost.contribution.ts
浏览文件 @
a99eeae9
...
@@ -9,28 +9,10 @@ import { IWorkbenchContribution, IWorkbenchContributionsRegistry, Extensions as
...
@@ -9,28 +9,10 @@ import { IWorkbenchContribution, IWorkbenchContributionsRegistry, Extensions as
import
{
Registry
}
from
'
vs/platform/registry/common/platform
'
;
import
{
Registry
}
from
'
vs/platform/registry/common/platform
'
;
import
{
IInstantiationService
,
IConstructorSignature0
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
IInstantiationService
,
IConstructorSignature0
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
IThreadService
,
ProxyIdentifier
}
from
'
vs/workbench/services/thread/common/threadService
'
;
import
{
IThreadService
,
ProxyIdentifier
}
from
'
vs/workbench/services/thread/common/threadService
'
;
import
{
MainContext
,
InstanceCollection
,
IExtHostContext
}
from
'
../node/extHost.protocol
'
;
import
{
InstanceCollection
,
IExtHostContext
}
from
'
../node/extHost.protocol
'
;
import
{
IExtensionService
}
from
'
vs/platform/extensions/common/extensions
'
;
import
{
IExtensionService
}
from
'
vs/platform/extensions/common/extensions
'
;
import
{
ExtHostCustomersRegistry
}
from
"
vs/workbench/api/electron-browser/extHostCustomers
"
;
import
{
ExtHostCustomersRegistry
}
from
"
vs/workbench/api/electron-browser/extHostCustomers
"
;
// --- addressable
import
{
MainThreadDiagnostics
}
from
'
./mainThreadDiagnostics
'
;
import
{
MainThreadDocumentContentProviders
}
from
'
./mainThreadDocumentContentProviders
'
;
import
{
MainThreadErrors
}
from
'
./mainThreadErrors
'
;
import
{
MainThreadTreeViews
}
from
'
./mainThreadTreeViews
'
;
import
{
MainThreadLanguages
}
from
'
./mainThreadLanguages
'
;
import
{
MainThreadMessageService
}
from
'
./mainThreadMessageService
'
;
import
{
MainThreadOutputService
}
from
'
./mainThreadOutputService
'
;
import
{
MainThreadProgress
}
from
'
./mainThreadProgress
'
;
import
{
MainThreadStatusBar
}
from
'
./mainThreadStatusBar
'
;
import
{
MainThreadStorage
}
from
'
./mainThreadStorage
'
;
import
{
MainThreadTelemetry
}
from
'
./mainThreadTelemetry
'
;
import
{
MainThreadTerminalService
}
from
'
./mainThreadTerminalService
'
;
import
{
MainThreadWorkspace
}
from
'
./mainThreadWorkspace
'
;
import
{
MainProcessExtensionServiceAPI
}
from
'
./mainThreadExtensionService
'
;
import
{
MainThreadTask
}
from
'
./mainThreadTask
'
;
import
{
MainThreadSCM
}
from
'
./mainThreadSCM
'
;
// --- other interested parties
// --- other interested parties
import
{
JSONValidationExtensionPoint
}
from
'
vs/platform/jsonschemas/common/jsonValidationExtensionPoint
'
;
import
{
JSONValidationExtensionPoint
}
from
'
vs/platform/jsonschemas/common/jsonValidationExtensionPoint
'
;
import
{
ColorExtensionPoint
}
from
'
vs/platform/theme/common/colorExtensionPoint
'
;
import
{
ColorExtensionPoint
}
from
'
vs/platform/theme/common/colorExtensionPoint
'
;
...
@@ -45,30 +27,31 @@ import './mainThreadCommands';
...
@@ -45,30 +27,31 @@ import './mainThreadCommands';
import
'
./mainThreadConfiguration
'
;
import
'
./mainThreadConfiguration
'
;
import
'
./mainThreadCredentials
'
;
import
'
./mainThreadCredentials
'
;
import
'
./mainThreadDebugService
'
;
import
'
./mainThreadDebugService
'
;
// import './mainThreadDiagnostics';
import
'
./mainThreadDiagnostics
'
;
import
'
./mainThreadDocumentContentProviders
'
;
import
'
./mainThreadDocuments
'
;
import
'
./mainThreadDocuments
'
;
import
'
./mainThreadDocumentsAndEditors
'
;
import
'
./mainThreadDocumentsAndEditors
'
;
import
'
./mainThreadEditor
'
;
import
'
./mainThreadEditor
'
;
import
'
./mainThreadEditors
'
;
import
'
./mainThreadEditors
'
;
//
import './mainThreadErrors';
import
'
./mainThreadErrors
'
;
//
import './mainThreadExtensionService';
import
'
./mainThreadExtensionService
'
;
import
'
./mainThreadFileSystemEventService
'
;
import
'
./mainThreadFileSystemEventService
'
;
// import './mainThreadHeapService';
// import './mainThreadHeapService';
import
'
./mainThreadLanguageFeatures
'
;
import
'
./mainThreadLanguageFeatures
'
;
//
import './mainThreadLanguages';
import
'
./mainThreadLanguages
'
;
//
import './mainThreadMessageService';
import
'
./mainThreadMessageService
'
;
//
import './mainThreadOutputService';
import
'
./mainThreadOutputService
'
;
//
import './mainThreadProgress';
import
'
./mainThreadProgress
'
;
import
'
./mainThreadQuickOpen
'
;
import
'
./mainThreadQuickOpen
'
;
//
import './mainThreadSCM';
import
'
./mainThreadSCM
'
;
// import './mainThreadSaveParticipant';
// import './mainThreadSaveParticipant';
//
import './mainThreadStatusBar';
import
'
./mainThreadStatusBar
'
;
//
import './mainThreadStorage';
import
'
./mainThreadStorage
'
;
//
import './mainThreadTask';
import
'
./mainThreadTask
'
;
//
import './mainThreadTelemetry';
import
'
./mainThreadTelemetry
'
;
//
import './mainThreadTerminalService';
import
'
./mainThreadTerminalService
'
;
//
import './mainThreadTreeViews';
import
'
./mainThreadTreeViews
'
;
//
import './mainThreadWorkspace';
import
'
./mainThreadWorkspace
'
;
export
class
ExtHostContribution
implements
IWorkbenchContribution
{
export
class
ExtHostContribution
implements
IWorkbenchContribution
{
...
@@ -105,24 +88,6 @@ export class ExtHostContribution implements IWorkbenchContribution {
...
@@ -105,24 +88,6 @@ export class ExtHostContribution implements IWorkbenchContribution {
}
}
}(
this
.
threadService
);
}(
this
.
threadService
);
// Addressable instances
col
.
define
(
MainContext
.
MainThreadDiagnostics
).
set
(
create
(
MainThreadDiagnostics
));
col
.
define
(
MainContext
.
MainThreadDocumentContentProviders
).
set
(
create
(
MainThreadDocumentContentProviders
));
col
.
define
(
MainContext
.
MainThreadErrors
).
set
(
create
(
MainThreadErrors
));
col
.
define
(
MainContext
.
MainThreadTreeViews
).
set
(
create
(
MainThreadTreeViews
));
col
.
define
(
MainContext
.
MainThreadLanguages
).
set
(
create
(
MainThreadLanguages
));
col
.
define
(
MainContext
.
MainThreadMessageService
).
set
(
create
(
MainThreadMessageService
));
col
.
define
(
MainContext
.
MainThreadOutputService
).
set
(
create
(
MainThreadOutputService
));
col
.
define
(
MainContext
.
MainThreadProgress
).
set
(
create
(
MainThreadProgress
));
col
.
define
(
MainContext
.
MainThreadStatusBar
).
set
(
create
(
MainThreadStatusBar
));
col
.
define
(
MainContext
.
MainThreadStorage
).
set
(
create
(
MainThreadStorage
));
col
.
define
(
MainContext
.
MainThreadTelemetry
).
set
(
create
(
MainThreadTelemetry
));
col
.
define
(
MainContext
.
MainThreadTerminalService
).
set
(
create
(
MainThreadTerminalService
));
col
.
define
(
MainContext
.
MainThreadWorkspace
).
set
(
create
(
MainThreadWorkspace
));
col
.
define
(
MainContext
.
MainThreadSCM
).
set
(
create
(
MainThreadSCM
));
col
.
define
(
MainContext
.
MainThreadTask
).
set
(
create
(
MainThreadTask
));
col
.
define
(
MainContext
.
MainProcessExtensionService
).
set
(
create
(
MainProcessExtensionServiceAPI
));
// Registered named customers
// Registered named customers
const
namedCustomers
=
ExtHostCustomersRegistry
.
getNamedCustomers
();
const
namedCustomers
=
ExtHostCustomersRegistry
.
getNamedCustomers
();
for
(
let
i
=
0
,
len
=
namedCustomers
.
length
;
i
<
len
;
i
++
)
{
for
(
let
i
=
0
,
len
=
namedCustomers
.
length
;
i
<
len
;
i
++
)
{
...
...
src/vs/workbench/api/electron-browser/mainThreadConfiguration.ts
浏览文件 @
a99eeae9
...
@@ -12,7 +12,7 @@ import { IConfigurationEditingService, ConfigurationTarget } from 'vs/workbench/
...
@@ -12,7 +12,7 @@ import { IConfigurationEditingService, ConfigurationTarget } from 'vs/workbench/
import
{
MainThreadConfigurationShape
,
MainContext
,
ExtHostContext
,
IExtHostContext
}
from
'
../node/extHost.protocol
'
;
import
{
MainThreadConfigurationShape
,
MainContext
,
ExtHostContext
,
IExtHostContext
}
from
'
../node/extHost.protocol
'
;
import
{
extHostNamedCustomer
}
from
"
vs/workbench/api/electron-browser/extHostCustomers
"
;
import
{
extHostNamedCustomer
}
from
"
vs/workbench/api/electron-browser/extHostCustomers
"
;
@
extHostNamedCustomer
<
MainThreadConfigurationShape
>
(
MainContext
.
MainThreadConfiguration
)
@
extHostNamedCustomer
(
MainContext
.
MainThreadConfiguration
)
export
class
MainThreadConfiguration
implements
MainThreadConfigurationShape
{
export
class
MainThreadConfiguration
implements
MainThreadConfigurationShape
{
private
readonly
_configurationEditingService
:
IConfigurationEditingService
;
private
readonly
_configurationEditingService
:
IConfigurationEditingService
;
...
...
src/vs/workbench/api/electron-browser/mainThreadCredentials.ts
浏览文件 @
a99eeae9
...
@@ -8,7 +8,7 @@ import { ExtHostContext, MainThreadCredentialsShape, ExtHostCredentialsShape, Ma
...
@@ -8,7 +8,7 @@ import { ExtHostContext, MainThreadCredentialsShape, ExtHostCredentialsShape, Ma
import
{
ICredentialsService
}
from
'
vs/platform/credentials/common/credentials
'
;
import
{
ICredentialsService
}
from
'
vs/platform/credentials/common/credentials
'
;
import
{
extHostNamedCustomer
}
from
"
vs/workbench/api/electron-browser/extHostCustomers
"
;
import
{
extHostNamedCustomer
}
from
"
vs/workbench/api/electron-browser/extHostCustomers
"
;
@
extHostNamedCustomer
<
MainThreadCredentialsShape
>
(
MainContext
.
MainThreadCredentials
)
@
extHostNamedCustomer
(
MainContext
.
MainThreadCredentials
)
export
class
MainThreadCredentials
implements
MainThreadCredentialsShape
{
export
class
MainThreadCredentials
implements
MainThreadCredentialsShape
{
private
_proxy
:
ExtHostCredentialsShape
;
private
_proxy
:
ExtHostCredentialsShape
;
...
...
src/vs/workbench/api/electron-browser/mainThreadDebugService.ts
浏览文件 @
a99eeae9
...
@@ -11,7 +11,7 @@ import { TPromise } from 'vs/base/common/winjs.base';
...
@@ -11,7 +11,7 @@ import { TPromise } from 'vs/base/common/winjs.base';
import
{
ExtHostContext
,
ExtHostDebugServiceShape
,
MainThreadDebugServiceShape
,
DebugSessionUUID
,
MainContext
,
IExtHostContext
}
from
'
../node/extHost.protocol
'
;
import
{
ExtHostContext
,
ExtHostDebugServiceShape
,
MainThreadDebugServiceShape
,
DebugSessionUUID
,
MainContext
,
IExtHostContext
}
from
'
../node/extHost.protocol
'
;
import
{
extHostNamedCustomer
}
from
"
vs/workbench/api/electron-browser/extHostCustomers
"
;
import
{
extHostNamedCustomer
}
from
"
vs/workbench/api/electron-browser/extHostCustomers
"
;
@
extHostNamedCustomer
<
MainThreadDebugServiceShape
>
(
MainContext
.
MainThreadDebugService
)
@
extHostNamedCustomer
(
MainContext
.
MainThreadDebugService
)
export
class
MainThreadDebugService
implements
MainThreadDebugServiceShape
{
export
class
MainThreadDebugService
implements
MainThreadDebugServiceShape
{
private
_proxy
:
ExtHostDebugServiceShape
;
private
_proxy
:
ExtHostDebugServiceShape
;
...
...
src/vs/workbench/api/electron-browser/mainThreadDiagnostics.ts
浏览文件 @
a99eeae9
...
@@ -7,14 +7,19 @@
...
@@ -7,14 +7,19 @@
import
{
IMarkerService
,
IMarkerData
}
from
'
vs/platform/markers/common/markers
'
;
import
{
IMarkerService
,
IMarkerData
}
from
'
vs/platform/markers/common/markers
'
;
import
URI
from
'
vs/base/common/uri
'
;
import
URI
from
'
vs/base/common/uri
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
MainThreadDiagnosticsShape
}
from
'
../node/extHost.protocol
'
;
import
{
MainThreadDiagnosticsShape
,
MainContext
,
IExtHostContext
}
from
'
../node/extHost.protocol
'
;
import
{
extHostNamedCustomer
}
from
"
vs/workbench/api/electron-browser/extHostCustomers
"
;
@
extHostNamedCustomer
(
MainContext
.
MainThreadDiagnostics
)
export
class
MainThreadDiagnostics
implements
MainThreadDiagnosticsShape
{
export
class
MainThreadDiagnostics
implements
MainThreadDiagnosticsShape
{
private
readonly
_activeOwners
=
new
Set
<
string
>
();
private
readonly
_activeOwners
=
new
Set
<
string
>
();
private
readonly
_markerService
:
IMarkerService
;
private
readonly
_markerService
:
IMarkerService
;
constructor
(
@
IMarkerService
markerService
:
IMarkerService
)
{
constructor
(
extHostContext
:
IExtHostContext
,
@
IMarkerService
markerService
:
IMarkerService
)
{
this
.
_markerService
=
markerService
;
this
.
_markerService
=
markerService
;
}
}
...
...
src/vs/workbench/api/electron-browser/mainThreadDocumentContentProviders.ts
浏览文件 @
a99eeae9
...
@@ -7,30 +7,37 @@
...
@@ -7,30 +7,37 @@
import
URI
from
'
vs/base/common/uri
'
;
import
URI
from
'
vs/base/common/uri
'
;
import
{
IDisposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
IDisposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
IThreadService
}
from
'
vs/workbench/services/thread/common/threadService
'
;
import
{
IModel
}
from
'
vs/editor/common/editorCommon
'
;
import
{
IModel
}
from
'
vs/editor/common/editorCommon
'
;
import
{
ICodeEditorService
}
from
'
vs/editor/common/services/codeEditorService
'
;
import
{
ICodeEditorService
}
from
'
vs/editor/common/services/codeEditorService
'
;
import
{
IEditorGroupService
}
from
'
vs/workbench/services/group/common/groupService
'
;
import
{
IEditorGroupService
}
from
'
vs/workbench/services/group/common/groupService
'
;
import
{
MainThreadDocumentContentProvidersShape
,
ExtHostContext
,
ExtHostDocumentContentProvidersShape
}
from
'
../node/extHost.protocol
'
;
import
{
MainThreadDocumentContentProvidersShape
,
ExtHostContext
,
ExtHostDocumentContentProvidersShape
,
MainContext
,
IExtHostContext
}
from
'
../node/extHost.protocol
'
;
import
{
ITextSource
}
from
'
vs/editor/common/model/textSource
'
;
import
{
ITextSource
}
from
'
vs/editor/common/model/textSource
'
;
import
{
ITextModelService
}
from
'
vs/editor/common/services/resolverService
'
;
import
{
ITextModelService
}
from
'
vs/editor/common/services/resolverService
'
;
import
{
IModeService
}
from
'
vs/editor/common/services/modeService
'
;
import
{
IModeService
}
from
'
vs/editor/common/services/modeService
'
;
import
{
IModelService
}
from
'
vs/editor/common/services/modelService
'
;
import
{
IModelService
}
from
'
vs/editor/common/services/modelService
'
;
import
{
extHostNamedCustomer
}
from
"
vs/workbench/api/electron-browser/extHostCustomers
"
;
@
extHostNamedCustomer
(
MainContext
.
MainThreadDocumentContentProviders
)
export
class
MainThreadDocumentContentProviders
implements
MainThreadDocumentContentProvidersShape
{
export
class
MainThreadDocumentContentProviders
implements
MainThreadDocumentContentProvidersShape
{
private
_resourceContentProvider
:
{
[
handle
:
number
]:
IDisposable
}
=
Object
.
create
(
null
);
private
_resourceContentProvider
:
{
[
handle
:
number
]:
IDisposable
}
=
Object
.
create
(
null
);
private
readonly
_proxy
:
ExtHostDocumentContentProvidersShape
;
private
readonly
_proxy
:
ExtHostDocumentContentProvidersShape
;
constructor
(
constructor
(
extHostContext
:
IExtHostContext
,
@
ITextModelService
private
readonly
_textModelResolverService
:
ITextModelService
,
@
ITextModelService
private
readonly
_textModelResolverService
:
ITextModelService
,
@
IModeService
private
readonly
_modeService
:
IModeService
,
@
IModeService
private
readonly
_modeService
:
IModeService
,
@
IModelService
private
readonly
_modelService
:
IModelService
,
@
IModelService
private
readonly
_modelService
:
IModelService
,
@
IThreadService
threadService
:
IThreadService
,
@
ICodeEditorService
codeEditorService
:
ICodeEditorService
,
@
ICodeEditorService
codeEditorService
:
ICodeEditorService
,
@
IEditorGroupService
editorGroupService
:
IEditorGroupService
@
IEditorGroupService
editorGroupService
:
IEditorGroupService
)
{
)
{
this
.
_proxy
=
threadService
.
get
(
ExtHostContext
.
ExtHostDocumentContentProviders
);
this
.
_proxy
=
extHostContext
.
get
(
ExtHostContext
.
ExtHostDocumentContentProviders
);
}
public
dispose
():
void
{
for
(
let
handle
in
this
.
_resourceContentProvider
)
{
this
.
_resourceContentProvider
[
handle
].
dispose
();
}
}
}
$registerTextContentProvider
(
handle
:
number
,
scheme
:
string
):
void
{
$registerTextContentProvider
(
handle
:
number
,
scheme
:
string
):
void
{
...
...
src/vs/workbench/api/electron-browser/mainThreadErrors.ts
浏览文件 @
a99eeae9
...
@@ -5,12 +5,16 @@
...
@@ -5,12 +5,16 @@
'
use strict
'
;
'
use strict
'
;
import
*
as
errors
from
'
vs/base/common/errors
'
;
import
*
as
errors
from
'
vs/base/common/errors
'
;
import
{
MainThreadErrorsShape
}
from
'
../node/extHost.protocol
'
;
import
{
MainThreadErrorsShape
,
MainContext
}
from
'
../node/extHost.protocol
'
;
import
{
extHostNamedCustomer
}
from
"
vs/workbench/api/electron-browser/extHostCustomers
"
;
@
extHostNamedCustomer
(
MainContext
.
MainThreadErrors
)
export
class
MainThreadErrors
implements
MainThreadErrorsShape
{
export
class
MainThreadErrors
implements
MainThreadErrorsShape
{
public
onUnexpectedExtHostError
(
err
:
any
):
void
{
public
dispose
():
void
{
errors
.
onUnexpectedError
(
err
);
}
}
public
$onUnexpectedExtHostError
(
err
:
any
):
void
{
errors
.
onUnexpectedError
(
err
);
}
}
}
src/vs/workbench/api/electron-browser/mainThreadExtensionService.ts
浏览文件 @
a99eeae9
...
@@ -6,19 +6,27 @@
...
@@ -6,19 +6,27 @@
import
Severity
from
'
vs/base/common/severity
'
;
import
Severity
from
'
vs/base/common/severity
'
;
import
{
IExtensionService
}
from
'
vs/platform/extensions/common/extensions
'
;
import
{
IExtensionService
}
from
'
vs/platform/extensions/common/extensions
'
;
import
{
Main
ProcessExtensionServiceShape
}
from
'
../node/extHost.protocol
'
;
import
{
Main
ThreadExtensionServiceShape
,
MainContext
,
IExtHostContext
}
from
'
../node/extHost.protocol
'
;
import
{
ExtensionService
}
from
"
vs/workbench/services/extensions/electron-browser/extensionService
"
;
import
{
ExtensionService
}
from
"
vs/workbench/services/extensions/electron-browser/extensionService
"
;
import
{
extHostNamedCustomer
}
from
"
vs/workbench/api/electron-browser/extHostCustomers
"
;
export
class
MainProcessExtensionServiceAPI
implements
MainProcessExtensionServiceShape
{
@
extHostNamedCustomer
(
MainContext
.
MainThreadExtensionService
)
export
class
MainThreadExtensionService
implements
MainThreadExtensionServiceShape
{
private
readonly
_extensionService
:
ExtensionService
;
private
readonly
_extensionService
:
ExtensionService
;
constructor
(
@
IExtensionService
extensionService
:
IExtensionService
)
{
constructor
(
extHostContext
:
IExtHostContext
,
@
IExtensionService
extensionService
:
IExtensionService
)
{
if
(
extensionService
instanceof
ExtensionService
)
{
if
(
extensionService
instanceof
ExtensionService
)
{
this
.
_extensionService
=
extensionService
;
this
.
_extensionService
=
extensionService
;
}
}
}
}
public
dispose
():
void
{
}
$localShowMessage
(
severity
:
Severity
,
msg
:
string
):
void
{
$localShowMessage
(
severity
:
Severity
,
msg
:
string
):
void
{
this
.
_extensionService
.
_logOrShowMessage
(
severity
,
msg
);
this
.
_extensionService
.
_logOrShowMessage
(
severity
,
msg
);
}
}
...
...
src/vs/workbench/api/electron-browser/mainThreadLanguageFeatures.ts
浏览文件 @
a99eeae9
...
@@ -23,7 +23,7 @@ import { IModeService } from 'vs/editor/common/services/modeService';
...
@@ -23,7 +23,7 @@ import { IModeService } from 'vs/editor/common/services/modeService';
import
{
ColorFormatter
,
CombinedColorFormatter
}
from
'
vs/editor/contrib/colorPicker/common/colorFormatter
'
;
import
{
ColorFormatter
,
CombinedColorFormatter
}
from
'
vs/editor/contrib/colorPicker/common/colorFormatter
'
;
import
{
extHostNamedCustomer
}
from
"
vs/workbench/api/electron-browser/extHostCustomers
"
;
import
{
extHostNamedCustomer
}
from
"
vs/workbench/api/electron-browser/extHostCustomers
"
;
@
extHostNamedCustomer
<
MainThreadLanguageFeaturesShape
>
(
MainContext
.
MainThreadLanguageFeatures
)
@
extHostNamedCustomer
(
MainContext
.
MainThreadLanguageFeatures
)
export
class
MainThreadLanguageFeatures
implements
MainThreadLanguageFeaturesShape
{
export
class
MainThreadLanguageFeatures
implements
MainThreadLanguageFeaturesShape
{
private
_proxy
:
ExtHostLanguageFeaturesShape
;
private
_proxy
:
ExtHostLanguageFeaturesShape
;
...
...
src/vs/workbench/api/electron-browser/mainThreadLanguages.ts
浏览文件 @
a99eeae9
...
@@ -6,18 +6,24 @@
...
@@ -6,18 +6,24 @@
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
IModeService
}
from
'
vs/editor/common/services/modeService
'
;
import
{
IModeService
}
from
'
vs/editor/common/services/modeService
'
;
import
{
MainThreadLanguagesShape
}
from
'
../node/extHost.protocol
'
;
import
{
MainThreadLanguagesShape
,
MainContext
,
IExtHostContext
}
from
'
../node/extHost.protocol
'
;
import
{
extHostNamedCustomer
}
from
"
vs/workbench/api/electron-browser/extHostCustomers
"
;
@
extHostNamedCustomer
(
MainContext
.
MainThreadLanguages
)
export
class
MainThreadLanguages
implements
MainThreadLanguagesShape
{
export
class
MainThreadLanguages
implements
MainThreadLanguagesShape
{
private
_modeService
:
IModeService
;
private
_modeService
:
IModeService
;
constructor
(
constructor
(
extHostContext
:
IExtHostContext
,
@
IModeService
modeService
:
IModeService
@
IModeService
modeService
:
IModeService
)
{
)
{
this
.
_modeService
=
modeService
;
this
.
_modeService
=
modeService
;
}
}
public
dispose
():
void
{
}
$getLanguages
():
TPromise
<
string
[]
>
{
$getLanguages
():
TPromise
<
string
[]
>
{
return
TPromise
.
as
(
this
.
_modeService
.
getRegisteredModes
());
return
TPromise
.
as
(
this
.
_modeService
.
getRegisteredModes
());
}
}
...
...
src/vs/workbench/api/electron-browser/mainThreadMessageService.ts
浏览文件 @
a99eeae9
...
@@ -9,17 +9,23 @@ import { IMessageService, IChoiceService } from 'vs/platform/message/common/mess
...
@@ -9,17 +9,23 @@ import { IMessageService, IChoiceService } from 'vs/platform/message/common/mess
import
Severity
from
'
vs/base/common/severity
'
;
import
Severity
from
'
vs/base/common/severity
'
;
import
{
Action
}
from
'
vs/base/common/actions
'
;
import
{
Action
}
from
'
vs/base/common/actions
'
;
import
{
TPromise
as
Promise
}
from
'
vs/base/common/winjs.base
'
;
import
{
TPromise
as
Promise
}
from
'
vs/base/common/winjs.base
'
;
import
{
MainThreadMessageServiceShape
}
from
'
../node/extHost.protocol
'
;
import
{
MainThreadMessageServiceShape
,
MainContext
,
IExtHostContext
}
from
'
../node/extHost.protocol
'
;
import
*
as
vscode
from
'
vscode
'
;
import
*
as
vscode
from
'
vscode
'
;
import
{
extHostNamedCustomer
}
from
"
vs/workbench/api/electron-browser/extHostCustomers
"
;
@
extHostNamedCustomer
(
MainContext
.
MainThreadMessageService
)
export
class
MainThreadMessageService
implements
MainThreadMessageServiceShape
{
export
class
MainThreadMessageService
implements
MainThreadMessageServiceShape
{
constructor
(
constructor
(
extHostContext
:
IExtHostContext
,
@
IMessageService
private
_messageService
:
IMessageService
,
@
IMessageService
private
_messageService
:
IMessageService
,
@
IChoiceService
private
_choiceService
:
IChoiceService
@
IChoiceService
private
_choiceService
:
IChoiceService
)
{
)
{
}
}
public
dispose
():
void
{
}
$showMessage
(
severity
:
Severity
,
message
:
string
,
options
:
vscode
.
MessageOptions
,
commands
:
{
title
:
string
;
isCloseAffordance
:
boolean
;
handle
:
number
;
}[]):
Thenable
<
number
>
{
$showMessage
(
severity
:
Severity
,
message
:
string
,
options
:
vscode
.
MessageOptions
,
commands
:
{
title
:
string
;
isCloseAffordance
:
boolean
;
handle
:
number
;
}[]):
Thenable
<
number
>
{
if
(
options
.
modal
)
{
if
(
options
.
modal
)
{
return
this
.
showModalMessage
(
severity
,
message
,
commands
);
return
this
.
showModalMessage
(
severity
,
message
,
commands
);
...
...
src/vs/workbench/api/electron-browser/mainThreadOutputService.ts
浏览文件 @
a99eeae9
...
@@ -9,8 +9,10 @@ import { Registry } from 'vs/platform/registry/common/platform';
...
@@ -9,8 +9,10 @@ import { Registry } from 'vs/platform/registry/common/platform';
import
{
IOutputService
,
IOutputChannel
,
OUTPUT_PANEL_ID
,
Extensions
,
IOutputChannelRegistry
}
from
'
vs/workbench/parts/output/common/output
'
;
import
{
IOutputService
,
IOutputChannel
,
OUTPUT_PANEL_ID
,
Extensions
,
IOutputChannelRegistry
}
from
'
vs/workbench/parts/output/common/output
'
;
import
{
IPartService
}
from
'
vs/workbench/services/part/common/partService
'
;
import
{
IPartService
}
from
'
vs/workbench/services/part/common/partService
'
;
import
{
IPanelService
}
from
'
vs/workbench/services/panel/common/panelService
'
;
import
{
IPanelService
}
from
'
vs/workbench/services/panel/common/panelService
'
;
import
{
MainThreadOutputServiceShape
}
from
'
../node/extHost.protocol
'
;
import
{
MainThreadOutputServiceShape
,
MainContext
,
IExtHostContext
}
from
'
../node/extHost.protocol
'
;
import
{
extHostNamedCustomer
}
from
"
vs/workbench/api/electron-browser/extHostCustomers
"
;
@
extHostNamedCustomer
(
MainContext
.
MainThreadOutputService
)
export
class
MainThreadOutputService
implements
MainThreadOutputServiceShape
{
export
class
MainThreadOutputService
implements
MainThreadOutputServiceShape
{
private
readonly
_outputService
:
IOutputService
;
private
readonly
_outputService
:
IOutputService
;
...
@@ -18,6 +20,7 @@ export class MainThreadOutputService implements MainThreadOutputServiceShape {
...
@@ -18,6 +20,7 @@ export class MainThreadOutputService implements MainThreadOutputServiceShape {
private
readonly
_panelService
:
IPanelService
;
private
readonly
_panelService
:
IPanelService
;
constructor
(
constructor
(
extHostContext
:
IExtHostContext
,
@
IOutputService
outputService
:
IOutputService
,
@
IOutputService
outputService
:
IOutputService
,
@
IPartService
partService
:
IPartService
,
@
IPartService
partService
:
IPartService
,
@
IPanelService
panelService
:
IPanelService
@
IPanelService
panelService
:
IPanelService
...
@@ -27,6 +30,10 @@ export class MainThreadOutputService implements MainThreadOutputServiceShape {
...
@@ -27,6 +30,10 @@ export class MainThreadOutputService implements MainThreadOutputServiceShape {
this
.
_panelService
=
panelService
;
this
.
_panelService
=
panelService
;
}
}
public
dispose
():
void
{
// Leave all the existing channels intact (e.g. might help with troubleshooting)
}
public
$append
(
channelId
:
string
,
label
:
string
,
value
:
string
):
TPromise
<
void
>
{
public
$append
(
channelId
:
string
,
label
:
string
,
value
:
string
):
TPromise
<
void
>
{
this
.
_getChannel
(
channelId
,
label
).
append
(
value
);
this
.
_getChannel
(
channelId
,
label
).
append
(
value
);
return
undefined
;
return
undefined
;
...
...
src/vs/workbench/api/electron-browser/mainThreadProgress.ts
浏览文件 @
a99eeae9
...
@@ -6,14 +6,17 @@
...
@@ -6,14 +6,17 @@
import
{
IProgressService2
,
IProgress
,
IProgressOptions
,
IProgressStep
}
from
'
vs/platform/progress/common/progress
'
;
import
{
IProgressService2
,
IProgress
,
IProgressOptions
,
IProgressStep
}
from
'
vs/platform/progress/common/progress
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
MainThreadProgressShape
}
from
'
../node/extHost.protocol
'
;
import
{
MainThreadProgressShape
,
MainContext
,
IExtHostContext
}
from
'
../node/extHost.protocol
'
;
import
{
extHostNamedCustomer
}
from
"
vs/workbench/api/electron-browser/extHostCustomers
"
;
@
extHostNamedCustomer
(
MainContext
.
MainThreadProgress
)
export
class
MainThreadProgress
implements
MainThreadProgressShape
{
export
class
MainThreadProgress
implements
MainThreadProgressShape
{
private
_progressService
:
IProgressService2
;
private
_progressService
:
IProgressService2
;
private
_progress
=
new
Map
<
number
,
{
resolve
:
Function
,
progress
:
IProgress
<
IProgressStep
>
}
>
();
private
_progress
=
new
Map
<
number
,
{
resolve
:
Function
,
progress
:
IProgress
<
IProgressStep
>
}
>
();
constructor
(
constructor
(
extHostContext
:
IExtHostContext
,
@
IProgressService2
progressService
:
IProgressService2
@
IProgressService2
progressService
:
IProgressService2
)
{
)
{
this
.
_progressService
=
progressService
;
this
.
_progressService
=
progressService
;
...
...
src/vs/workbench/api/electron-browser/mainThreadQuickOpen.ts
浏览文件 @
a99eeae9
...
@@ -11,7 +11,7 @@ import { InputBoxOptions } from 'vscode';
...
@@ -11,7 +11,7 @@ import { InputBoxOptions } from 'vscode';
import
{
ExtHostContext
,
MainThreadQuickOpenShape
,
ExtHostQuickOpenShape
,
MyQuickPickItems
,
MainContext
,
IExtHostContext
}
from
'
../node/extHost.protocol
'
;
import
{
ExtHostContext
,
MainThreadQuickOpenShape
,
ExtHostQuickOpenShape
,
MyQuickPickItems
,
MainContext
,
IExtHostContext
}
from
'
../node/extHost.protocol
'
;
import
{
extHostNamedCustomer
}
from
"
vs/workbench/api/electron-browser/extHostCustomers
"
;
import
{
extHostNamedCustomer
}
from
"
vs/workbench/api/electron-browser/extHostCustomers
"
;
@
extHostNamedCustomer
<
MainThreadQuickOpenShape
>
(
MainContext
.
MainThreadQuickOpen
)
@
extHostNamedCustomer
(
MainContext
.
MainThreadQuickOpen
)
export
class
MainThreadQuickOpen
implements
MainThreadQuickOpenShape
{
export
class
MainThreadQuickOpen
implements
MainThreadQuickOpenShape
{
private
_proxy
:
ExtHostQuickOpenShape
;
private
_proxy
:
ExtHostQuickOpenShape
;
...
...
src/vs/workbench/api/electron-browser/mainThreadSCM.ts
浏览文件 @
a99eeae9
...
@@ -10,12 +10,12 @@ import URI from 'vs/base/common/uri';
...
@@ -10,12 +10,12 @@ import URI from 'vs/base/common/uri';
import
Event
,
{
Emitter
}
from
'
vs/base/common/event
'
;
import
Event
,
{
Emitter
}
from
'
vs/base/common/event
'
;
import
{
assign
}
from
'
vs/base/common/objects
'
;
import
{
assign
}
from
'
vs/base/common/objects
'
;
import
{
IDisposable
,
dispose
}
from
'
vs/base/common/lifecycle
'
;
import
{
IDisposable
,
dispose
}
from
'
vs/base/common/lifecycle
'
;
import
{
IThreadService
}
from
'
vs/workbench/services/thread/common/threadService
'
;
import
{
ISCMService
,
ISCMProvider
,
ISCMResource
,
ISCMResourceGroup
,
ISCMResourceDecorations
}
from
'
vs/workbench/services/scm/common/scm
'
;
import
{
ISCMService
,
ISCMProvider
,
ISCMResource
,
ISCMResourceGroup
,
ISCMResourceDecorations
}
from
'
vs/workbench/services/scm/common/scm
'
;
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
ICommandService
}
from
'
vs/platform/commands/common/commands
'
;
import
{
ICommandService
}
from
'
vs/platform/commands/common/commands
'
;
import
{
ExtHostContext
,
MainThreadSCMShape
,
ExtHostSCMShape
,
SCMProviderFeatures
,
SCMRawResource
,
SCMGroupFeatures
}
from
'
../node/extHost.protocol
'
;
import
{
ExtHostContext
,
MainThreadSCMShape
,
ExtHostSCMShape
,
SCMProviderFeatures
,
SCMRawResource
,
SCMGroupFeatures
,
MainContext
,
IExtHostContext
}
from
'
../node/extHost.protocol
'
;
import
{
Command
}
from
'
vs/editor/common/modes
'
;
import
{
Command
}
from
'
vs/editor/common/modes
'
;
import
{
extHostNamedCustomer
}
from
"
vs/workbench/api/electron-browser/extHostCustomers
"
;
class
MainThreadSCMResourceGroup
implements
ISCMResourceGroup
{
class
MainThreadSCMResourceGroup
implements
ISCMResourceGroup
{
...
@@ -205,6 +205,7 @@ class MainThreadSCMProvider implements ISCMProvider {
...
@@ -205,6 +205,7 @@ class MainThreadSCMProvider implements ISCMProvider {
}
}
}
}
@
extHostNamedCustomer
(
MainContext
.
MainThreadSCM
)
export
class
MainThreadSCM
implements
MainThreadSCMShape
{
export
class
MainThreadSCM
implements
MainThreadSCMShape
{
private
_proxy
:
ExtHostSCMShape
;
private
_proxy
:
ExtHostSCMShape
;
...
@@ -213,17 +214,29 @@ export class MainThreadSCM implements MainThreadSCMShape {
...
@@ -213,17 +214,29 @@ export class MainThreadSCM implements MainThreadSCMShape {
private
_disposables
:
IDisposable
[]
=
[];
private
_disposables
:
IDisposable
[]
=
[];
constructor
(
constructor
(
@
IThreadService
threadService
:
IThreadService
,
extHostContext
:
IExtHostContext
,
@
IInstantiationService
private
instantiationService
:
IInstantiationService
,
@
IInstantiationService
private
instantiationService
:
IInstantiationService
,
@
ISCMService
private
scmService
:
ISCMService
,
@
ISCMService
private
scmService
:
ISCMService
,
@
ICommandService
private
commandService
:
ICommandService
@
ICommandService
private
commandService
:
ICommandService
)
{
)
{
this
.
_proxy
=
threadService
.
get
(
ExtHostContext
.
ExtHostSCM
);
this
.
_proxy
=
extHostContext
.
get
(
ExtHostContext
.
ExtHostSCM
);
this
.
scmService
.
onDidChangeProvider
(
this
.
onDidChangeProvider
,
this
,
this
.
_disposables
);
this
.
scmService
.
onDidChangeProvider
(
this
.
onDidChangeProvider
,
this
,
this
.
_disposables
);
this
.
scmService
.
input
.
onDidChange
(
this
.
_proxy
.
$onInputBoxValueChange
,
this
.
_proxy
,
this
.
_disposables
);
this
.
scmService
.
input
.
onDidChange
(
this
.
_proxy
.
$onInputBoxValueChange
,
this
.
_proxy
,
this
.
_disposables
);
}
}
dispose
():
void
{
Object
.
keys
(
this
.
_sourceControls
)
.
forEach
(
id
=>
this
.
_sourceControls
[
id
].
dispose
());
this
.
_sourceControls
=
Object
.
create
(
null
);
Object
.
keys
(
this
.
_sourceControlDisposables
)
.
forEach
(
id
=>
this
.
_sourceControlDisposables
[
id
].
dispose
());
this
.
_sourceControlDisposables
=
Object
.
create
(
null
);
this
.
_disposables
=
dispose
(
this
.
_disposables
);
}
$registerSourceControl
(
handle
:
number
,
id
:
string
,
label
:
string
):
void
{
$registerSourceControl
(
handle
:
number
,
id
:
string
,
label
:
string
):
void
{
const
provider
=
new
MainThreadSCMProvider
(
this
.
_proxy
,
handle
,
id
,
label
,
this
.
scmService
,
this
.
commandService
);
const
provider
=
new
MainThreadSCMProvider
(
this
.
_proxy
,
handle
,
id
,
label
,
this
.
scmService
,
this
.
commandService
);
this
.
_sourceControls
[
handle
]
=
provider
;
this
.
_sourceControls
[
handle
]
=
provider
;
...
@@ -312,12 +325,4 @@ export class MainThreadSCM implements MainThreadSCMShape {
...
@@ -312,12 +325,4 @@ export class MainThreadSCM implements MainThreadSCMShape {
const
handle
=
Object
.
keys
(
this
.
_sourceControls
).
filter
(
handle
=>
this
.
_sourceControls
[
handle
]
===
provider
)[
0
];
const
handle
=
Object
.
keys
(
this
.
_sourceControls
).
filter
(
handle
=>
this
.
_sourceControls
[
handle
]
===
provider
)[
0
];
this
.
_proxy
.
$onActiveSourceControlChange
(
handle
&&
parseInt
(
handle
));
this
.
_proxy
.
$onActiveSourceControlChange
(
handle
&&
parseInt
(
handle
));
}
}
dispose
():
void
{
Object
.
keys
(
this
.
_sourceControls
)
.
forEach
(
id
=>
this
.
_sourceControls
[
id
].
dispose
());
this
.
_sourceControls
=
Object
.
create
(
null
);
this
.
_disposables
=
dispose
(
this
.
_disposables
);
}
}
}
src/vs/workbench/api/electron-browser/mainThreadSaveParticipant.ts
浏览文件 @
a99eeae9
...
@@ -225,9 +225,9 @@ export class SaveParticipant implements ISaveParticipant {
...
@@ -225,9 +225,9 @@ export class SaveParticipant implements ISaveParticipant {
private
_saveParticipants
:
INamedSaveParticpant
[];
private
_saveParticipants
:
INamedSaveParticpant
[];
constructor
(
constructor
(
@
IThreadService
threadService
:
IThreadService
,
@
ITelemetryService
private
_telemetryService
:
ITelemetryService
,
@
ITelemetryService
private
_telemetryService
:
ITelemetryService
,
@
IInstantiationService
instantiationService
:
IInstantiationService
,
@
IInstantiationService
instantiationService
:
IInstantiationService
@
IThreadService
threadService
:
IThreadService
)
{
)
{
this
.
_saveParticipants
=
[
this
.
_saveParticipants
=
[
...
...
src/vs/workbench/api/electron-browser/mainThreadStatusBar.ts
浏览文件 @
a99eeae9
...
@@ -6,14 +6,17 @@
...
@@ -6,14 +6,17 @@
import
{
IStatusbarService
,
StatusbarAlignment
as
MainThreadStatusBarAlignment
}
from
'
vs/platform/statusbar/common/statusbar
'
;
import
{
IStatusbarService
,
StatusbarAlignment
as
MainThreadStatusBarAlignment
}
from
'
vs/platform/statusbar/common/statusbar
'
;
import
{
IDisposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
IDisposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
MainThreadStatusBarShape
}
from
'
../node/extHost.protocol
'
;
import
{
MainThreadStatusBarShape
,
MainContext
,
IExtHostContext
}
from
'
../node/extHost.protocol
'
;
import
{
ThemeColor
}
from
'
vs/platform/theme/common/themeService
'
;
import
{
ThemeColor
}
from
'
vs/platform/theme/common/themeService
'
;
import
{
extHostNamedCustomer
}
from
"
vs/workbench/api/electron-browser/extHostCustomers
"
;
@
extHostNamedCustomer
(
MainContext
.
MainThreadStatusBar
)
export
class
MainThreadStatusBar
implements
MainThreadStatusBarShape
{
export
class
MainThreadStatusBar
implements
MainThreadStatusBarShape
{
private
readonly
_entries
:
{
[
id
:
number
]:
IDisposable
};
private
readonly
_entries
:
{
[
id
:
number
]:
IDisposable
};
constructor
(
constructor
(
extHostContext
:
IExtHostContext
,
@
IStatusbarService
private
readonly
_statusbarService
:
IStatusbarService
@
IStatusbarService
private
readonly
_statusbarService
:
IStatusbarService
)
{
)
{
this
.
_entries
=
Object
.
create
(
null
);
this
.
_entries
=
Object
.
create
(
null
);
...
...
src/vs/workbench/api/electron-browser/mainThreadStorage.ts
浏览文件 @
a99eeae9
...
@@ -6,16 +6,24 @@
...
@@ -6,16 +6,24 @@
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
IStorageService
,
StorageScope
}
from
'
vs/platform/storage/common/storage
'
;
import
{
IStorageService
,
StorageScope
}
from
'
vs/platform/storage/common/storage
'
;
import
{
MainThreadStorageShape
}
from
'
../node/extHost.protocol
'
;
import
{
MainThreadStorageShape
,
MainContext
,
IExtHostContext
}
from
'
../node/extHost.protocol
'
;
import
{
extHostNamedCustomer
}
from
"
vs/workbench/api/electron-browser/extHostCustomers
"
;
@
extHostNamedCustomer
(
MainContext
.
MainThreadStorage
)
export
class
MainThreadStorage
implements
MainThreadStorageShape
{
export
class
MainThreadStorage
implements
MainThreadStorageShape
{
private
_storageService
:
IStorageService
;
private
_storageService
:
IStorageService
;
constructor
(
@
IStorageService
storageService
:
IStorageService
)
{
constructor
(
extHostContext
:
IExtHostContext
,
@
IStorageService
storageService
:
IStorageService
)
{
this
.
_storageService
=
storageService
;
this
.
_storageService
=
storageService
;
}
}
dispose
():
void
{
}
$getValue
<
T
>
(
shared
:
boolean
,
key
:
string
):
TPromise
<
T
>
{
$getValue
<
T
>
(
shared
:
boolean
,
key
:
string
):
TPromise
<
T
>
{
let
jsonValue
=
this
.
_storageService
.
get
(
key
,
shared
?
StorageScope
.
GLOBAL
:
StorageScope
.
WORKSPACE
);
let
jsonValue
=
this
.
_storageService
.
get
(
key
,
shared
?
StorageScope
.
GLOBAL
:
StorageScope
.
WORKSPACE
);
if
(
!
jsonValue
)
{
if
(
!
jsonValue
)
{
...
...
src/vs/workbench/api/electron-browser/mainThreadTask.ts
浏览文件 @
a99eeae9
...
@@ -7,16 +7,29 @@
...
@@ -7,16 +7,29 @@
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
ITaskService
}
from
'
vs/workbench/parts/tasks/common/taskService
'
;
import
{
ITaskService
}
from
'
vs/workbench/parts/tasks/common/taskService
'
;
import
{
IThreadService
}
from
'
vs/workbench/services/thread/common/threadService
'
;
import
{
ExtHostContext
,
MainThreadTaskShape
,
ExtHostTaskShape
}
from
'
../node/extHost.protocol
'
;
import
{
ExtHostContext
,
MainThreadTaskShape
,
ExtHostTaskShape
,
MainContext
,
IExtHostContext
}
from
'
../node/extHost.protocol
'
;
import
{
extHostNamedCustomer
}
from
"
vs/workbench/api/electron-browser/extHostCustomers
"
;
@
extHostNamedCustomer
(
MainContext
.
MainThreadTask
)
export
class
MainThreadTask
implements
MainThreadTaskShape
{
export
class
MainThreadTask
implements
MainThreadTaskShape
{
private
_proxy
:
ExtHostTaskShape
;
private
_proxy
:
ExtHostTaskShape
;
private
_activeHandles
:
{
[
handle
:
number
]:
boolean
;
};
constructor
(
extHostContext
:
IExtHostContext
,
@
ITaskService
private
_taskService
:
ITaskService
)
{
this
.
_proxy
=
extHostContext
.
get
(
ExtHostContext
.
ExtHostTask
);
this
.
_activeHandles
=
Object
.
create
(
null
);
}
constructor
(
@
IThreadService
threadService
:
IThreadService
,
@
ITaskService
private
_taskService
:
ITaskService
)
{
public
dispose
():
void
{
this
.
_proxy
=
threadService
.
get
(
ExtHostContext
.
ExtHostTask
);
Object
.
keys
(
this
.
_activeHandles
).
forEach
((
handle
)
=>
{
this
.
_taskService
.
unregisterTaskProvider
(
parseInt
(
handle
,
10
));
});
this
.
_activeHandles
=
Object
.
create
(
null
);
}
}
public
$registerTaskProvider
(
handle
:
number
):
TPromise
<
void
>
{
public
$registerTaskProvider
(
handle
:
number
):
TPromise
<
void
>
{
...
@@ -25,11 +38,13 @@ export class MainThreadTask implements MainThreadTaskShape {
...
@@ -25,11 +38,13 @@ export class MainThreadTask implements MainThreadTaskShape {
return
this
.
_proxy
.
$provideTasks
(
handle
);
return
this
.
_proxy
.
$provideTasks
(
handle
);
}
}
});
});
this
.
_activeHandles
[
handle
]
=
true
;
return
TPromise
.
as
<
void
>
(
undefined
);
return
TPromise
.
as
<
void
>
(
undefined
);
}
}
public
$unregisterTaskProvider
(
handle
:
number
):
TPromise
<
any
>
{
public
$unregisterTaskProvider
(
handle
:
number
):
TPromise
<
any
>
{
this
.
_taskService
.
unregisterTaskProvider
(
handle
);
this
.
_taskService
.
unregisterTaskProvider
(
handle
);
delete
this
.
_activeHandles
[
handle
];
return
TPromise
.
as
<
void
>
(
undefined
);
return
TPromise
.
as
<
void
>
(
undefined
);
}
}
}
}
src/vs/workbench/api/electron-browser/mainThreadTelemetry.ts
浏览文件 @
a99eeae9
...
@@ -6,19 +6,24 @@
...
@@ -6,19 +6,24 @@
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
ITelemetryService
,
ITelemetryInfo
}
from
'
vs/platform/telemetry/common/telemetry
'
;
import
{
ITelemetryService
,
ITelemetryInfo
}
from
'
vs/platform/telemetry/common/telemetry
'
;
import
{
MainThreadTelemetryShape
}
from
'
../node/extHost.protocol
'
;
import
{
MainThreadTelemetryShape
,
MainContext
,
IExtHostContext
}
from
'
../node/extHost.protocol
'
;
import
{
extHostNamedCustomer
}
from
"
vs/workbench/api/electron-browser/extHostCustomers
"
;
/**
@
extHostNamedCustomer
(
MainContext
.
MainThreadTelemetry
)
* Helper always instantiated in the main process to receive telemetry events from remote telemetry services
*/
export
class
MainThreadTelemetry
implements
MainThreadTelemetryShape
{
export
class
MainThreadTelemetry
implements
MainThreadTelemetryShape
{
private
_telemetryService
:
ITelemetryService
;
private
_telemetryService
:
ITelemetryService
;
constructor
(
@
ITelemetryService
telemetryService
:
ITelemetryService
)
{
constructor
(
extHostContext
:
IExtHostContext
,
@
ITelemetryService
telemetryService
:
ITelemetryService
)
{
this
.
_telemetryService
=
telemetryService
;
this
.
_telemetryService
=
telemetryService
;
}
}
public
dispose
():
void
{
}
public
$publicLog
(
eventName
:
string
,
data
?:
any
):
void
{
public
$publicLog
(
eventName
:
string
,
data
?:
any
):
void
{
this
.
_telemetryService
.
publicLog
(
eventName
,
data
);
this
.
_telemetryService
.
publicLog
(
eventName
,
data
);
}
}
...
...
src/vs/workbench/api/electron-browser/mainThreadTerminalService.ts
浏览文件 @
a99eeae9
...
@@ -6,20 +6,21 @@
...
@@ -6,20 +6,21 @@
import
{
IDisposable
,
dispose
}
from
'
vs/base/common/lifecycle
'
;
import
{
IDisposable
,
dispose
}
from
'
vs/base/common/lifecycle
'
;
import
{
ITerminalService
,
ITerminalInstance
,
IShellLaunchConfig
}
from
'
vs/workbench/parts/terminal/common/terminal
'
;
import
{
ITerminalService
,
ITerminalInstance
,
IShellLaunchConfig
}
from
'
vs/workbench/parts/terminal/common/terminal
'
;
import
{
IThreadService
}
from
'
vs/workbench/services/thread/common/threadService
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
ExtHostContext
,
ExtHostTerminalServiceShape
,
MainThreadTerminalServiceShape
}
from
'
../node/extHost.protocol
'
;
import
{
ExtHostContext
,
ExtHostTerminalServiceShape
,
MainThreadTerminalServiceShape
,
MainContext
,
IExtHostContext
}
from
'
../node/extHost.protocol
'
;
import
{
extHostNamedCustomer
}
from
"
vs/workbench/api/electron-browser/extHostCustomers
"
;
@
extHostNamedCustomer
(
MainContext
.
MainThreadTerminalService
)
export
class
MainThreadTerminalService
implements
MainThreadTerminalServiceShape
{
export
class
MainThreadTerminalService
implements
MainThreadTerminalServiceShape
{
private
_proxy
:
ExtHostTerminalServiceShape
;
private
_proxy
:
ExtHostTerminalServiceShape
;
private
_toDispose
:
IDisposable
[];
private
_toDispose
:
IDisposable
[];
constructor
(
constructor
(
@
IThreadService
threadService
:
IThreadService
,
extHostContext
:
IExtHostContext
,
@
ITerminalService
private
terminalService
:
ITerminalService
@
ITerminalService
private
terminalService
:
ITerminalService
)
{
)
{
this
.
_proxy
=
threadService
.
get
(
ExtHostContext
.
ExtHostTerminalService
);
this
.
_proxy
=
extHostContext
.
get
(
ExtHostContext
.
ExtHostTerminalService
);
this
.
_toDispose
=
[];
this
.
_toDispose
=
[];
this
.
_toDispose
.
push
(
terminalService
.
onInstanceDisposed
((
terminalInstance
)
=>
this
.
_onTerminalDisposed
(
terminalInstance
)));
this
.
_toDispose
.
push
(
terminalService
.
onInstanceDisposed
((
terminalInstance
)
=>
this
.
_onTerminalDisposed
(
terminalInstance
)));
this
.
_toDispose
.
push
(
terminalService
.
onInstanceProcessIdReady
((
terminalInstance
)
=>
this
.
_onTerminalProcessIdReady
(
terminalInstance
)));
this
.
_toDispose
.
push
(
terminalService
.
onInstanceProcessIdReady
((
terminalInstance
)
=>
this
.
_onTerminalProcessIdReady
(
terminalInstance
)));
...
@@ -27,6 +28,9 @@ export class MainThreadTerminalService implements MainThreadTerminalServiceShape
...
@@ -27,6 +28,9 @@ export class MainThreadTerminalService implements MainThreadTerminalServiceShape
public
dispose
():
void
{
public
dispose
():
void
{
this
.
_toDispose
=
dispose
(
this
.
_toDispose
);
this
.
_toDispose
=
dispose
(
this
.
_toDispose
);
// TODO@Daniel: Should all the previously created terminals be disposed
// when the extension host process goes down ?
}
}
public
$createTerminal
(
name
?:
string
,
shellPath
?:
string
,
shellArgs
?:
string
[],
waitOnExit
?:
boolean
):
TPromise
<
number
>
{
public
$createTerminal
(
name
?:
string
,
shellPath
?:
string
,
shellArgs
?:
string
[],
waitOnExit
?:
boolean
):
TPromise
<
number
>
{
...
...
src/vs/workbench/api/electron-browser/mainThreadTreeViews.ts
浏览文件 @
a99eeae9
...
@@ -6,21 +6,27 @@
...
@@ -6,21 +6,27 @@
import
Event
,
{
Emitter
}
from
'
vs/base/common/event
'
;
import
Event
,
{
Emitter
}
from
'
vs/base/common/event
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
IThreadService
}
from
'
vs/workbench/services/thread/common/threadService
'
;
import
{
ExtHostContext
,
MainThreadTreeViewsShape
,
ExtHostTreeViewsShape
,
MainContext
,
IExtHostContext
}
from
'
../node/extHost.protocol
'
;
import
{
ExtHostContext
,
MainThreadTreeViewsShape
,
ExtHostTreeViewsShape
}
from
'
../node/extHost.protocol
'
;
import
{
IMessageService
,
Severity
}
from
'
vs/platform/message/common/message
'
;
import
{
IMessageService
,
Severity
}
from
'
vs/platform/message/common/message
'
;
import
{
ViewsRegistry
}
from
'
vs/workbench/parts/views/browser/viewsRegistry
'
;
import
{
ViewsRegistry
}
from
'
vs/workbench/parts/views/browser/viewsRegistry
'
;
import
{
ITreeViewDataProvider
,
ITreeItem
,
TreeItemCollapsibleState
}
from
'
vs/workbench/parts/views/common/views
'
;
import
{
ITreeViewDataProvider
,
ITreeItem
,
TreeItemCollapsibleState
}
from
'
vs/workbench/parts/views/common/views
'
;
import
{
extHostNamedCustomer
}
from
"
vs/workbench/api/electron-browser/extHostCustomers
"
;
@
extHostNamedCustomer
(
MainContext
.
MainThreadTreeViews
)
export
class
MainThreadTreeViews
implements
MainThreadTreeViewsShape
{
export
class
MainThreadTreeViews
implements
MainThreadTreeViewsShape
{
private
_proxy
:
ExtHostTreeViewsShape
;
private
_proxy
:
ExtHostTreeViewsShape
;
constructor
(
constructor
(
@
IThreadService
threadService
:
IThreadService
,
extHostContext
:
IExtHostContext
,
@
IMessageService
private
messageService
:
IMessageService
@
IMessageService
private
messageService
:
IMessageService
)
{
)
{
this
.
_proxy
=
threadService
.
get
(
ExtHostContext
.
ExtHostTreeViews
);
this
.
_proxy
=
extHostContext
.
get
(
ExtHostContext
.
ExtHostTreeViews
);
}
public
dispose
():
void
{
// TODO@Sandeep: please implement this
// will be called when the extension host process is gone.
}
}
$registerView
(
treeViewId
:
string
):
void
{
$registerView
(
treeViewId
:
string
):
void
{
...
...
src/vs/workbench/api/electron-browser/mainThreadWorkspace.ts
浏览文件 @
a99eeae9
...
@@ -13,15 +13,15 @@ import { ITextFileService } from 'vs/workbench/services/textfile/common/textfile
...
@@ -13,15 +13,15 @@ import { ITextFileService } from 'vs/workbench/services/textfile/common/textfile
import
{
ICommonCodeEditor
,
isCommonCodeEditor
}
from
'
vs/editor/common/editorCommon
'
;
import
{
ICommonCodeEditor
,
isCommonCodeEditor
}
from
'
vs/editor/common/editorCommon
'
;
import
{
bulkEdit
,
IResourceEdit
}
from
'
vs/editor/common/services/bulkEdit
'
;
import
{
bulkEdit
,
IResourceEdit
}
from
'
vs/editor/common/services/bulkEdit
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
MainThreadWorkspaceShape
,
ExtHostWorkspaceShape
,
ExtHostContext
}
from
'
../node/extHost.protocol
'
;
import
{
MainThreadWorkspaceShape
,
ExtHostWorkspaceShape
,
ExtHostContext
,
MainContext
,
IExtHostContext
}
from
'
../node/extHost.protocol
'
;
import
{
ITextModelService
}
from
'
vs/editor/common/services/resolverService
'
;
import
{
ITextModelService
}
from
'
vs/editor/common/services/resolverService
'
;
import
{
IFileService
}
from
'
vs/platform/files/common/files
'
;
import
{
IFileService
}
from
'
vs/platform/files/common/files
'
;
import
{
IThreadService
}
from
'
vs/workbench/services/thread/common/threadService
'
;
import
{
IDisposable
,
dispose
}
from
'
vs/base/common/lifecycle
'
;
import
{
IDisposable
,
dispose
}
from
'
vs/base/common/lifecycle
'
;
import
{
RemoteFileService
,
IRemoteFileSystemProvider
}
from
'
vs/workbench/services/files/electron-browser/remoteFileService
'
;
import
{
RemoteFileService
,
IRemoteFileSystemProvider
}
from
'
vs/workbench/services/files/electron-browser/remoteFileService
'
;
import
{
Emitter
}
from
'
vs/base/common/event
'
;
import
{
Emitter
}
from
'
vs/base/common/event
'
;
import
{
extHostNamedCustomer
}
from
"
vs/workbench/api/electron-browser/extHostCustomers
"
;
@
extHostNamedCustomer
(
MainContext
.
MainThreadWorkspace
)
export
class
MainThreadWorkspace
implements
MainThreadWorkspaceShape
{
export
class
MainThreadWorkspace
implements
MainThreadWorkspaceShape
{
private
readonly
_toDispose
:
IDisposable
[]
=
[];
private
readonly
_toDispose
:
IDisposable
[]
=
[];
...
@@ -29,20 +29,25 @@ export class MainThreadWorkspace implements MainThreadWorkspaceShape {
...
@@ -29,20 +29,25 @@ export class MainThreadWorkspace implements MainThreadWorkspaceShape {
private
readonly
_proxy
:
ExtHostWorkspaceShape
;
private
readonly
_proxy
:
ExtHostWorkspaceShape
;
constructor
(
constructor
(
extHostContext
:
IExtHostContext
,
@
ISearchService
private
readonly
_searchService
:
ISearchService
,
@
ISearchService
private
readonly
_searchService
:
ISearchService
,
@
IWorkspaceContextService
private
readonly
_contextService
:
IWorkspaceContextService
,
@
IWorkspaceContextService
private
readonly
_contextService
:
IWorkspaceContextService
,
@
ITextFileService
private
readonly
_textFileService
:
ITextFileService
,
@
ITextFileService
private
readonly
_textFileService
:
ITextFileService
,
@
IWorkbenchEditorService
private
readonly
_editorService
:
IWorkbenchEditorService
,
@
IWorkbenchEditorService
private
readonly
_editorService
:
IWorkbenchEditorService
,
@
ITextModelService
private
readonly
_textModelResolverService
:
ITextModelService
,
@
ITextModelService
private
readonly
_textModelResolverService
:
ITextModelService
,
@
IFileService
private
readonly
_fileService
:
IFileService
,
@
IFileService
private
readonly
_fileService
:
IFileService
@
IThreadService
threadService
:
IThreadService
)
{
)
{
this
.
_proxy
=
threadService
.
get
(
ExtHostContext
.
ExtHostWorkspace
);
this
.
_proxy
=
extHostContext
.
get
(
ExtHostContext
.
ExtHostWorkspace
);
this
.
_contextService
.
onDidChangeWorkspaceRoots
(
this
.
_onDidChangeWorkspace
,
this
,
this
.
_toDispose
);
this
.
_contextService
.
onDidChangeWorkspaceRoots
(
this
.
_onDidChangeWorkspace
,
this
,
this
.
_toDispose
);
}
}
dispose
():
void
{
dispose
():
void
{
dispose
(
this
.
_toDispose
);
dispose
(
this
.
_toDispose
);
for
(
let
requestId
in
this
.
_activeSearches
)
{
const
search
=
this
.
_activeSearches
[
requestId
];
search
.
cancel
();
}
}
}
// --- workspace ---
// --- workspace ---
...
...
src/vs/workbench/api/node/extHost.api.impl.ts
浏览文件 @
a99eeae9
...
@@ -8,7 +8,6 @@ import { Emitter } from 'vs/base/common/event';
...
@@ -8,7 +8,6 @@ import { Emitter } from 'vs/base/common/event';
import
{
TrieMap
}
from
'
vs/base/common/map
'
;
import
{
TrieMap
}
from
'
vs/base/common/map
'
;
import
{
score
}
from
'
vs/editor/common/modes/languageSelector
'
;
import
{
score
}
from
'
vs/editor/common/modes/languageSelector
'
;
import
*
as
Platform
from
'
vs/base/common/platform
'
;
import
*
as
Platform
from
'
vs/base/common/platform
'
;
import
{
IThreadService
}
from
'
vs/workbench/services/thread/common/threadService
'
;
import
*
as
errors
from
'
vs/base/common/errors
'
;
import
*
as
errors
from
'
vs/base/common/errors
'
;
import
product
from
'
vs/platform/node/product
'
;
import
product
from
'
vs/platform/node/product
'
;
import
pkg
from
'
vs/platform/node/package
'
;
import
pkg
from
'
vs/platform/node/package
'
;
...
@@ -52,6 +51,7 @@ import { realpath } from 'fs';
...
@@ -52,6 +51,7 @@ import { realpath } from 'fs';
import
{
MainContext
,
ExtHostContext
,
InstanceCollection
,
IInitData
}
from
'
./extHost.protocol
'
;
import
{
MainContext
,
ExtHostContext
,
InstanceCollection
,
IInitData
}
from
'
./extHost.protocol
'
;
import
*
as
languageConfiguration
from
'
vs/editor/common/modes/languageConfiguration
'
;
import
*
as
languageConfiguration
from
'
vs/editor/common/modes/languageConfiguration
'
;
import
{
TextEditorCursorStyle
}
from
'
vs/editor/common/config/editorOptions
'
;
import
{
TextEditorCursorStyle
}
from
'
vs/editor/common/config/editorOptions
'
;
import
{
ExtHostThreadService
}
from
"
vs/workbench/services/thread/node/extHostThreadService
"
;
export
interface
IExtensionApiFactory
{
export
interface
IExtensionApiFactory
{
(
extension
:
IExtensionDescription
):
typeof
vscode
;
(
extension
:
IExtensionDescription
):
typeof
vscode
;
...
@@ -72,7 +72,7 @@ function proposedApiFunction<T>(extension: IExtensionDescription, fn: T): T {
...
@@ -72,7 +72,7 @@ function proposedApiFunction<T>(extension: IExtensionDescription, fn: T): T {
*/
*/
export
function
createApiFactory
(
export
function
createApiFactory
(
initData
:
IInitData
,
initData
:
IInitData
,
threadService
:
I
ThreadService
,
threadService
:
ExtHost
ThreadService
,
extensionService
:
ExtHostExtensionService
,
extensionService
:
ExtHostExtensionService
,
telemetryService
:
ITelemetryService
telemetryService
:
ITelemetryService
):
IExtensionApiFactory
{
):
IExtensionApiFactory
{
...
...
src/vs/workbench/api/node/extHost.protocol.ts
浏览文件 @
a99eeae9
...
@@ -226,7 +226,7 @@ export interface MainThreadTreeViewsShape {
...
@@ -226,7 +226,7 @@ export interface MainThreadTreeViewsShape {
}
}
export
interface
MainThreadErrorsShape
{
export
interface
MainThreadErrorsShape
{
onUnexpectedExtHostError
(
err
:
any
):
void
;
$
onUnexpectedExtHostError
(
err
:
any
):
void
;
}
}
export
interface
MainThreadLanguageFeaturesShape
{
export
interface
MainThreadLanguageFeaturesShape
{
...
@@ -326,7 +326,7 @@ export interface MainThreadTaskShape {
...
@@ -326,7 +326,7 @@ export interface MainThreadTaskShape {
$unregisterTaskProvider
(
handle
:
number
):
TPromise
<
any
>
;
$unregisterTaskProvider
(
handle
:
number
):
TPromise
<
any
>
;
}
}
export
interface
Main
Process
ExtensionServiceShape
{
export
interface
Main
Thread
ExtensionServiceShape
{
$localShowMessage
(
severity
:
Severity
,
msg
:
string
):
void
;
$localShowMessage
(
severity
:
Severity
,
msg
:
string
):
void
;
$onExtensionActivated
(
extensionId
:
string
):
void
;
$onExtensionActivated
(
extensionId
:
string
):
void
;
$onExtensionActivationFailed
(
extensionId
:
string
):
void
;
$onExtensionActivationFailed
(
extensionId
:
string
):
void
;
...
@@ -579,7 +579,7 @@ export const MainContext = {
...
@@ -579,7 +579,7 @@ export const MainContext = {
MainThreadTelemetry
:
createMainId
<
MainThreadTelemetryShape
>
(
'
MainThreadTelemetry
'
),
MainThreadTelemetry
:
createMainId
<
MainThreadTelemetryShape
>
(
'
MainThreadTelemetry
'
),
MainThreadTerminalService
:
createMainId
<
MainThreadTerminalServiceShape
>
(
'
MainThreadTerminalService
'
),
MainThreadTerminalService
:
createMainId
<
MainThreadTerminalServiceShape
>
(
'
MainThreadTerminalService
'
),
MainThreadWorkspace
:
createMainId
<
MainThreadWorkspaceShape
>
(
'
MainThreadWorkspace
'
),
MainThreadWorkspace
:
createMainId
<
MainThreadWorkspaceShape
>
(
'
MainThreadWorkspace
'
),
Main
ProcessExtensionService
:
createMainId
<
MainProcessExtensionServiceShape
>
(
'
MainProcess
ExtensionService
'
),
Main
ThreadExtensionService
:
createMainId
<
MainThreadExtensionServiceShape
>
(
'
MainThread
ExtensionService
'
),
MainThreadSCM
:
createMainId
<
MainThreadSCMShape
>
(
'
MainThreadSCM
'
),
MainThreadSCM
:
createMainId
<
MainThreadSCMShape
>
(
'
MainThreadSCM
'
),
MainThreadTask
:
createMainId
<
MainThreadTaskShape
>
(
'
MainThreadTask
'
),
MainThreadTask
:
createMainId
<
MainThreadTaskShape
>
(
'
MainThreadTask
'
),
MainThreadCredentials
:
createMainId
<
MainThreadCredentialsShape
>
(
'
MainThreadCredentials
'
),
MainThreadCredentials
:
createMainId
<
MainThreadCredentialsShape
>
(
'
MainThreadCredentials
'
),
...
...
src/vs/workbench/api/node/extHostDocumentContentProviders.ts
浏览文件 @
a99eeae9
...
@@ -6,7 +6,6 @@
...
@@ -6,7 +6,6 @@
import
{
onUnexpectedError
}
from
'
vs/base/common/errors
'
;
import
{
onUnexpectedError
}
from
'
vs/base/common/errors
'
;
import
*
as
editorCommon
from
'
vs/editor/common/editorCommon
'
;
import
*
as
editorCommon
from
'
vs/editor/common/editorCommon
'
;
import
{
IThreadService
}
from
'
vs/workbench/services/thread/common/threadService
'
;
import
URI
from
'
vs/base/common/uri
'
;
import
URI
from
'
vs/base/common/uri
'
;
import
{
IDisposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
IDisposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
Disposable
}
from
'
vs/workbench/api/node/extHostTypes
'
;
import
{
Disposable
}
from
'
vs/workbench/api/node/extHostTypes
'
;
...
@@ -14,7 +13,7 @@ import { TPromise } from 'vs/base/common/winjs.base';
...
@@ -14,7 +13,7 @@ import { TPromise } from 'vs/base/common/winjs.base';
import
*
as
vscode
from
'
vscode
'
;
import
*
as
vscode
from
'
vscode
'
;
import
{
asWinJsPromise
}
from
'
vs/base/common/async
'
;
import
{
asWinJsPromise
}
from
'
vs/base/common/async
'
;
import
{
TextSource
}
from
'
vs/editor/common/model/textSource
'
;
import
{
TextSource
}
from
'
vs/editor/common/model/textSource
'
;
import
{
MainContext
,
ExtHostDocumentContentProvidersShape
,
MainThreadDocumentContentProvidersShape
}
from
'
./extHost.protocol
'
;
import
{
MainContext
,
ExtHostDocumentContentProvidersShape
,
MainThreadDocumentContentProvidersShape
,
IMainContext
}
from
'
./extHost.protocol
'
;
import
{
ExtHostDocumentsAndEditors
}
from
'
./extHostDocumentsAndEditors
'
;
import
{
ExtHostDocumentsAndEditors
}
from
'
./extHostDocumentsAndEditors
'
;
export
class
ExtHostDocumentContentProvider
implements
ExtHostDocumentContentProvidersShape
{
export
class
ExtHostDocumentContentProvider
implements
ExtHostDocumentContentProvidersShape
{
...
@@ -25,8 +24,8 @@ export class ExtHostDocumentContentProvider implements ExtHostDocumentContentPro
...
@@ -25,8 +24,8 @@ export class ExtHostDocumentContentProvider implements ExtHostDocumentContentPro
private
readonly
_proxy
:
MainThreadDocumentContentProvidersShape
;
private
readonly
_proxy
:
MainThreadDocumentContentProvidersShape
;
private
readonly
_documentsAndEditors
:
ExtHostDocumentsAndEditors
;
private
readonly
_documentsAndEditors
:
ExtHostDocumentsAndEditors
;
constructor
(
threadService
:
IThreadService
,
documentsAndEditors
:
ExtHostDocumentsAndEditors
)
{
constructor
(
mainContext
:
IMainContext
,
documentsAndEditors
:
ExtHostDocumentsAndEditors
)
{
this
.
_proxy
=
threadService
.
get
(
MainContext
.
MainThreadDocumentContentProviders
);
this
.
_proxy
=
mainContext
.
get
(
MainContext
.
MainThreadDocumentContentProviders
);
this
.
_documentsAndEditors
=
documentsAndEditors
;
this
.
_documentsAndEditors
=
documentsAndEditors
;
}
}
...
...
src/vs/workbench/api/node/extHostExtensionService.ts
浏览文件 @
a99eeae9
...
@@ -14,10 +14,10 @@ import { IExtensionDescription } from 'vs/platform/extensions/common/extensions'
...
@@ -14,10 +14,10 @@ import { IExtensionDescription } from 'vs/platform/extensions/common/extensions'
import
{
ExtHostStorage
}
from
'
vs/workbench/api/node/extHostStorage
'
;
import
{
ExtHostStorage
}
from
'
vs/workbench/api/node/extHostStorage
'
;
import
{
ITelemetryService
}
from
'
vs/platform/telemetry/common/telemetry
'
;
import
{
ITelemetryService
}
from
'
vs/platform/telemetry/common/telemetry
'
;
import
{
createApiFactory
,
initializeExtensionApi
}
from
'
vs/workbench/api/node/extHost.api.impl
'
;
import
{
createApiFactory
,
initializeExtensionApi
}
from
'
vs/workbench/api/node/extHost.api.impl
'
;
import
{
IThreadService
}
from
'
vs/workbench/services/thread/common/threadService
'
;
import
{
MainContext
,
MainThreadExtensionServiceShape
,
IWorkspaceData
,
IEnvironment
,
IInitData
}
from
'
./extHost.protocol
'
;
import
{
MainContext
,
MainProcessExtensionServiceShape
,
IWorkspaceData
,
IEnvironment
,
IInitData
}
from
'
./extHost.protocol
'
;
import
{
IExtensionMemento
,
ExtensionsActivator
,
ActivatedExtension
,
IExtensionAPI
,
IExtensionContext
,
EmptyExtension
,
IExtensionModule
}
from
"
vs/workbench/api/node/extHostExtensionActivator
"
;
import
{
IExtensionMemento
,
ExtensionsActivator
,
ActivatedExtension
,
IExtensionAPI
,
IExtensionContext
,
EmptyExtension
,
IExtensionModule
}
from
"
vs/workbench/api/node/extHostExtensionActivator
"
;
import
{
Barrier
}
from
"
vs/workbench/services/extensions/node/barrier
"
;
import
{
Barrier
}
from
"
vs/workbench/services/extensions/node/barrier
"
;
import
{
ExtHostThreadService
}
from
"
vs/workbench/services/thread/node/extHostThreadService
"
;
class
ExtensionMemento
implements
IExtensionMemento
{
class
ExtensionMemento
implements
IExtensionMemento
{
...
@@ -109,24 +109,24 @@ export class ExtHostExtensionService {
...
@@ -109,24 +109,24 @@ export class ExtHostExtensionService {
private
readonly
_barrier
:
Barrier
;
private
readonly
_barrier
:
Barrier
;
private
readonly
_registry
:
ExtensionDescriptionRegistry
;
private
readonly
_registry
:
ExtensionDescriptionRegistry
;
private
readonly
_threadService
:
I
ThreadService
;
private
readonly
_threadService
:
ExtHost
ThreadService
;
private
readonly
_telemetryService
:
ITelemetryService
;
private
readonly
_telemetryService
:
ITelemetryService
;
private
readonly
_storage
:
ExtHostStorage
;
private
readonly
_storage
:
ExtHostStorage
;
private
readonly
_storagePath
:
ExtensionStoragePath
;
private
readonly
_storagePath
:
ExtensionStoragePath
;
private
readonly
_proxy
:
Main
Process
ExtensionServiceShape
;
private
readonly
_proxy
:
Main
Thread
ExtensionServiceShape
;
private
_activator
:
ExtensionsActivator
;
private
_activator
:
ExtensionsActivator
;
/**
/**
* This class is constructed manually because it is a service, so it doesn't use any ctor injection
* This class is constructed manually because it is a service, so it doesn't use any ctor injection
*/
*/
constructor
(
initData
:
IInitData
,
threadService
:
I
ThreadService
,
telemetryService
:
ITelemetryService
)
{
constructor
(
initData
:
IInitData
,
threadService
:
ExtHost
ThreadService
,
telemetryService
:
ITelemetryService
)
{
this
.
_barrier
=
new
Barrier
();
this
.
_barrier
=
new
Barrier
();
this
.
_registry
=
new
ExtensionDescriptionRegistry
(
initData
.
extensions
);
this
.
_registry
=
new
ExtensionDescriptionRegistry
(
initData
.
extensions
);
this
.
_threadService
=
threadService
;
this
.
_threadService
=
threadService
;
this
.
_telemetryService
=
telemetryService
;
this
.
_telemetryService
=
telemetryService
;
this
.
_storage
=
new
ExtHostStorage
(
threadService
);
this
.
_storage
=
new
ExtHostStorage
(
threadService
);
this
.
_storagePath
=
new
ExtensionStoragePath
(
initData
.
workspace
,
initData
.
environment
);
this
.
_storagePath
=
new
ExtensionStoragePath
(
initData
.
workspace
,
initData
.
environment
);
this
.
_proxy
=
this
.
_threadService
.
get
(
MainContext
.
Main
Process
ExtensionService
);
this
.
_proxy
=
this
.
_threadService
.
get
(
MainContext
.
Main
Thread
ExtensionService
);
this
.
_activator
=
null
;
this
.
_activator
=
null
;
// initialize API first (i.e. do not release barrier until the API is initialized)
// initialize API first (i.e. do not release barrier until the API is initialized)
...
...
src/vs/workbench/node/extensionHostMain.ts
浏览文件 @
a99eeae9
...
@@ -51,7 +51,7 @@ export class ExtensionHostMain {
...
@@ -51,7 +51,7 @@ export class ExtensionHostMain {
// Error forwarding
// Error forwarding
const
mainThreadErrors
=
threadService
.
get
(
MainContext
.
MainThreadErrors
);
const
mainThreadErrors
=
threadService
.
get
(
MainContext
.
MainThreadErrors
);
errors
.
setUnexpectedErrorHandler
(
err
=>
mainThreadErrors
.
onUnexpectedExtHostError
(
errors
.
transformErrorForSerialization
(
err
)));
errors
.
setUnexpectedErrorHandler
(
err
=>
mainThreadErrors
.
$
onUnexpectedExtHostError
(
errors
.
transformErrorForSerialization
(
err
)));
// Configure the watchdog to kill our process if the JS event loop is unresponsive for more than 10s
// Configure the watchdog to kill our process if the JS event loop is unresponsive for more than 10s
if
(
!
initData
.
environment
.
isExtensionDevelopmentDebug
)
{
if
(
!
initData
.
environment
.
isExtensionDevelopmentDebug
)
{
...
...
src/vs/workbench/test/electron-browser/api/extHostMessagerService.test.ts
浏览文件 @
a99eeae9
...
@@ -14,7 +14,7 @@ suite('ExtHostMessageService', function () {
...
@@ -14,7 +14,7 @@ suite('ExtHostMessageService', function () {
test
(
'
propagte handle on select
'
,
function
()
{
test
(
'
propagte handle on select
'
,
function
()
{
let
service
=
new
MainThreadMessageService
(
<
any
>
{
let
service
=
new
MainThreadMessageService
(
null
,
<
any
>
{
show
(
sev
:
number
,
m
:
{
message
;
actions
:
Action
[]
})
{
show
(
sev
:
number
,
m
:
{
message
;
actions
:
Action
[]
})
{
assert
.
equal
(
m
.
actions
.
length
,
1
);
assert
.
equal
(
m
.
actions
.
length
,
1
);
setImmediate
(()
=>
m
.
actions
[
0
].
run
());
setImmediate
(()
=>
m
.
actions
[
0
].
run
());
...
@@ -34,7 +34,7 @@ suite('ExtHostMessageService', function () {
...
@@ -34,7 +34,7 @@ suite('ExtHostMessageService', function () {
test
(
'
isCloseAffordance
'
,
function
()
{
test
(
'
isCloseAffordance
'
,
function
()
{
let
actions
:
Action
[];
let
actions
:
Action
[];
let
service
=
new
MainThreadMessageService
(
<
any
>
{
let
service
=
new
MainThreadMessageService
(
null
,
<
any
>
{
show
(
sev
:
number
,
m
:
{
message
;
actions
:
Action
[]
})
{
show
(
sev
:
number
,
m
:
{
message
;
actions
:
Action
[]
})
{
actions
=
m
.
actions
;
actions
=
m
.
actions
;
}
}
...
@@ -62,7 +62,7 @@ suite('ExtHostMessageService', function () {
...
@@ -62,7 +62,7 @@ suite('ExtHostMessageService', function () {
let
actions
:
Action
[];
let
actions
:
Action
[];
let
c
:
number
;
let
c
:
number
;
let
service
=
new
MainThreadMessageService
(
<
any
>
{
let
service
=
new
MainThreadMessageService
(
null
,
<
any
>
{
show
(
sev
:
number
,
m
:
{
message
;
actions
:
Action
[]
})
{
show
(
sev
:
number
,
m
:
{
message
;
actions
:
Action
[]
})
{
c
=
0
;
c
=
0
;
actions
=
m
.
actions
;
actions
=
m
.
actions
;
...
@@ -85,7 +85,7 @@ suite('ExtHostMessageService', function () {
...
@@ -85,7 +85,7 @@ suite('ExtHostMessageService', function () {
suite
(
'
modal
'
,
()
=>
{
suite
(
'
modal
'
,
()
=>
{
test
(
'
calls choice service
'
,
()
=>
{
test
(
'
calls choice service
'
,
()
=>
{
const
service
=
new
MainThreadMessageService
(
<
any
>
{
const
service
=
new
MainThreadMessageService
(
null
,
<
any
>
{
show
(
sev
:
number
,
m
:
{
message
;
actions
:
Action
[]
})
{
show
(
sev
:
number
,
m
:
{
message
;
actions
:
Action
[]
})
{
throw
new
Error
(
'
not implemented
'
);
throw
new
Error
(
'
not implemented
'
);
}
}
...
@@ -105,7 +105,7 @@ suite('ExtHostMessageService', function () {
...
@@ -105,7 +105,7 @@ suite('ExtHostMessageService', function () {
});
});
test
(
'
returns undefined when cancelled
'
,
()
=>
{
test
(
'
returns undefined when cancelled
'
,
()
=>
{
const
service
=
new
MainThreadMessageService
(
<
any
>
{
const
service
=
new
MainThreadMessageService
(
null
,
<
any
>
{
show
(
sev
:
number
,
m
:
{
message
;
actions
:
Action
[]
})
{
show
(
sev
:
number
,
m
:
{
message
;
actions
:
Action
[]
})
{
throw
new
Error
(
'
not implemented
'
);
throw
new
Error
(
'
not implemented
'
);
}
}
...
@@ -121,7 +121,7 @@ suite('ExtHostMessageService', function () {
...
@@ -121,7 +121,7 @@ suite('ExtHostMessageService', function () {
});
});
test
(
'
hides Cancel button when not needed
'
,
()
=>
{
test
(
'
hides Cancel button when not needed
'
,
()
=>
{
const
service
=
new
MainThreadMessageService
(
<
any
>
{
const
service
=
new
MainThreadMessageService
(
null
,
<
any
>
{
show
(
sev
:
number
,
m
:
{
message
;
actions
:
Action
[]
})
{
show
(
sev
:
number
,
m
:
{
message
;
actions
:
Action
[]
})
{
throw
new
Error
(
'
not implemented
'
);
throw
new
Error
(
'
not implemented
'
);
}
}
...
...
src/vs/workbench/test/electron-browser/api/mainThreadDiagnostics.test.ts
浏览文件 @
a99eeae9
...
@@ -21,7 +21,7 @@ suite('MainThreadDiagnostics', function () {
...
@@ -21,7 +21,7 @@ suite('MainThreadDiagnostics', function () {
test
(
'
clear markers on dispose
'
,
function
()
{
test
(
'
clear markers on dispose
'
,
function
()
{
let
diag
=
new
MainThreadDiagnostics
(
markerService
);
let
diag
=
new
MainThreadDiagnostics
(
null
,
markerService
);
diag
.
$changeMany
(
'
foo
'
,
[[
URI
.
file
(
'
a
'
),
[{
diag
.
$changeMany
(
'
foo
'
,
[[
URI
.
file
(
'
a
'
),
[{
code
:
'
666
'
,
code
:
'
666
'
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录