Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
66bd1bce
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 搜索 >>
提交
66bd1bce
编写于
2月 12, 2019
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
debt - get rid of Shell
上级
0d50120c
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
36 addition
and
120 deletion
+36
-120
src/vs/workbench/electron-browser/main.ts
src/vs/workbench/electron-browser/main.ts
+32
-12
src/vs/workbench/electron-browser/shell.ts
src/vs/workbench/electron-browser/shell.ts
+0
-108
src/vs/workbench/electron-browser/workbench.ts
src/vs/workbench/electron-browser/workbench.ts
+4
-0
未找到文件。
src/vs/workbench/electron-browser/main.ts
浏览文件 @
66bd1bce
...
...
@@ -5,7 +5,8 @@
import
*
as
nls
from
'
vs/nls
'
;
import
*
as
perf
from
'
vs/base/common/performance
'
;
import
{
Shell
}
from
'
vs/workbench/electron-browser/shell
'
;
import
{
Workbench
}
from
'
vs/workbench/electron-browser/workbench
'
;
import
{
ElectronWindow
}
from
'
vs/workbench/electron-browser/window
'
;
import
*
as
browser
from
'
vs/base/browser/browser
'
;
import
{
domContentLoaded
}
from
'
vs/base/browser/dom
'
;
import
{
onUnexpectedError
}
from
'
vs/base/common/errors
'
;
...
...
@@ -47,6 +48,10 @@ import { createHash } from 'crypto';
import
{
IdleValue
}
from
'
vs/base/common/async
'
;
import
{
setGlobalLeakWarningThreshold
}
from
'
vs/base/common/event
'
;
import
{
GlobalStorageDatabaseChannelClient
}
from
'
vs/platform/storage/node/storageIpc
'
;
import
{
IWorkspaceContextService
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
IConfigurationService
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
IStorageService
}
from
'
vs/platform/storage/common/storage
'
;
import
{
InstantiationService
}
from
'
vs/platform/instantiation/common/instantiationService
'
;
gracefulFs
.
gracefulify
(
fs
);
// enable gracefulFs
...
...
@@ -126,20 +131,35 @@ function openWorkbench(configuration: IWindowConfiguration): Promise<void> {
const
workspaceService
=
services
[
0
];
const
storageService
=
services
[
1
];
// Core services
const
serviceCollection
=
new
ServiceCollection
();
serviceCollection
.
set
(
IWorkspaceContextService
,
workspaceService
);
serviceCollection
.
set
(
IConfigurationService
,
workspaceService
);
serviceCollection
.
set
(
IEnvironmentService
,
environmentService
);
serviceCollection
.
set
(
ILogService
,
logService
);
serviceCollection
.
set
(
IStorageService
,
storageService
);
mainServices
.
forEach
((
serviceIdentifier
,
serviceInstance
)
=>
{
serviceCollection
.
set
(
serviceIdentifier
,
serviceInstance
);
});
const
instantiationService
=
new
InstantiationService
(
serviceCollection
,
true
);
return
domContentLoaded
().
then
(()
=>
{
perf
.
mark
(
'
willStartWorkbench
'
);
// Create Shell
const
shell
=
new
Shell
(
document
.
body
,
{
contextService
:
workspaceService
,
configurationService
:
workspaceService
,
environmentService
,
logService
,
storageService
},
mainServices
,
mainProcessClient
,
configuration
);
// Open Shell
shell
.
open
();
// Startup Workbench
const
workbench
=
instantiationService
.
createInstance
(
Workbench
,
document
.
body
,
configuration
,
serviceCollection
,
mainProcessClient
);
workbench
.
startup
();
// Window
workbench
.
getInstantiationService
().
createInstance
(
ElectronWindow
);
// Inform user about loading issues from the loader
(
<
any
>
self
).
require
.
config
({
...
...
src/vs/workbench/electron-browser/shell.ts
已删除
100644 → 0
浏览文件 @
0d50120c
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import
{
Disposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
IWindowConfiguration
}
from
'
vs/platform/windows/common/windows
'
;
import
{
IConfigurationService
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
ServiceCollection
}
from
'
vs/platform/instantiation/common/serviceCollection
'
;
import
{
IEnvironmentService
}
from
'
vs/platform/environment/common/environment
'
;
import
{
IWorkspaceContextService
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
ILogService
}
from
'
vs/platform/log/common/log
'
;
import
{
IStorageService
}
from
'
vs/platform/storage/common/storage
'
;
// import@node
import
{
InstantiationService
}
from
'
vs/platform/instantiation/node/instantiationService
'
;
import
{
IPCClient
}
from
'
vs/base/parts/ipc/node/ipc
'
;
// import@electron-browser
import
{
Workbench
}
from
'
vs/workbench/electron-browser/workbench
'
;
import
{
ElectronWindow
}
from
'
vs/workbench/electron-browser/window
'
;
/**
* Services that we require for the Shell
*/
export
interface
ICoreServices
{
contextService
:
IWorkspaceContextService
;
configurationService
:
IConfigurationService
;
environmentService
:
IEnvironmentService
;
logService
:
ILogService
;
storageService
:
IStorageService
;
}
/**
* The workbench shell contains the workbench with a rich header containing navigation and the activity bar.
* With the Shell being the top level element in the page, it is also responsible for driving the layouting.
*/
export
class
Shell
extends
Disposable
{
private
storageService
:
IStorageService
;
private
environmentService
:
IEnvironmentService
;
private
logService
:
ILogService
;
private
configurationService
:
IConfigurationService
;
private
contextService
:
IWorkspaceContextService
;
private
container
:
HTMLElement
;
private
mainProcessClient
:
IPCClient
;
private
mainProcessServices
:
ServiceCollection
;
private
configuration
:
IWindowConfiguration
;
constructor
(
container
:
HTMLElement
,
coreServices
:
ICoreServices
,
mainProcessServices
:
ServiceCollection
,
mainProcessClient
:
IPCClient
,
configuration
:
IWindowConfiguration
)
{
super
();
this
.
container
=
container
;
this
.
mainProcessClient
=
this
.
_register
(
mainProcessClient
);
this
.
configuration
=
configuration
;
this
.
contextService
=
coreServices
.
contextService
;
this
.
configurationService
=
coreServices
.
configurationService
;
this
.
environmentService
=
coreServices
.
environmentService
;
this
.
logService
=
coreServices
.
logService
;
this
.
storageService
=
coreServices
.
storageService
;
this
.
mainProcessServices
=
mainProcessServices
;
}
open
():
void
{
// Instantiation service with services
const
serviceCollection
=
this
.
initServiceCollection
();
const
instantiationService
=
new
InstantiationService
(
serviceCollection
,
true
);
// Workbench
const
workbench
=
this
.
_register
(
instantiationService
.
createInstance
(
Workbench
,
this
.
container
,
this
.
configuration
,
serviceCollection
,
this
.
mainProcessClient
));
workbench
.
startup
();
// Window
workbench
.
getInstantiationService
().
createInstance
(
ElectronWindow
);
}
private
initServiceCollection
():
ServiceCollection
{
const
serviceCollection
=
new
ServiceCollection
();
serviceCollection
.
set
(
IWorkspaceContextService
,
this
.
contextService
);
serviceCollection
.
set
(
IConfigurationService
,
this
.
configurationService
);
serviceCollection
.
set
(
IEnvironmentService
,
this
.
environmentService
);
serviceCollection
.
set
(
ILogService
,
this
.
_register
(
this
.
logService
));
serviceCollection
.
set
(
IStorageService
,
this
.
storageService
);
this
.
mainProcessServices
.
forEach
((
serviceIdentifier
,
serviceInstance
)
=>
{
serviceCollection
.
set
(
serviceIdentifier
,
serviceInstance
);
});
return
serviceCollection
;
}
}
src/vs/workbench/electron-browser/workbench.ts
浏览文件 @
66bd1bce
...
...
@@ -351,6 +351,10 @@ export class Workbench extends Disposable implements IPartService {
(
configuration
.
filesToOpen
&&
configuration
.
filesToOpen
.
length
>
0
)
||
(
configuration
.
filesToDiff
&&
configuration
.
filesToDiff
.
length
>
0
);
// TODO@Ben debt
this
.
_register
(
mainProcessClient
);
this
.
_register
(
logService
);
this
.
registerErrorHandler
();
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录