Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
d5e4540b
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,发现更多精彩内容 >>
提交
d5e4540b
编写于
6月 16, 2016
作者:
J
Joao Moreno
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
allow IO from shared process in dev
上级
41c4d496
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
20 addition
and
15 deletion
+20
-15
src/bootstrap.js
src/bootstrap.js
+12
-10
src/vs/code/electron-main/main.ts
src/vs/code/electron-main/main.ts
+1
-1
src/vs/code/electron-main/sharedProcess.ts
src/vs/code/electron-main/sharedProcess.ts
+7
-4
未找到文件。
src/bootstrap.js
浏览文件 @
d5e4540b
...
@@ -90,16 +90,18 @@ if (!!process.send && process.env.PIPE_LOGGING === 'true') {
...
@@ -90,16 +90,18 @@ if (!!process.send && process.env.PIPE_LOGGING === 'true') {
console
.
error
=
function
()
{
safeSend
({
type
:
'
__$console
'
,
severity
:
'
error
'
,
arguments
:
safeStringify
(
arguments
)
});
};
console
.
error
=
function
()
{
safeSend
({
type
:
'
__$console
'
,
severity
:
'
error
'
,
arguments
:
safeStringify
(
arguments
)
});
};
}
}
// Let stdout, stderr and stdin be no-op streams. This prevents an issue where we would get an EBADF
if
(
!
process
.
env
[
'
VSCODE_ALLOW_IO
'
])
{
// error when we are inside a forked process and this process tries to access those channels.
// Let stdout, stderr and stdin be no-op streams. This prevents an issue where we would get an EBADF
var
stream
=
require
(
'
stream
'
);
// error when we are inside a forked process and this process tries to access those channels.
var
writable
=
new
stream
.
Writable
({
var
stream
=
require
(
'
stream
'
);
write
:
function
()
{
/* No OP */
}
var
writable
=
new
stream
.
Writable
({
});
write
:
function
()
{
/* No OP */
}
});
process
.
__defineGetter__
(
'
stdout
'
,
function
()
{
return
writable
;
});
process
.
__defineGetter__
(
'
stderr
'
,
function
()
{
return
writable
;
});
process
.
__defineGetter__
(
'
stdout
'
,
function
()
{
return
writable
;
});
process
.
__defineGetter__
(
'
stdin
'
,
function
()
{
return
writable
;
});
process
.
__defineGetter__
(
'
stderr
'
,
function
()
{
return
writable
;
});
process
.
__defineGetter__
(
'
stdin
'
,
function
()
{
return
writable
;
});
}
// Handle uncaught exceptions
// Handle uncaught exceptions
process
.
on
(
'
uncaughtException
'
,
function
(
err
)
{
process
.
on
(
'
uncaughtException
'
,
function
(
err
)
{
...
...
src/vs/code/electron-main/main.ts
浏览文件 @
d5e4540b
...
@@ -108,7 +108,7 @@ function main(accessor: ServicesAccessor, ipcServer: Server, userEnv: IProcessEn
...
@@ -108,7 +108,7 @@ function main(accessor: ServicesAccessor, ipcServer: Server, userEnv: IProcessEn
process
.
env
[
'
VSCODE_SHARED_IPC_HOOK
'
]
=
envService
.
sharedIPCHandle
;
process
.
env
[
'
VSCODE_SHARED_IPC_HOOK
'
]
=
envService
.
sharedIPCHandle
;
// Spawn shared process
// Spawn shared process
const
sharedProcess
=
instantiationService
.
invokeFunction
(
spawnSharedProcess
);
const
sharedProcess
=
spawnSharedProcess
(
!
envService
.
isBuilt
||
envService
.
cliArgs
.
verboseLogging
);
// Make sure we associate the program with the app user model id
// Make sure we associate the program with the app user model id
// This will help Windows to associate the running program with
// This will help Windows to associate the running program with
...
...
src/vs/code/electron-main/sharedProcess.ts
浏览文件 @
d5e4540b
...
@@ -7,15 +7,18 @@ import * as cp from 'child_process';
...
@@ -7,15 +7,18 @@ import * as cp from 'child_process';
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
{
assign
}
from
'
vs/base/common/objects
'
;
import
{
assign
}
from
'
vs/base/common/objects
'
;
import
{
ServicesAccessor
}
from
'
vs/platform/instantiation/common/instantiation
'
;
const
boostrapPath
=
URI
.
parse
(
require
.
toUrl
(
'
bootstrap
'
)).
fsPath
;
const
boostrapPath
=
URI
.
parse
(
require
.
toUrl
(
'
bootstrap
'
)).
fsPath
;
function
_spawnSharedProcess
():
cp
.
ChildProcess
{
function
_spawnSharedProcess
(
allowOutput
:
boolean
):
cp
.
ChildProcess
{
const
env
=
assign
({},
process
.
env
,
{
const
env
=
assign
({},
process
.
env
,
{
AMD_ENTRYPOINT
:
'
vs/code/node/sharedProcessMain
'
AMD_ENTRYPOINT
:
'
vs/code/node/sharedProcessMain
'
});
});
if
(
allowOutput
)
{
env
[
'
VSCODE_ALLOW_IO
'
]
=
'
true
'
;
}
const
result
=
cp
.
fork
(
boostrapPath
,
[
'
--type=SharedProcess
'
],
{
env
});
const
result
=
cp
.
fork
(
boostrapPath
,
[
'
--type=SharedProcess
'
],
{
env
});
// handshake
// handshake
...
@@ -26,7 +29,7 @@ function _spawnSharedProcess(): cp.ChildProcess {
...
@@ -26,7 +29,7 @@ function _spawnSharedProcess(): cp.ChildProcess {
let
spawnCount
=
0
;
let
spawnCount
=
0
;
export
function
spawnSharedProcess
(
a
ccessor
:
ServicesAccessor
):
IDisposable
{
export
function
spawnSharedProcess
(
a
llowOutput
:
boolean
):
IDisposable
{
let
child
:
cp
.
ChildProcess
;
let
child
:
cp
.
ChildProcess
;
const
spawn
=
()
=>
{
const
spawn
=
()
=>
{
...
@@ -34,7 +37,7 @@ export function spawnSharedProcess(accessor: ServicesAccessor): IDisposable {
...
@@ -34,7 +37,7 @@ export function spawnSharedProcess(accessor: ServicesAccessor): IDisposable {
return
;
return
;
}
}
child
=
_spawnSharedProcess
();
child
=
_spawnSharedProcess
(
allowOutput
);
child
.
on
(
'
exit
'
,
spawn
);
child
.
on
(
'
exit
'
,
spawn
);
};
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录