Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
f199d20e
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,发现更多精彩内容 >>
提交
f199d20e
编写于
9月 04, 2018
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
debt - more TPromise.done() removal and unhandledRejection handler (#57695)
上级
473e5051
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
17 addition
and
14 deletion
+17
-14
src/bootstrap.js
src/bootstrap.js
+7
-4
src/vs/code/electron-main/app.ts
src/vs/code/electron-main/app.ts
+2
-2
src/vs/code/electron-main/window.ts
src/vs/code/electron-main/window.ts
+1
-1
src/vs/code/electron-main/windows.ts
src/vs/code/electron-main/windows.ts
+3
-3
src/vs/platform/lifecycle/electron-main/lifecycleMain.ts
src/vs/platform/lifecycle/electron-main/lifecycleMain.ts
+1
-1
src/vs/platform/update/electron-main/abstractUpdateService.ts
...vs/platform/update/electron-main/abstractUpdateService.ts
+1
-1
src/vs/workbench/electron-browser/shell.ts
src/vs/workbench/electron-browser/shell.ts
+2
-2
未找到文件。
src/bootstrap.js
浏览文件 @
f199d20e
...
...
@@ -141,12 +141,15 @@ if (!process.env['VSCODE_ALLOW_IO']) {
}
if
(
!
process
.
env
[
'
VSCODE_HANDLES_UNCAUGHT_ERRORS
'
])
{
// Handle uncaught exceptions
process
.
on
(
'
uncaughtException
'
,
function
(
err
)
{
console
.
error
(
'
Uncaught Exception:
'
,
err
.
toString
());
if
(
err
.
stack
)
{
console
.
error
(
err
.
stack
);
}
console
.
error
(
'
Uncaught Exception:
'
,
err
);
});
// Handle unhandled promise rejections
process
.
on
(
'
unhandledRejection
'
,
function
(
reason
)
{
console
.
error
(
'
Unhandled Promise Rejection:
'
,
reason
);
});
}
...
...
src/vs/code/electron-main/app.ts
浏览文件 @
f199d20e
...
...
@@ -442,7 +442,7 @@ export class CodeApplication {
const
windowsService
=
accessor
.
get
(
IWindowsService
);
const
windowsChannel
=
new
WindowsChannel
(
windowsService
);
this
.
electronIpcServer
.
registerChannel
(
'
windows
'
,
windowsChannel
);
this
.
sharedProcessClient
.
done
(
client
=>
client
.
registerChannel
(
'
windows
'
,
windowsChannel
));
this
.
sharedProcessClient
.
then
(
client
=>
client
.
registerChannel
(
'
windows
'
,
windowsChannel
));
const
menubarService
=
accessor
.
get
(
IMenubarService
);
const
menubarChannel
=
new
MenubarChannel
(
menubarService
);
...
...
@@ -455,7 +455,7 @@ export class CodeApplication {
// Log level management
const
logLevelChannel
=
new
LogLevelSetterChannel
(
accessor
.
get
(
ILogService
));
this
.
electronIpcServer
.
registerChannel
(
'
loglevel
'
,
logLevelChannel
);
this
.
sharedProcessClient
.
done
(
client
=>
client
.
registerChannel
(
'
loglevel
'
,
logLevelChannel
));
this
.
sharedProcessClient
.
then
(
client
=>
client
.
registerChannel
(
'
loglevel
'
,
logLevelChannel
));
// Lifecycle
this
.
lifecycleService
.
ready
();
...
...
src/vs/code/electron-main/window.ts
浏览文件 @
f199d20e
...
...
@@ -312,7 +312,7 @@ export class CodeWindow implements ICodeWindow {
// Inject headers when requests are incoming
const
urls
=
[
'
https://marketplace.visualstudio.com/*
'
,
'
https://*.vsassets.io/*
'
];
this
.
_win
.
webContents
.
session
.
webRequest
.
onBeforeSendHeaders
({
urls
},
(
details
:
any
,
cb
:
any
)
=>
{
this
.
marketplaceHeadersPromise
.
done
(
headers
=>
{
this
.
marketplaceHeadersPromise
.
then
(
headers
=>
{
cb
({
cancel
:
false
,
requestHeaders
:
objects
.
assign
(
details
.
requestHeaders
,
headers
)
});
});
});
...
...
src/vs/code/electron-main/windows.ts
浏览文件 @
f199d20e
...
...
@@ -485,7 +485,7 @@ export class WindowsManager implements IWindowsMainService {
// used for the edit operation is closed or loaded to a different folder so that the waiting
// process can continue. We do this by deleting the waitMarkerFilePath.
if
(
openConfig
.
context
===
OpenContext
.
CLI
&&
openConfig
.
cli
.
wait
&&
openConfig
.
cli
.
waitMarkerFilePath
&&
usedWindows
.
length
===
1
&&
usedWindows
[
0
])
{
this
.
waitForWindowCloseOrLoad
(
usedWindows
[
0
].
id
).
done
(()
=>
fs
.
unlink
(
openConfig
.
cli
.
waitMarkerFilePath
,
error
=>
void
0
));
this
.
waitForWindowCloseOrLoad
(
usedWindows
[
0
].
id
).
then
(()
=>
fs
.
unlink
(
openConfig
.
cli
.
waitMarkerFilePath
,
error
=>
void
0
));
}
return
usedWindows
;
...
...
@@ -1279,7 +1279,7 @@ export class WindowsManager implements IWindowsMainService {
}
// Only load when the window has not vetoed this
this
.
lifecycleService
.
unload
(
window
,
UnloadReason
.
LOAD
).
done
(
veto
=>
{
this
.
lifecycleService
.
unload
(
window
,
UnloadReason
.
LOAD
).
then
(
veto
=>
{
if
(
!
veto
)
{
// Register window for backups
...
...
@@ -1434,7 +1434,7 @@ export class WindowsManager implements IWindowsMainService {
reload
(
win
:
ICodeWindow
,
cli
?:
ParsedArgs
):
void
{
// Only reload when the window has not vetoed this
this
.
lifecycleService
.
unload
(
win
,
UnloadReason
.
RELOAD
).
done
(
veto
=>
{
this
.
lifecycleService
.
unload
(
win
,
UnloadReason
.
RELOAD
).
then
(
veto
=>
{
if
(
!
veto
)
{
win
.
reload
(
void
0
,
cli
);
...
...
src/vs/platform/lifecycle/electron-main/lifecycleMain.ts
浏览文件 @
f199d20e
...
...
@@ -199,7 +199,7 @@ export class LifecycleService implements ILifecycleService {
// Otherwise prevent unload and handle it from window
e
.
preventDefault
();
this
.
unload
(
window
,
UnloadReason
.
CLOSE
).
done
(
veto
=>
{
this
.
unload
(
window
,
UnloadReason
.
CLOSE
).
then
(
veto
=>
{
if
(
!
veto
)
{
this
.
windowToCloseRequest
[
windowId
]
=
true
;
...
...
src/vs/platform/update/electron-main/abstractUpdateService.ts
浏览文件 @
f199d20e
...
...
@@ -144,7 +144,7 @@ export abstract class AbstractUpdateService implements IUpdateService {
this
.
logService
.
trace
(
'
update#quitAndInstall(): before lifecycle quit()
'
);
this
.
lifecycleService
.
quit
(
true
/* from update */
).
done
(
vetod
=>
{
this
.
lifecycleService
.
quit
(
true
/* from update */
).
then
(
vetod
=>
{
this
.
logService
.
trace
(
`update#quitAndInstall(): after lifecycle quit() with veto:
${
vetod
}
`
);
if
(
vetod
)
{
return
;
...
...
src/vs/workbench/electron-browser/shell.ts
浏览文件 @
f199d20e
...
...
@@ -449,10 +449,10 @@ export class WorkbenchShell extends Disposable {
open
():
void
{
// Listen on unhandled rejection events
window
.
addEventListener
(
'
unhandledrejection
'
,
event
=>
{
window
.
addEventListener
(
'
unhandledrejection
'
,
(
event
:
PromiseRejectionEvent
)
=>
{
// See https://developer.mozilla.org/en-US/docs/Web/API/PromiseRejectionEvent
errors
.
onUnexpectedError
(
(
<
any
>
event
)
.
reason
);
errors
.
onUnexpectedError
(
event
.
reason
);
// Prevent the printing of this event to the console
event
.
preventDefault
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录