Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
e3eaa27e
V
vscode
项目概览
掘金者说
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
e3eaa27e
编写于
8月 17, 2016
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
send parsed process.argv over from main side to renderer
上级
f2086e45
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
15 addition
and
17 deletion
+15
-17
src/vs/code/electron-main/window.ts
src/vs/code/electron-main/window.ts
+6
-2
src/vs/workbench/electron-browser/main.ts
src/vs/workbench/electron-browser/main.ts
+9
-15
未找到文件。
src/vs/code/electron-main/window.ts
浏览文件 @
e3eaa27e
...
...
@@ -13,6 +13,7 @@ import { shell, screen, BrowserWindow } from 'electron';
import
{
TPromise
,
TValueCallback
}
from
'
vs/base/common/winjs.base
'
;
import
{
ICommandLineArguments
,
IEnvService
,
IProcessEnvironment
}
from
'
vs/code/electron-main/env
'
;
import
{
ILogService
}
from
'
vs/code/electron-main/log
'
;
import
{
parseArgs
}
from
'
vs/code/node/argv
'
;
export
interface
IWindowState
{
width
?:
number
;
...
...
@@ -419,10 +420,13 @@ export class VSCodeWindow {
this
.
load
(
configuration
);
}
private
getUrl
(
config
:
IWindowConfiguration
):
string
{
private
getUrl
(
windowConfiguration
:
IWindowConfiguration
):
string
{
let
url
=
require
.
toUrl
(
'
vs/workbench/electron-browser/bootstrap/index.html
'
);
// Config
// Config (combination of process.argv and window configuration)
const
environment
=
parseArgs
(
process
.
argv
);
const
config
=
objects
.
assign
(
environment
,
windowConfiguration
);
url
+=
'
?config=
'
+
encodeURIComponent
(
JSON
.
stringify
(
config
));
return
url
;
...
...
src/vs/workbench/electron-browser/main.ts
浏览文件 @
e3eaa27e
...
...
@@ -16,9 +16,9 @@ import uri from 'vs/base/common/uri';
import
strings
=
require
(
'
vs/base/common/strings
'
);
import
{
IResourceInput
}
from
'
vs/platform/editor/common/editor
'
;
import
{
EventService
}
from
'
vs/platform/event/common/eventService
'
;
import
{
ParsedArgs
,
parseArgs
}
from
'
vs/code/node/argv
'
;
import
{
ParsedArgs
}
from
'
vs/code/node/argv
'
;
import
{
WorkspaceContextService
}
from
'
vs/workbench/services/workspace/common/contextService
'
;
import
{
IWorkspace
,
IConfiguration
,
IEnvironment
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
IWorkspace
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
ConfigurationService
}
from
'
vs/workbench/services/configuration/node/configurationService
'
;
import
{
EnvironmentService
}
from
'
vs/platform/environment/node/environmentService
'
;
import
path
=
require
(
'
path
'
);
...
...
@@ -46,7 +46,7 @@ export interface IPath {
columnNumber
?:
number
;
}
export
interface
I
MainEnvironment
extends
IEnvironment
{
export
interface
I
Configuration
extends
ParsedArgs
{
workspacePath
?:
string
;
filesToOpen
?:
IPath
[];
filesToCreate
?:
IPath
[];
...
...
@@ -54,16 +54,10 @@ export interface IMainEnvironment extends IEnvironment {
extensionsToInstall
?:
string
[];
}
export
function
startup
(
configuration
:
IMainEnvironment
,
globalSettings
:
IGlobalSettings
):
winjs
.
TPromise
<
void
>
{
// Args (TODO@Ben clean up explicit overwrite of args)
const
parsedArgs
=
parseArgs
(
process
.
argv
);
if
(
typeof
configuration
.
extensionDevelopmentPath
===
'
string
'
)
{
parsedArgs
.
extensionDevelopmentPath
=
configuration
.
extensionDevelopmentPath
;
}
export
function
startup
(
configuration
:
IConfiguration
,
globalSettings
:
IGlobalSettings
):
winjs
.
TPromise
<
void
>
{
// Shell Configuration
const
shellConfiguration
:
IConfiguration
=
{
const
shellConfiguration
:
any
=
{
env
:
configuration
};
...
...
@@ -80,12 +74,12 @@ export function startup(configuration: IMainEnvironment, globalSettings: IGlobal
globalSettings
:
globalSettings
};
if
(
configuration
.
enableP
erformance
)
{
if
(
configuration
.
p
erformance
)
{
timer
.
ENABLE_TIMER
=
true
;
}
// Open workbench
return
openWorkbench
(
parsedArgs
,
getWorkspace
(
configuration
.
workspacePath
),
shellConfiguration
,
shellOptions
);
return
openWorkbench
(
configuration
,
getWorkspace
(
configuration
.
workspacePath
),
shellConfiguration
,
shellOptions
);
}
function
toInputs
(
paths
:
IPath
[]):
IResourceInput
[]
{
...
...
@@ -134,9 +128,9 @@ function getWorkspace(workspacePath: string): IWorkspace {
};
}
function
openWorkbench
(
args
:
ParsedArgs
,
workspace
:
IWorkspace
,
configuration
:
IConfiguration
,
options
:
IOptions
):
winjs
.
TPromise
<
void
>
{
function
openWorkbench
(
environment
:
ParsedArgs
,
workspace
:
IWorkspace
,
configuration
:
IConfiguration
,
options
:
IOptions
):
winjs
.
TPromise
<
void
>
{
const
eventService
=
new
EventService
();
const
environmentService
=
new
EnvironmentService
(
args
);
const
environmentService
=
new
EnvironmentService
(
environment
);
const
contextService
=
new
WorkspaceContextService
(
eventService
,
workspace
,
configuration
,
options
);
const
configurationService
=
new
ConfigurationService
(
contextService
,
eventService
,
environmentService
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录