Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
e85114b2
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 搜索 >>
提交
e85114b2
编写于
9月 18, 2020
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
sandbox - add pedantic comments to prevent electron-browser usage
上级
cf211eeb
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
208 addition
and
13 deletion
+208
-13
src/vs/workbench/electron-browser/desktop.main.ts
src/vs/workbench/electron-browser/desktop.main.ts
+55
-4
src/vs/workbench/electron-sandbox/desktop.main.ts
src/vs/workbench/electron-sandbox/desktop.main.ts
+54
-4
src/vs/workbench/workbench.desktop.main.ts
src/vs/workbench/workbench.desktop.main.ts
+99
-5
未找到文件。
src/vs/workbench/electron-browser/desktop.main.ts
浏览文件 @
e85114b2
...
...
@@ -164,10 +164,19 @@ class DesktopMain extends Disposable {
private
async
initServices
():
Promise
<
{
serviceCollection
:
ServiceCollection
,
logService
:
ILogService
,
storageService
:
NativeStorageService
}
>
{
const
serviceCollection
=
new
ServiceCollection
();
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
// NOTE: DO NOT ADD ANY OTHER SERVICE INTO THE COLLECTION HERE.
// CONTRIBUTE IT VIA WORKBENCH.DESKTOP.MAIN.TS AND registerSingleton().
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
//
// NOTE: Please do NOT register services here. Use `registerSingleton()`
// from `workbench.common.main.ts` if the service is shared between
// desktop and web or `workbench.sandbox.main.ts` if the service
// is desktop only.
//
// DO NOT add services to `workbench.desktop.main.ts`, always add
// to `workbench.sandbox.main.ts` to support our Electron sandbox
//
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
// Main Process
const
mainProcessService
=
this
.
_register
(
new
MainProcessService
(
this
.
configuration
.
windowId
));
...
...
@@ -188,6 +197,20 @@ class DesktopMain extends Disposable {
const
remoteAuthorityResolverService
=
new
RemoteAuthorityResolverService
();
serviceCollection
.
set
(
IRemoteAuthorityResolverService
,
remoteAuthorityResolverService
);
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
//
// NOTE: Please do NOT register services here. Use `registerSingleton()`
// from `workbench.common.main.ts` if the service is shared between
// desktop and web or `workbench.sandbox.main.ts` if the service
// is desktop only.
//
// DO NOT add services to `workbench.desktop.main.ts`, always add
// to `workbench.sandbox.main.ts` to support our Electron sandbox
//
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
// Sign
const
signService
=
new
SignService
();
serviceCollection
.
set
(
ISignService
,
signService
);
...
...
@@ -210,6 +233,20 @@ class DesktopMain extends Disposable {
// User Data Provider
fileService
.
registerProvider
(
Schemas
.
userData
,
new
FileUserDataProvider
(
this
.
environmentService
.
appSettingsHome
,
this
.
environmentService
.
configuration
.
backupPath
?
URI
.
file
(
this
.
environmentService
.
configuration
.
backupPath
)
:
undefined
,
diskFileSystemProvider
,
this
.
environmentService
,
logService
));
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
//
// NOTE: Please do NOT register services here. Use `registerSingleton()`
// from `workbench.common.main.ts` if the service is shared between
// desktop and web or `workbench.sandbox.main.ts` if the service
// is desktop only.
//
// DO NOT add services to `workbench.desktop.main.ts`, always add
// to `workbench.sandbox.main.ts` to support our Electron sandbox
//
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
const
connection
=
remoteAgentService
.
getConnection
();
if
(
connection
)
{
const
remoteFileSystemProvider
=
this
.
_register
(
new
RemoteFileSystemProvider
(
remoteAgentService
));
...
...
@@ -242,6 +279,20 @@ class DesktopMain extends Disposable {
})
]);
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
//
// NOTE: Please do NOT register services here. Use `registerSingleton()`
// from `workbench.common.main.ts` if the service is shared between
// desktop and web or `workbench.sandbox.main.ts` if the service
// is desktop only.
//
// DO NOT add services to `workbench.desktop.main.ts`, always add
// to `workbench.sandbox.main.ts` to support our Electron sandbox
//
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
return
{
serviceCollection
,
logService
,
storageService
:
services
[
1
]
};
}
...
...
src/vs/workbench/electron-sandbox/desktop.main.ts
浏览文件 @
e85114b2
...
...
@@ -140,10 +140,18 @@ class DesktopMain extends Disposable {
private
async
initServices
():
Promise
<
{
serviceCollection
:
ServiceCollection
,
logService
:
ILogService
,
storageService
:
SimpleStorageService
}
>
{
const
serviceCollection
=
new
ServiceCollection
();
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
// NOTE: DO NOT ADD ANY OTHER SERVICE INTO THE COLLECTION HERE.
// CONTRIBUTE IT VIA WORKBENCH.DESKTOP.MAIN.TS AND registerSingleton().
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
//
// NOTE: Please do NOT register services here. Use `registerSingleton()`
// from `workbench.common.main.ts` if the service is shared between
// desktop and web or `workbench.sandbox.main.ts` if the service
// is desktop only.
//
// DO NOT add services to `workbench.desktop.main.ts`, always add
// to `workbench.sandbox.main.ts` to support our Electron sandbox
//
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
// Main Process
const
mainProcessService
=
this
.
_register
(
new
MainProcessService
(
this
.
configuration
.
windowId
));
...
...
@@ -173,6 +181,20 @@ class DesktopMain extends Disposable {
const
remoteAgentService
=
new
SimpleRemoteAgentService
();
serviceCollection
.
set
(
IRemoteAgentService
,
remoteAgentService
);
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
//
// NOTE: Please do NOT register services here. Use `registerSingleton()`
// from `workbench.common.main.ts` if the service is shared between
// desktop and web or `workbench.sandbox.main.ts` if the service
// is desktop only.
//
// DO NOT add services to `workbench.desktop.main.ts`, always add
// to `workbench.sandbox.main.ts` to support our Electron sandbox
//
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
// Native Host
const
nativeHostService
=
new
NativeHostService
(
this
.
configuration
.
windowId
,
mainProcessService
)
as
INativeHostService
;
serviceCollection
.
set
(
INativeHostService
,
nativeHostService
);
...
...
@@ -195,6 +217,20 @@ class DesktopMain extends Disposable {
const
resourceIdentityService
=
new
SimpleResourceIdentityService
();
serviceCollection
.
set
(
IResourceIdentityService
,
resourceIdentityService
);
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
//
// NOTE: Please do NOT register services here. Use `registerSingleton()`
// from `workbench.common.main.ts` if the service is shared between
// desktop and web or `workbench.sandbox.main.ts` if the service
// is desktop only.
//
// DO NOT add services to `workbench.desktop.main.ts`, always add
// to `workbench.sandbox.main.ts` to support our Electron sandbox
//
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
const
services
=
await
Promise
.
all
([
this
.
createWorkspaceService
().
then
(
service
=>
{
...
...
@@ -216,6 +252,20 @@ class DesktopMain extends Disposable {
})
]);
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
//
// NOTE: Please do NOT register services here. Use `registerSingleton()`
// from `workbench.common.main.ts` if the service is shared between
// desktop and web or `workbench.sandbox.main.ts` if the service
// is desktop only.
//
// DO NOT add services to `workbench.desktop.main.ts`, always add
// to `workbench.sandbox.main.ts` to support our Electron sandbox
//
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
return
{
serviceCollection
,
logService
,
storageService
:
services
[
1
]
};
}
...
...
src/vs/workbench/workbench.desktop.main.ts
浏览文件 @
e85114b2
...
...
@@ -4,11 +4,16 @@
*--------------------------------------------------------------------------------------------*/
// #######################################################################
// ### ###
// ### !!! PLEASE ADD COMMON IMPORTS INTO WORKBENCH.COMMON.MAIN.TS !!! ###
// ### ###
// #######################################################################
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
//
// NOTE: Please do NOT register services here. Use `registerSingleton()`
// from `workbench.common.main.ts` if the service is shared between
// desktop and web or `workbench.sandbox.main.ts` if the service
// is desktop only.
//
// The `node` & `electron-browser` layer is deprecated for workbench!
//
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
//#region --- workbench common & sandbox
...
...
@@ -25,6 +30,18 @@ import 'vs/workbench/electron-browser/actions/developerActions';
//#endregion
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
//
// NOTE: Please do NOT register services here. Use `registerSingleton()`
// from `workbench.common.main.ts` if the service is shared between
// desktop and web or `workbench.sandbox.main.ts` if the service
// is desktop only.
//
// The `node` & `electron-browser` layer is deprecated for workbench!
//
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
//#region --- workbench (desktop main)
import
'
vs/workbench/electron-browser/desktop.main
'
;
...
...
@@ -34,6 +51,19 @@ import 'vs/workbench/electron-browser/desktop.main';
//#region --- workbench services
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
//
// NOTE: Please do NOT register services here. Use `registerSingleton()`
// from `workbench.common.main.ts` if the service is shared between
// desktop and web or `workbench.sandbox.main.ts` if the service
// is desktop only.
//
// The `node` & `electron-browser` layer is deprecated for workbench!
//
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
import
'
vs/workbench/services/integrity/node/integrityService
'
;
import
'
vs/workbench/services/search/electron-browser/searchService
'
;
import
'
vs/workbench/services/output/electron-browser/outputChannelModelService
'
;
...
...
@@ -55,6 +85,19 @@ import 'vs/workbench/services/localizations/electron-browser/localizationsServic
import
'
vs/workbench/services/diagnostics/electron-browser/diagnosticsService
'
;
import
'
vs/workbench/services/experiment/electron-browser/experimentService
'
;
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
//
// NOTE: Please do NOT register services here. Use `registerSingleton()`
// from `workbench.common.main.ts` if the service is shared between
// desktop and web or `workbench.sandbox.main.ts` if the service
// is desktop only.
//
// The `node` & `electron-browser` layer is deprecated for workbench!
//
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
import
{
registerSingleton
}
from
'
vs/platform/instantiation/common/extensions
'
;
import
{
ICredentialsService
}
from
'
vs/platform/credentials/common/credentials
'
;
import
{
KeytarCredentialsService
}
from
'
vs/platform/credentials/node/credentialsService
'
;
...
...
@@ -67,6 +110,18 @@ registerSingleton(ITunnelService, TunnelService);
//#endregion
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
//
// NOTE: Please do NOT register services here. Use `registerSingleton()`
// from `workbench.common.main.ts` if the service is shared between
// desktop and web or `workbench.sandbox.main.ts` if the service
// is desktop only.
//
// The `node` & `electron-browser` layer is deprecated for workbench!
//
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
//#region --- workbench contributions
// Tags
...
...
@@ -82,6 +137,19 @@ import 'vs/workbench/contrib/debug/node/debugHelperService';
// Webview
import
'
vs/workbench/contrib/webview/electron-browser/webview.contribution
'
;
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
//
// NOTE: Please do NOT register services here. Use `registerSingleton()`
// from `workbench.common.main.ts` if the service is shared between
// desktop and web or `workbench.sandbox.main.ts` if the service
// is desktop only.
//
// The `node` & `electron-browser` layer is deprecated for workbench!
//
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
// Notebook
import
'
vs/workbench/contrib/notebook/electron-browser/notebook.contribution
'
;
...
...
@@ -97,6 +165,19 @@ import 'vs/workbench/contrib/codeEditor/electron-browser/codeEditor.contribution
// External Terminal
import
'
vs/workbench/contrib/externalTerminal/node/externalTerminal.contribution
'
;
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
//
// NOTE: Please do NOT register services here. Use `registerSingleton()`
// from `workbench.common.main.ts` if the service is shared between
// desktop and web or `workbench.sandbox.main.ts` if the service
// is desktop only.
//
// The `node` & `electron-browser` layer is deprecated for workbench!
//
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
// Performance
import
'
vs/workbench/contrib/performance/electron-browser/performance.contribution
'
;
...
...
@@ -109,4 +190,17 @@ import 'vs/workbench/contrib/tasks/electron-browser/taskService';
// User Data Sync
import
'
vs/workbench/contrib/userDataSync/electron-browser/userDataSync.contribution
'
;
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
//
// NOTE: Please do NOT register services here. Use `registerSingleton()`
// from `workbench.common.main.ts` if the service is shared between
// desktop and web or `workbench.sandbox.main.ts` if the service
// is desktop only.
//
// The `node` & `electron-browser` layer is deprecated for workbench!
//
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
//#endregion
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录