Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
e02a1c35
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 搜索 >>
提交
e02a1c35
编写于
12月 11, 2017
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
perf - pass over window ID instead of accessing via remote call on startup
上级
0ec4814c
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
13 addition
and
14 deletion
+13
-14
src/vs/code/electron-main/window.ts
src/vs/code/electron-main/window.ts
+3
-0
src/vs/platform/windows/common/windows.ts
src/vs/platform/windows/common/windows.ts
+1
-0
src/vs/workbench/electron-browser/main.ts
src/vs/workbench/electron-browser/main.ts
+6
-8
src/vs/workbench/electron-browser/shell.ts
src/vs/workbench/electron-browser/shell.ts
+3
-6
未找到文件。
src/vs/code/electron-main/window.ts
浏览文件 @
e02a1c35
...
...
@@ -563,6 +563,9 @@ export class CodeWindow implements ICodeWindow {
private
getUrl
(
windowConfiguration
:
IWindowConfiguration
):
string
{
// Set window ID
windowConfiguration
.
windowId
=
this
.
_win
.
id
;
// Set zoomlevel
const
windowConfig
=
this
.
configurationService
.
getValue
<
IWindowSettings
>
(
'
window
'
);
const
zoomLevel
=
windowConfig
&&
windowConfig
.
zoomLevel
;
...
...
src/vs/platform/windows/common/windows.ts
浏览文件 @
e02a1c35
...
...
@@ -292,6 +292,7 @@ export interface IAddFoldersRequest {
export
interface
IWindowConfiguration
extends
ParsedArgs
,
IOpenFileRequest
{
machineId
:
string
;
windowId
:
number
;
appRoot
:
string
;
execPath
:
string
;
...
...
src/vs/workbench/electron-browser/main.ts
浏览文件 @
e02a1c35
...
...
@@ -32,7 +32,7 @@ import { IStorageService } from 'vs/platform/storage/common/storage';
import
{
IEnvironmentService
}
from
'
vs/platform/environment/common/environment
'
;
import
{
StorageService
,
inMemoryLocalStorageInstance
}
from
'
vs/platform/storage/common/storageService
'
;
import
{
Client
as
ElectronIPCClient
}
from
'
vs/base/parts/ipc/electron-browser/ipc.electron-browser
'
;
import
{
webFrame
,
remote
}
from
'
electron
'
;
import
{
webFrame
}
from
'
electron
'
;
import
{
UpdateChannelClient
}
from
'
vs/platform/update/common/updateIpc
'
;
import
{
IUpdateService
}
from
'
vs/platform/update/common/update
'
;
import
{
URLChannelClient
}
from
'
vs/platform/url/common/urlIpc
'
;
...
...
@@ -45,8 +45,6 @@ import fs = require('fs');
import
{
ConsoleLogService
,
MultiplexLogService
}
from
'
vs/platform/log/common/log
'
;
gracefulFs
.
gracefulify
(
fs
);
// enable gracefulFs
const
currentWindowId
=
remote
.
getCurrentWindow
().
id
;
export
function
startup
(
configuration
:
IWindowConfiguration
):
TPromise
<
void
>
{
// Ensure others can listen to zoom level changes
...
...
@@ -70,11 +68,11 @@ export function startup(configuration: IWindowConfiguration): TPromise<void> {
}
function
openWorkbench
(
configuration
:
IWindowConfiguration
):
TPromise
<
void
>
{
const
mainProcessClient
=
new
ElectronIPCClient
(
String
(
`window
${
c
urrentW
indowId
}
`
));
const
mainServices
=
createMainProcessServices
(
mainProcessClient
);
const
mainProcessClient
=
new
ElectronIPCClient
(
String
(
`window
${
c
onfiguration
.
w
indowId
}
`
));
const
mainServices
=
createMainProcessServices
(
mainProcessClient
,
configuration
);
const
environmentService
=
new
EnvironmentService
(
configuration
,
configuration
.
execPath
);
const
spdlogService
=
createLogService
(
`renderer
${
c
urrentW
indowId
}
`
,
environmentService
);
const
spdlogService
=
createLogService
(
`renderer
${
c
onfiguration
.
w
indowId
}
`
,
environmentService
);
const
consoleLogService
=
new
ConsoleLogService
(
environmentService
);
const
logService
=
new
MultiplexLogService
([
consoleLogService
,
spdlogService
]);
...
...
@@ -194,7 +192,7 @@ function createStorageService(workspaceService: IWorkspaceContextService, enviro
return
new
StorageService
(
storage
,
storage
,
workspaceId
,
secondaryWorkspaceId
);
}
function
createMainProcessServices
(
mainProcessClient
:
ElectronIPCClient
):
ServiceCollection
{
function
createMainProcessServices
(
mainProcessClient
:
ElectronIPCClient
,
configuration
:
IWindowConfiguration
):
ServiceCollection
{
const
serviceCollection
=
new
ServiceCollection
();
const
windowsChannel
=
mainProcessClient
.
getChannel
(
'
windows
'
);
...
...
@@ -204,7 +202,7 @@ function createMainProcessServices(mainProcessClient: ElectronIPCClient): Servic
serviceCollection
.
set
(
IUpdateService
,
new
SyncDescriptor
(
UpdateChannelClient
,
updateChannel
));
const
urlChannel
=
mainProcessClient
.
getChannel
(
'
url
'
);
serviceCollection
.
set
(
IURLService
,
new
SyncDescriptor
(
URLChannelClient
,
urlChannel
,
c
urrentW
indowId
));
serviceCollection
.
set
(
IURLService
,
new
SyncDescriptor
(
URLChannelClient
,
urlChannel
,
c
onfiguration
.
w
indowId
));
const
workspacesChannel
=
mainProcessClient
.
getChannel
(
'
workspaces
'
);
serviceCollection
.
set
(
IWorkspacesService
,
new
WorkspacesChannelClient
(
workspacesChannel
));
...
...
src/vs/workbench/electron-browser/shell.ts
浏览文件 @
e02a1c35
...
...
@@ -71,7 +71,6 @@ import { IExtensionManagementChannel, ExtensionManagementChannelClient } from 'v
import
{
IExtensionManagementService
,
IExtensionEnablementService
}
from
'
vs/platform/extensionManagement/common/extensionManagement
'
;
import
{
ExtensionEnablementService
}
from
'
vs/platform/extensionManagement/common/extensionEnablementService
'
;
import
{
ITimerService
}
from
'
vs/workbench/services/timer/common/timerService
'
;
import
{
remote
}
from
'
electron
'
;
import
{
BareFontInfo
}
from
'
vs/editor/common/config/fontInfo
'
;
import
{
restoreFontInfo
,
readFontInfo
,
saveFontInfo
}
from
'
vs/editor/browser/config/configuration
'
;
import
*
as
browser
from
'
vs/base/browser/browser
'
;
...
...
@@ -101,8 +100,6 @@ export interface ICoreServices {
storageService
:
IStorageService
;
}
const
currentWindow
=
remote
.
getCurrentWindow
();
/**
* 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.
...
...
@@ -293,13 +290,13 @@ export class WorkbenchShell {
const
instantiationService
:
IInstantiationService
=
new
InstantiationService
(
serviceCollection
,
true
);
this
.
broadcastService
=
new
BroadcastService
(
currentWindow
.
i
d
);
this
.
broadcastService
=
new
BroadcastService
(
this
.
configuration
.
windowI
d
);
serviceCollection
.
set
(
IBroadcastService
,
this
.
broadcastService
);
serviceCollection
.
set
(
IWindowService
,
new
SyncDescriptor
(
WindowService
,
currentWindow
.
i
d
,
this
.
configuration
));
serviceCollection
.
set
(
IWindowService
,
new
SyncDescriptor
(
WindowService
,
this
.
configuration
.
windowI
d
,
this
.
configuration
));
const
sharedProcess
=
(
<
IWindowsService
>
serviceCollection
.
get
(
IWindowsService
)).
whenSharedProcessReady
()
.
then
(()
=>
connectNet
(
this
.
environmentService
.
sharedIPCHandle
,
`window:
${
currentWindow
.
i
d
}
`
));
.
then
(()
=>
connectNet
(
this
.
environmentService
.
sharedIPCHandle
,
`window:
${
this
.
configuration
.
windowI
d
}
`
));
sharedProcess
.
done
(
client
=>
client
.
registerChannel
(
'
choice
'
,
instantiationService
.
createInstance
(
ChoiceChannel
)));
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录