Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
690d0e33
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,发现更多精彩内容 >>
提交
690d0e33
编写于
11月 20, 2020
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
window - cleanup reload() method
上级
1568c0ca
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
12 addition
and
14 deletion
+12
-14
src/vs/code/electron-main/window.ts
src/vs/code/electron-main/window.ts
+10
-12
src/vs/platform/lifecycle/electron-main/lifecycleMainService.ts
.../platform/lifecycle/electron-main/lifecycleMainService.ts
+1
-1
src/vs/platform/windows/electron-main/windows.ts
src/vs/platform/windows/electron-main/windows.ts
+1
-1
未找到文件。
src/vs/code/electron-main/window.ts
浏览文件 @
690d0e33
...
...
@@ -5,7 +5,6 @@
import
*
as
os
from
'
os
'
;
import
*
as
path
from
'
vs/base/common/path
'
;
import
*
as
objects
from
'
vs/base/common/objects
'
;
import
*
as
nls
from
'
vs/nls
'
;
import
*
as
perf
from
'
vs/base/common/performance
'
;
import
{
Emitter
}
from
'
vs/base/common/event
'
;
...
...
@@ -111,8 +110,6 @@ export class CodeWindow extends Disposable implements ICodeWindow {
private
readonly
whenReadyCallbacks
:
{
(
window
:
ICodeWindow
):
void
}[];
private
pendingLoadConfig
?:
INativeWindowConfiguration
;
private
marketplaceHeadersPromise
:
Promise
<
object
>
;
private
readonly
touchBarGroups
:
TouchBarSegmentedControl
[];
...
...
@@ -286,6 +283,8 @@ export class CodeWindow extends Disposable implements ICodeWindow {
this
.
registerListeners
();
}
private
pendingLoadConfig
:
INativeWindowConfiguration
|
undefined
;
private
currentConfig
:
INativeWindowConfiguration
|
undefined
;
get
config
():
INativeWindowConfiguration
|
undefined
{
return
this
.
currentConfig
;
}
...
...
@@ -297,11 +296,11 @@ export class CodeWindow extends Disposable implements ICodeWindow {
get
hasHiddenTitleBarStyle
():
boolean
{
return
!!
this
.
hiddenTitleBarStyle
;
}
get
isExtensionDevelopmentHost
():
boolean
{
return
!!
(
this
.
c
onfig
&&
this
.
config
.
extensionDevelopmentPath
);
}
get
isExtensionDevelopmentHost
():
boolean
{
return
!!
(
this
.
c
urrentConfig
?
.
extensionDevelopmentPath
);
}
get
isExtensionTestHost
():
boolean
{
return
!!
(
this
.
c
onfig
&&
this
.
config
.
extensionTestsPath
);
}
get
isExtensionTestHost
():
boolean
{
return
!!
(
this
.
c
urrentConfig
?
.
extensionTestsPath
);
}
get
isExtensionDevelopmentTestFromCli
():
boolean
{
return
this
.
isExtensionDevelopmentHost
&&
this
.
isExtensionTestHost
&&
!
this
.
config
?.
debugId
;
}
get
isExtensionDevelopmentTestFromCli
():
boolean
{
return
this
.
isExtensionDevelopmentHost
&&
this
.
isExtensionTestHost
&&
!
this
.
c
urrentC
onfig
?.
debugId
;
}
setRepresentedFilename
(
filename
:
string
):
void
{
if
(
isMacintosh
)
{
...
...
@@ -739,10 +738,10 @@ export class CodeWindow extends Disposable implements ICodeWindow {
this
.
_onLoad
.
fire
();
}
reload
(
c
onfigurationIn
?:
INativeWindowConfiguration
,
c
li
?:
NativeParsedArgs
):
void
{
reload
(
cli
?:
NativeParsedArgs
):
void
{
//
If config is not provided, copy our current on
e
const
configuration
=
configurationIn
?
configurationIn
:
objects
.
mixi
n
({},
this
.
currentConfig
);
//
Copy our current config for reus
e
const
configuration
=
Object
.
assig
n
({},
this
.
currentConfig
);
// Delete some properties we do not want during reload
delete
configuration
.
filesToOpenOrCreate
;
...
...
@@ -820,10 +819,9 @@ export class CodeWindow extends Disposable implements ICodeWindow {
// large depending on user configuration, so we can only remove it in that case.
let
configUrl
=
this
.
doGetUrl
(
config
);
if
(
configUrl
.
length
>
CodeWindow
.
MAX_URL_LENGTH
)
{
delete
config
.
userEnv
;
this
.
logService
.
warn
(
'
Application URL exceeds maximum of 2MB and was shortened.
'
);
configUrl
=
this
.
doGetUrl
(
config
);
configUrl
=
this
.
doGetUrl
(
{
...
config
,
userEnv
:
undefined
}
);
if
(
configUrl
.
length
>
CodeWindow
.
MAX_URL_LENGTH
)
{
this
.
logService
.
error
(
'
Application URL exceeds maximum of 2MB and cannot be loaded.
'
);
...
...
@@ -1139,7 +1137,7 @@ export class CodeWindow extends Disposable implements ICodeWindow {
}
private
getMenuBarVisibility
():
MenuBarVisibility
{
let
menuBarVisibility
=
getMenuBarVisibility
(
this
.
configurationService
,
this
.
environmentService
,
!!
this
.
config
?.
extensionDevelopmentPath
);
let
menuBarVisibility
=
getMenuBarVisibility
(
this
.
configurationService
,
this
.
environmentService
,
!!
this
.
c
urrentC
onfig
?.
extensionDevelopmentPath
);
if
([
'
visible
'
,
'
toggle
'
,
'
hidden
'
].
indexOf
(
menuBarVisibility
)
<
0
)
{
menuBarVisibility
=
'
default
'
;
}
...
...
src/vs/platform/lifecycle/electron-main/lifecycleMainService.ts
浏览文件 @
690d0e33
...
...
@@ -371,7 +371,7 @@ export class LifecycleMainService extends Disposable implements ILifecycleMainSe
// Only reload when the window has not vetoed this
const
veto
=
await
this
.
unload
(
window
,
UnloadReason
.
RELOAD
);
if
(
!
veto
)
{
window
.
reload
(
undefined
,
cli
);
window
.
reload
(
cli
);
}
}
...
...
src/vs/platform/windows/electron-main/windows.ts
浏览文件 @
690d0e33
...
...
@@ -59,7 +59,7 @@ export interface ICodeWindow extends IDisposable {
addTabbedWindow
(
window
:
ICodeWindow
):
void
;
load
(
config
:
INativeWindowConfiguration
,
isReload
?:
boolean
):
void
;
reload
(
c
onfiguration
?:
INativeWindowConfiguration
,
c
li
?:
NativeParsedArgs
):
void
;
reload
(
cli
?:
NativeParsedArgs
):
void
;
focus
(
options
?:
{
force
:
boolean
}):
void
;
close
():
void
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录