Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
b782c3a6
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,发现更多精彩内容 >>
提交
b782c3a6
编写于
12月 01, 2018
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
storage - avoid storage access on shutdown
上级
e7bfb7b0
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
12 addition
and
29 deletion
+12
-29
src/vs/platform/storage/node/storageService.ts
src/vs/platform/storage/node/storageService.ts
+0
-1
src/vs/workbench/electron-browser/workbench.ts
src/vs/workbench/electron-browser/workbench.ts
+11
-27
src/vs/workbench/services/history/electron-browser/history.ts
...vs/workbench/services/history/electron-browser/history.ts
+1
-1
未找到文件。
src/vs/platform/storage/node/storageService.ts
浏览文件 @
b782c3a6
...
...
@@ -199,7 +199,6 @@ export class StorageService extends Disposable implements IStorageService {
'
workbench.panelpart.activepanelid
'
,
'
workbench.zenmode.active
'
,
'
workbench.centerededitorlayout.active
'
,
'
workbench.sidebar.restore
'
,
'
workbench.sidebar.hidden
'
,
'
workbench.panel.hidden
'
,
'
workbench.panel.location
'
,
...
...
src/vs/workbench/electron-browser/workbench.ts
浏览文件 @
b782c3a6
...
...
@@ -72,7 +72,7 @@ import { ProgressService2 } from 'vs/workbench/services/progress/browser/progres
import
{
TextModelResolverService
}
from
'
vs/workbench/services/textmodelResolver/common/textModelResolverService
'
;
import
{
ITextModelService
}
from
'
vs/editor/common/services/resolverService
'
;
import
{
ServiceCollection
}
from
'
vs/platform/instantiation/common/serviceCollection
'
;
import
{
ShutdownReason
,
LifecyclePhase
}
from
'
vs/platform/lifecycle/common/lifecycle
'
;
import
{
LifecyclePhase
,
StartupKind
}
from
'
vs/platform/lifecycle/common/lifecycle
'
;
import
{
LifecycleService
}
from
'
vs/platform/lifecycle/electron-browser/lifecycleService
'
;
import
{
IWindowService
,
IWindowConfiguration
,
IPath
,
MenuBarVisibility
,
getTitleBarStyle
}
from
'
vs/platform/windows/common/windows
'
;
import
{
IStatusbarService
}
from
'
vs/platform/statusbar/common/statusbar
'
;
...
...
@@ -171,7 +171,6 @@ export class Workbench extends Disposable implements IPartService {
private
static
readonly
sidebarHiddenStorageKey
=
'
workbench.sidebar.hidden
'
;
private
static
readonly
menubarVisibilityConfigurationKey
=
'
window.menuBarVisibility
'
;
private
static
readonly
sidebarRestoreStorageKey
=
'
workbench.sidebar.restore
'
;
private
static
readonly
panelHiddenStorageKey
=
'
workbench.panel.hidden
'
;
private
static
readonly
zenModeActiveStorageKey
=
'
workbench.zenmode.active
'
;
private
static
readonly
centeredEditorLayoutActiveStorageKey
=
'
workbench.centerededitorlayout.active
'
;
...
...
@@ -476,8 +475,8 @@ export class Workbench extends Disposable implements IPartService {
private
registerListeners
():
void
{
//
Lifecycl
e
this
.
_register
(
this
.
lifecycleService
.
onBeforeShutdown
(
e
=>
this
.
saveState
(
e
.
reason
)));
//
Storag
e
this
.
_register
(
this
.
storageService
.
onWillSaveState
(()
=>
this
.
saveState
(
)));
// Listen to visible editor changes
this
.
_register
(
this
.
editorService
.
onDidVisibleEditorsChange
(()
=>
this
.
onDidVisibleEditorsChange
()));
...
...
@@ -758,8 +757,10 @@ export class Workbench extends Disposable implements IPartService {
perf
.
mark
(
'
didRestorePanel
'
);
}
// Restore Zen Mode if active
if
(
this
.
storageService
.
getBoolean
(
Workbench
.
zenModeActiveStorageKey
,
StorageScope
.
WORKSPACE
,
false
))
{
// Restore Zen Mode if active and supported for restore on startup
const
zenConfig
=
this
.
configurationService
.
getValue
<
IZenModeSettings
>
(
'
zenMode
'
);
const
wasZenActive
=
this
.
storageService
.
getBoolean
(
Workbench
.
zenModeActiveStorageKey
,
StorageScope
.
WORKSPACE
,
false
);
if
(
wasZenActive
&&
(
zenConfig
.
restore
||
this
.
lifecycleService
.
startupKind
===
StartupKind
.
ReloadedWindow
))
{
this
.
toggleZenMode
(
true
,
true
);
}
...
...
@@ -802,12 +803,8 @@ export class Workbench extends Disposable implements IPartService {
return
true
;
// always restore sidebar when we are in development mode
}
const
restore
=
this
.
storageService
.
getBoolean
(
Workbench
.
sidebarRestoreStorageKey
,
StorageScope
.
WORKSPACE
);
if
(
restore
)
{
this
.
storageService
.
remove
(
Workbench
.
sidebarRestoreStorageKey
,
StorageScope
.
WORKSPACE
);
// only support once
}
return
restore
;
// always restore sidebar when the window was reloaded
return
this
.
lifecycleService
.
startupKind
===
StartupKind
.
ReloadedWindow
;
}
private
resolveEditorsToOpen
():
Thenable
<
IResourceEditor
[]
>
|
IResourceEditor
[]
{
...
...
@@ -1121,23 +1118,10 @@ export class Workbench extends Disposable implements IPartService {
return
this
.
instantiationService
;
}
private
saveState
(
reason
:
ShutdownReason
):
void
{
// Restore sidebar if we are being shutdown as a matter of a reload
if
(
reason
===
ShutdownReason
.
RELOAD
)
{
this
.
storageService
.
store
(
Workbench
.
sidebarRestoreStorageKey
,
true
,
StorageScope
.
WORKSPACE
);
}
// Preserve zen mode only on reload. Real quit gets out of zen mode so novice users do not get stuck in zen mode.
const
zenConfig
=
this
.
configurationService
.
getValue
<
IZenModeSettings
>
(
'
zenMode
'
);
const
restoreZenMode
=
this
.
zenMode
.
active
&&
(
zenConfig
.
restore
||
reason
===
ShutdownReason
.
RELOAD
);
if
(
restoreZenMode
)
{
private
saveState
():
void
{
if
(
this
.
zenMode
.
active
)
{
this
.
storageService
.
store
(
Workbench
.
zenModeActiveStorageKey
,
true
,
StorageScope
.
WORKSPACE
);
}
else
{
if
(
this
.
zenMode
.
active
)
{
this
.
toggleZenMode
(
true
);
}
this
.
storageService
.
remove
(
Workbench
.
zenModeActiveStorageKey
,
StorageScope
.
WORKSPACE
);
}
}
...
...
src/vs/workbench/services/history/electron-browser/history.ts
浏览文件 @
b782c3a6
...
...
@@ -175,7 +175,7 @@ export class HistoryService extends Disposable implements IHistoryService {
this
.
_register
(
this
.
editorService
.
onDidActiveEditorChange
(()
=>
this
.
onActiveEditorChanged
()));
this
.
_register
(
this
.
editorService
.
onDidOpenEditorFail
(
event
=>
this
.
remove
(
event
.
editor
)));
this
.
_register
(
this
.
editorService
.
onDidCloseEditor
(
event
=>
this
.
onEditorClosed
(
event
)));
this
.
_register
(
this
.
storageService
.
onWillSaveState
(
reason
=>
this
.
saveState
()));
this
.
_register
(
this
.
storageService
.
onWillSaveState
(
()
=>
this
.
saveState
()));
this
.
_register
(
this
.
fileService
.
onFileChanges
(
event
=>
this
.
onFileChanges
(
event
)));
this
.
_register
(
this
.
resourceFilter
.
onExpressionChange
(()
=>
this
.
handleExcludesChange
()));
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录