Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
91771ceb
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,体验更适合开发者的 AI 搜索 >>
提交
91771ceb
编写于
11月 24, 2017
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
storage2 => state
上级
63efefc7
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
44 addition
and
44 deletion
+44
-44
src/vs/code/electron-main/app.ts
src/vs/code/electron-main/app.ts
+8
-8
src/vs/code/electron-main/keyboard.ts
src/vs/code/electron-main/keyboard.ts
+4
-4
src/vs/code/electron-main/main.ts
src/vs/code/electron-main/main.ts
+3
-3
src/vs/code/electron-main/window.ts
src/vs/code/electron-main/window.ts
+4
-4
src/vs/code/electron-main/windows.ts
src/vs/code/electron-main/windows.ts
+8
-8
src/vs/platform/history/electron-main/historyMainService.ts
src/vs/platform/history/electron-main/historyMainService.ts
+4
-4
src/vs/platform/lifecycle/electron-main/lifecycleMain.ts
src/vs/platform/lifecycle/electron-main/lifecycleMain.ts
+6
-6
src/vs/platform/state/common/state.ts
src/vs/platform/state/common/state.ts
+2
-2
src/vs/platform/state/node/stateService.ts
src/vs/platform/state/node/stateService.ts
+2
-2
src/vs/platform/state/test/node/state.test.ts
src/vs/platform/state/test/node/state.test.ts
+3
-3
未找到文件。
src/vs/code/electron-main/app.ts
浏览文件 @
91771ceb
...
...
@@ -26,7 +26,7 @@ import { IInstantiationService, ServicesAccessor } from 'vs/platform/instantiati
import
{
ServiceCollection
}
from
'
vs/platform/instantiation/common/serviceCollection
'
;
import
{
SyncDescriptor
}
from
'
vs/platform/instantiation/common/descriptors
'
;
import
{
ILogService
}
from
'
vs/platform/log/common/log
'
;
import
{
ISt
orageMainService
}
from
'
vs/platform/storage2/common/storag
e
'
;
import
{
ISt
ateService
}
from
'
vs/platform/state/common/stat
e
'
;
import
{
IEnvironmentService
}
from
'
vs/platform/environment/common/environment
'
;
import
{
IConfigurationService
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
IURLService
}
from
'
vs/platform/url/common/url
'
;
...
...
@@ -76,7 +76,7 @@ export class CodeApplication {
@
IEnvironmentService
private
environmentService
:
IEnvironmentService
,
@
ILifecycleService
private
lifecycleService
:
ILifecycleService
,
@
IConfigurationService
configurationService
:
ConfigurationService
,
@
ISt
orageMainService
private
storageMainService
:
IStorageMain
Service
,
@
ISt
ateService
private
stateService
:
IState
Service
,
@
IHistoryMainService
private
historyMainService
:
IHistoryMainService
)
{
this
.
toDispose
=
[
mainIpcServer
,
configurationService
];
...
...
@@ -235,8 +235,8 @@ export class CodeApplication {
if
(
event
===
'
vscode:changeColorTheme
'
&&
typeof
payload
===
'
string
'
)
{
let
data
=
JSON
.
parse
(
payload
);
this
.
st
orageMain
Service
.
setItem
(
CodeWindow
.
themeStorageKey
,
data
.
id
);
this
.
st
orageMain
Service
.
setItem
(
CodeWindow
.
themeBackgroundStorageKey
,
data
.
background
);
this
.
st
ate
Service
.
setItem
(
CodeWindow
.
themeStorageKey
,
data
.
id
);
this
.
st
ate
Service
.
setItem
(
CodeWindow
.
themeBackgroundStorageKey
,
data
.
background
);
}
}
...
...
@@ -282,7 +282,7 @@ export class CodeApplication {
}
private
resolveMachineId
():
TPromise
<
string
>
{
const
machineId
=
this
.
st
orageMain
Service
.
getItem
<
string
>
(
CodeApplication
.
MACHINE_ID_KEY
);
const
machineId
=
this
.
st
ate
Service
.
getItem
<
string
>
(
CodeApplication
.
MACHINE_ID_KEY
);
if
(
machineId
)
{
return
TPromise
.
wrap
(
machineId
);
}
...
...
@@ -290,7 +290,7 @@ export class CodeApplication {
return
getMachineId
().
then
(
machineId
=>
{
// Remember in global storage
this
.
st
orageMain
Service
.
setItem
(
CodeApplication
.
MACHINE_ID_KEY
,
machineId
);
this
.
st
ate
Service
.
setItem
(
CodeApplication
.
MACHINE_ID_KEY
,
machineId
);
return
machineId
;
});
...
...
@@ -427,8 +427,8 @@ export class CodeApplication {
// Helps application icon refresh after an update with new icon is installed (macOS)
// TODO@Ben remove after a couple of releases
if
(
platform
.
isMacintosh
)
{
if
(
!
this
.
st
orageMain
Service
.
getItem
(
CodeApplication
.
APP_ICON_REFRESH_KEY
))
{
this
.
st
orageMain
Service
.
setItem
(
CodeApplication
.
APP_ICON_REFRESH_KEY
,
true
);
if
(
!
this
.
st
ate
Service
.
getItem
(
CodeApplication
.
APP_ICON_REFRESH_KEY
))
{
this
.
st
ate
Service
.
setItem
(
CodeApplication
.
APP_ICON_REFRESH_KEY
,
true
);
// 'exe' => /Applications/Visual Studio Code - Insiders.app/Contents/MacOS/Electron
const
appPath
=
dirname
(
dirname
(
dirname
(
app
.
getPath
(
'
exe
'
))));
...
...
src/vs/code/electron-main/keyboard.ts
浏览文件 @
91771ceb
...
...
@@ -7,7 +7,7 @@
import
*
as
nativeKeymap
from
'
native-keymap
'
;
import
{
IDisposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
ISt
orageMainService
}
from
'
vs/platform/storage2/common/storag
e
'
;
import
{
ISt
ateService
}
from
'
vs/platform/state/common/stat
e
'
;
import
Event
,
{
Emitter
,
once
}
from
'
vs/base/common/event
'
;
import
{
ConfigWatcher
}
from
'
vs/base/node/config
'
;
import
{
IUserFriendlyKeybinding
}
from
'
vs/platform/keybinding/common/keybinding
'
;
...
...
@@ -58,13 +58,13 @@ export class KeybindingsResolver {
onKeybindingsChanged
:
Event
<
void
>
=
this
.
_onKeybindingsChanged
.
event
;
constructor
(
@
ISt
orageMainService
private
storageMainService
:
IStorageMain
Service
,
@
ISt
ateService
private
stateService
:
IState
Service
,
@
IEnvironmentService
environmentService
:
IEnvironmentService
,
@
IWindowsMainService
private
windowsMainService
:
IWindowsMainService
,
@
ILogService
private
logService
:
ILogService
)
{
this
.
commandIds
=
new
Set
<
string
>
();
this
.
keybindings
=
this
.
st
orageMain
Service
.
getItem
<
{
[
id
:
string
]:
string
;
}
>
(
KeybindingsResolver
.
lastKnownKeybindingsMapStorageKey
)
||
Object
.
create
(
null
);
this
.
keybindings
=
this
.
st
ate
Service
.
getItem
<
{
[
id
:
string
]:
string
;
}
>
(
KeybindingsResolver
.
lastKnownKeybindingsMapStorageKey
)
||
Object
.
create
(
null
);
this
.
keybindingsWatcher
=
new
ConfigWatcher
<
IUserFriendlyKeybinding
[]
>
(
environmentService
.
appKeybindingsPath
,
{
changeBufferDelay
:
100
,
onError
:
error
=>
this
.
logService
.
error
(
error
)
});
this
.
registerListeners
();
...
...
@@ -102,7 +102,7 @@ export class KeybindingsResolver {
if
(
keybindingsChanged
)
{
this
.
keybindings
=
resolvedKeybindings
;
this
.
st
orageMain
Service
.
setItem
(
KeybindingsResolver
.
lastKnownKeybindingsMapStorageKey
,
this
.
keybindings
);
// keep to restore instantly after restart
this
.
st
ate
Service
.
setItem
(
KeybindingsResolver
.
lastKnownKeybindingsMapStorageKey
,
this
.
keybindings
);
// keep to restore instantly after restart
this
.
_onKeybindingsChanged
.
fire
();
}
...
...
src/vs/code/electron-main/main.ts
浏览文件 @
91771ceb
...
...
@@ -21,8 +21,8 @@ import { InstantiationService } from 'vs/platform/instantiation/common/instantia
import
{
ServiceCollection
}
from
'
vs/platform/instantiation/common/serviceCollection
'
;
import
{
SyncDescriptor
}
from
'
vs/platform/instantiation/common/descriptors
'
;
import
{
ILogService
,
LogMainService
}
from
'
vs/platform/log/common/log
'
;
import
{
St
orageMainService
}
from
'
vs/platform/storage2/node/storageMain
Service
'
;
import
{
ISt
orageMainService
}
from
'
vs/platform/storage2/common/storag
e
'
;
import
{
St
ateService
}
from
'
vs/platform/state/node/state
Service
'
;
import
{
ISt
ateService
}
from
'
vs/platform/state/common/stat
e
'
;
import
{
IBackupMainService
}
from
'
vs/platform/backup/common/backup
'
;
import
{
BackupMainService
}
from
'
vs/platform/backup/electron-main/backupMainService
'
;
import
{
IEnvironmentService
,
ParsedArgs
}
from
'
vs/platform/environment/common/environment
'
;
...
...
@@ -50,7 +50,7 @@ function createServices(args: ParsedArgs): IInstantiationService {
services
.
set
(
IWorkspacesMainService
,
new
SyncDescriptor
(
WorkspacesMainService
));
services
.
set
(
IHistoryMainService
,
new
SyncDescriptor
(
HistoryMainService
));
services
.
set
(
ILifecycleService
,
new
SyncDescriptor
(
LifecycleService
));
services
.
set
(
ISt
orageMainService
,
new
SyncDescriptor
(
StorageMain
Service
));
services
.
set
(
ISt
ateService
,
new
SyncDescriptor
(
State
Service
));
services
.
set
(
IConfigurationService
,
new
SyncDescriptor
(
ConfigurationService
));
services
.
set
(
IRequestService
,
new
SyncDescriptor
(
RequestService
));
services
.
set
(
IURLService
,
new
SyncDescriptor
(
URLService
,
args
[
'
open-url
'
]));
...
...
src/vs/code/electron-main/window.ts
浏览文件 @
91771ceb
...
...
@@ -9,7 +9,7 @@ import * as path from 'path';
import
*
as
objects
from
'
vs/base/common/objects
'
;
import
nls
=
require
(
'
vs/nls
'
);
import
URI
from
'
vs/base/common/uri
'
;
import
{
ISt
orageMainService
}
from
'
vs/platform/storage2/common/storag
e
'
;
import
{
ISt
ateService
}
from
'
vs/platform/state/common/stat
e
'
;
import
{
shell
,
screen
,
BrowserWindow
,
systemPreferences
,
app
,
TouchBar
,
nativeImage
}
from
'
electron
'
;
import
{
TPromise
,
TValueCallback
}
from
'
vs/base/common/winjs.base
'
;
import
{
IEnvironmentService
,
ParsedArgs
}
from
'
vs/platform/environment/common/environment
'
;
...
...
@@ -104,7 +104,7 @@ export class CodeWindow implements ICodeWindow {
@
ILogService
private
logService
:
ILogService
,
@
IEnvironmentService
private
environmentService
:
IEnvironmentService
,
@
IConfigurationService
private
configurationService
:
IConfigurationService
,
@
ISt
orageMainService
private
storageMainService
:
IStorageMain
Service
,
@
ISt
ateService
private
stateService
:
IState
Service
,
@
IWorkspacesMainService
private
workspacesMainService
:
IWorkspacesMainService
,
@
IBackupMainService
private
backupMainService
:
IBackupMainService
)
{
...
...
@@ -595,7 +595,7 @@ export class CodeWindow implements ICodeWindow {
return
'
hc-black
'
;
}
const
theme
=
this
.
st
orageMain
Service
.
getItem
<
string
>
(
CodeWindow
.
themeStorageKey
,
'
vs-dark
'
);
const
theme
=
this
.
st
ate
Service
.
getItem
<
string
>
(
CodeWindow
.
themeStorageKey
,
'
vs-dark
'
);
return
theme
.
split
(
'
'
)[
0
];
}
...
...
@@ -605,7 +605,7 @@ export class CodeWindow implements ICodeWindow {
return
CodeWindow
.
DEFAULT_BG_HC_BLACK
;
}
const
background
=
this
.
st
orageMain
Service
.
getItem
<
string
>
(
CodeWindow
.
themeBackgroundStorageKey
,
null
);
const
background
=
this
.
st
ate
Service
.
getItem
<
string
>
(
CodeWindow
.
themeBackgroundStorageKey
,
null
);
if
(
!
background
)
{
const
baseTheme
=
this
.
getBaseTheme
();
...
...
src/vs/code/electron-main/windows.ts
浏览文件 @
91771ceb
...
...
@@ -12,7 +12,7 @@ import * as arrays from 'vs/base/common/arrays';
import
{
assign
,
mixin
,
equals
}
from
'
vs/base/common/objects
'
;
import
{
IBackupMainService
}
from
'
vs/platform/backup/common/backup
'
;
import
{
IEnvironmentService
,
ParsedArgs
}
from
'
vs/platform/environment/common/environment
'
;
import
{
ISt
orageMainService
}
from
'
vs/platform/storage2/common/storag
e
'
;
import
{
ISt
ateService
}
from
'
vs/platform/state/common/stat
e
'
;
import
{
CodeWindow
,
IWindowState
as
ISingleWindowState
,
defaultWindowState
,
WindowMode
}
from
'
vs/code/electron-main/window
'
;
import
{
ipcMain
as
ipc
,
screen
,
BrowserWindow
,
dialog
,
systemPreferences
,
app
}
from
'
electron
'
;
import
{
IPathWithLineAndColumn
,
parseLineAndColumnAware
}
from
'
vs/code/node/paths
'
;
...
...
@@ -140,7 +140,7 @@ export class WindowsManager implements IWindowsMainService {
constructor
(
private
readonly
machineId
:
string
,
@
ILogService
private
logService
:
ILogService
,
@
ISt
orageMainService
private
storageMainService
:
IStorageMain
Service
,
@
ISt
ateService
private
stateService
:
IState
Service
,
@
IEnvironmentService
private
environmentService
:
IEnvironmentService
,
@
ILifecycleService
private
lifecycleService
:
ILifecycleService
,
@
IBackupMainService
private
backupMainService
:
IBackupMainService
,
...
...
@@ -150,9 +150,9 @@ export class WindowsManager implements IWindowsMainService {
@
IWorkspacesMainService
private
workspacesMainService
:
IWorkspacesMainService
,
@
IInstantiationService
private
instantiationService
:
IInstantiationService
)
{
this
.
windowsState
=
this
.
st
orageMain
Service
.
getItem
<
IWindowsState
>
(
WindowsManager
.
windowsStateStorageKey
)
||
{
openedWindows
:
[]
};
this
.
windowsState
=
this
.
st
ate
Service
.
getItem
<
IWindowsState
>
(
WindowsManager
.
windowsStateStorageKey
)
||
{
openedWindows
:
[]
};
this
.
fileDialog
=
new
FileDialog
(
environmentService
,
telemetryService
,
st
orageMain
Service
,
this
);
this
.
fileDialog
=
new
FileDialog
(
environmentService
,
telemetryService
,
st
ate
Service
,
this
);
this
.
workspacesManager
=
new
WorkspacesManager
(
workspacesMainService
,
backupMainService
,
environmentService
,
this
);
this
.
migrateLegacyWindowState
();
...
...
@@ -311,7 +311,7 @@ export class WindowsManager implements IWindowsMainService {
}
// Persist
this
.
st
orageMain
Service
.
setItem
(
WindowsManager
.
windowsStateStorageKey
,
currentWindowsState
);
this
.
st
ate
Service
.
setItem
(
WindowsManager
.
windowsStateStorageKey
,
currentWindowsState
);
}
// See note on #onBeforeQuit() for details how these events are flowing
...
...
@@ -1589,7 +1589,7 @@ class FileDialog {
constructor
(
private
environmentService
:
IEnvironmentService
,
private
telemetryService
:
ITelemetryService
,
private
st
orageMainService
:
IStorageMain
Service
,
private
st
ateService
:
IState
Service
,
private
windowsMainService
:
IWindowsMainService
)
{
}
...
...
@@ -1630,7 +1630,7 @@ class FileDialog {
// Ensure defaultPath
if
(
!
options
.
dialogOptions
.
defaultPath
)
{
options
.
dialogOptions
.
defaultPath
=
this
.
st
orageMain
Service
.
getItem
<
string
>
(
FileDialog
.
workingDirPickerStorageKey
);
options
.
dialogOptions
.
defaultPath
=
this
.
st
ate
Service
.
getItem
<
string
>
(
FileDialog
.
workingDirPickerStorageKey
);
}
// Ensure properties
...
...
@@ -1659,7 +1659,7 @@ class FileDialog {
}
// Remember path in storage for next time
this
.
st
orageMain
Service
.
setItem
(
FileDialog
.
workingDirPickerStorageKey
,
dirname
(
paths
[
0
]));
this
.
st
ate
Service
.
setItem
(
FileDialog
.
workingDirPickerStorageKey
,
dirname
(
paths
[
0
]));
// Return
return
clb
(
paths
);
...
...
src/vs/platform/history/electron-main/historyMainService.ts
浏览文件 @
91771ceb
...
...
@@ -9,7 +9,7 @@ import * as path from 'path';
import
*
as
nls
from
'
vs/nls
'
;
import
*
as
arrays
from
'
vs/base/common/arrays
'
;
import
{
trim
}
from
'
vs/base/common/strings
'
;
import
{
ISt
orageMainService
}
from
'
vs/platform/storage2/common/storag
e
'
;
import
{
ISt
ateService
}
from
'
vs/platform/state/common/stat
e
'
;
import
{
app
}
from
'
electron
'
;
import
{
ILogService
}
from
'
vs/platform/log/common/log
'
;
import
{
getPathLabel
,
getBaseLabel
}
from
'
vs/base/common/labels
'
;
...
...
@@ -41,7 +41,7 @@ export class HistoryMainService implements IHistoryMainService {
private
macOSRecentDocumentsUpdater
:
RunOnceScheduler
;
constructor
(
@
ISt
orageMainService
private
storageMainService
:
IStorageMain
Service
,
@
ISt
ateService
private
stateService
:
IState
Service
,
@
ILogService
private
logService
:
ILogService
,
@
IWorkspacesMainService
private
workspacesMainService
:
IWorkspacesMainService
,
@
IEnvironmentService
private
environmentService
:
IEnvironmentService
,
...
...
@@ -179,7 +179,7 @@ export class HistoryMainService implements IHistoryMainService {
let
files
:
string
[];
// Get from storage
const
storedRecents
=
this
.
st
orageMain
Service
.
getItem
<
IRecentlyOpened
>
(
HistoryMainService
.
recentlyOpenedStorageKey
)
as
ILegacyRecentlyOpened
;
const
storedRecents
=
this
.
st
ate
Service
.
getItem
<
IRecentlyOpened
>
(
HistoryMainService
.
recentlyOpenedStorageKey
)
as
ILegacyRecentlyOpened
;
if
(
storedRecents
)
{
workspaces
=
storedRecents
.
workspaces
||
storedRecents
.
folders
||
[];
files
=
storedRecents
.
files
||
[];
...
...
@@ -217,7 +217,7 @@ export class HistoryMainService implements IHistoryMainService {
}
private
saveRecentlyOpened
(
recent
:
IRecentlyOpened
):
void
{
this
.
st
orageMain
Service
.
setItem
(
HistoryMainService
.
recentlyOpenedStorageKey
,
recent
);
this
.
st
ate
Service
.
setItem
(
HistoryMainService
.
recentlyOpenedStorageKey
,
recent
);
}
public
updateWindowsJumpList
():
void
{
...
...
src/vs/platform/lifecycle/electron-main/lifecycleMain.ts
浏览文件 @
91771ceb
...
...
@@ -8,7 +8,7 @@
import
{
ipcMain
as
ipc
,
app
}
from
'
electron
'
;
import
{
TPromise
,
TValueCallback
}
from
'
vs/base/common/winjs.base
'
;
import
{
ILogService
}
from
'
vs/platform/log/common/log
'
;
import
{
ISt
orageMainService
}
from
'
vs/platform/storage2/common/storag
e
'
;
import
{
ISt
ateService
}
from
'
vs/platform/state/common/stat
e
'
;
import
Event
,
{
Emitter
}
from
'
vs/base/common/event
'
;
import
{
createDecorator
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
ICodeWindow
}
from
'
vs/platform/windows/electron-main/windows
'
;
...
...
@@ -94,7 +94,7 @@ export class LifecycleService implements ILifecycleService {
constructor
(
@
ILogService
private
logService
:
ILogService
,
@
ISt
orageMainService
private
storageMainService
:
IStorageMain
Service
@
ISt
ateService
private
stateService
:
IState
Service
)
{
this
.
windowToCloseRequest
=
Object
.
create
(
null
);
this
.
quitRequested
=
false
;
...
...
@@ -105,10 +105,10 @@ export class LifecycleService implements ILifecycleService {
}
private
handleRestarted
():
void
{
this
.
_wasRestarted
=
!!
this
.
st
orageMain
Service
.
getItem
(
LifecycleService
.
QUIT_FROM_RESTART_MARKER
);
this
.
_wasRestarted
=
!!
this
.
st
ate
Service
.
getItem
(
LifecycleService
.
QUIT_FROM_RESTART_MARKER
);
if
(
this
.
_wasRestarted
)
{
this
.
st
orageMain
Service
.
removeItem
(
LifecycleService
.
QUIT_FROM_RESTART_MARKER
);
// remove the marker right after if found
this
.
st
ate
Service
.
removeItem
(
LifecycleService
.
QUIT_FROM_RESTART_MARKER
);
// remove the marker right after if found
}
}
...
...
@@ -258,7 +258,7 @@ export class LifecycleService implements ILifecycleService {
app
.
once
(
'
will-quit
'
,
()
=>
{
if
(
this
.
pendingQuitPromiseComplete
)
{
if
(
fromUpdate
)
{
this
.
st
orageMain
Service
.
setItem
(
LifecycleService
.
QUIT_FROM_RESTART_MARKER
,
true
);
this
.
st
ate
Service
.
setItem
(
LifecycleService
.
QUIT_FROM_RESTART_MARKER
,
true
);
}
this
.
pendingQuitPromiseComplete
(
false
/* no veto */
);
...
...
@@ -296,7 +296,7 @@ export class LifecycleService implements ILifecycleService {
let
vetoed
=
false
;
app
.
once
(
'
quit
'
,
()
=>
{
if
(
!
vetoed
)
{
this
.
st
orageMain
Service
.
setItem
(
LifecycleService
.
QUIT_FROM_RESTART_MARKER
,
true
);
this
.
st
ate
Service
.
setItem
(
LifecycleService
.
QUIT_FROM_RESTART_MARKER
,
true
);
app
.
relaunch
({
args
});
}
});
...
...
src/vs/platform/st
orage2/common/storag
e.ts
→
src/vs/platform/st
ate/common/stat
e.ts
浏览文件 @
91771ceb
...
...
@@ -7,9 +7,9 @@
import
{
createDecorator
}
from
'
vs/platform/instantiation/common/instantiation
'
;
export
const
ISt
orageMainService
=
createDecorator
<
IStorageMainService
>
(
'
storageMain
Service
'
);
export
const
ISt
ateService
=
createDecorator
<
IStateService
>
(
'
state
Service
'
);
export
interface
ISt
orageMain
Service
{
export
interface
ISt
ate
Service
{
_serviceBrand
:
any
;
getItem
<
T
>
(
key
:
string
,
defaultValue
?:
T
):
T
;
...
...
src/vs/platform/st
orage2/node/storageMain
Service.ts
→
src/vs/platform/st
ate/node/state
Service.ts
浏览文件 @
91771ceb
...
...
@@ -10,7 +10,7 @@ import * as fs from 'original-fs';
import
{
IEnvironmentService
}
from
'
vs/platform/environment/common/environment
'
;
import
{
writeFileAndFlushSync
}
from
'
vs/base/node/extfs
'
;
import
{
isUndefined
,
isUndefinedOrNull
}
from
'
vs/base/common/types
'
;
import
{
ISt
orageMainService
}
from
'
vs/platform/storage2/common/storag
e
'
;
import
{
ISt
ateService
}
from
'
vs/platform/state/common/stat
e
'
;
export
class
FileStorage
{
...
...
@@ -87,7 +87,7 @@ export class FileStorage {
}
}
export
class
St
orageMainService
implements
IStorageMain
Service
{
export
class
St
ateService
implements
IState
Service
{
_serviceBrand
:
any
;
...
...
src/vs/platform/st
orage2/test/node/storag
e.test.ts
→
src/vs/platform/st
ate/test/node/stat
e.test.ts
浏览文件 @
91771ceb
...
...
@@ -11,10 +11,10 @@ import path = require('path');
import
extfs
=
require
(
'
vs/base/node/extfs
'
);
import
{
getRandomTestPath
}
from
'
vs/workbench/test/workbenchTestServices
'
;
import
{
writeFileAndFlushSync
,
mkdirp
}
from
'
vs/base/node/extfs
'
;
import
{
FileStorage
}
from
'
vs/platform/st
orage2/node/storageMain
Service
'
;
import
{
FileStorage
}
from
'
vs/platform/st
ate/node/state
Service
'
;
suite
(
'
St
orageMain
Service
'
,
()
=>
{
const
parentDir
=
getRandomTestPath
(
os
.
tmpdir
(),
'
vsctests
'
,
'
st
orag
eservice
'
);
suite
(
'
St
ate
Service
'
,
()
=>
{
const
parentDir
=
getRandomTestPath
(
os
.
tmpdir
(),
'
vsctests
'
,
'
st
at
eservice
'
);
const
storageFile
=
path
.
join
(
parentDir
,
'
storage.json
'
);
teardown
(
done
=>
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录