Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
a97e98b1
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,发现更多精彩内容 >>
提交
a97e98b1
编写于
10月 09, 2018
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
💄
上级
f6f37aa3
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
64 addition
and
49 deletion
+64
-49
src/vs/base/node/storage.ts
src/vs/base/node/storage.ts
+1
-1
src/vs/platform/lifecycle/common/lifecycle.ts
src/vs/platform/lifecycle/common/lifecycle.ts
+5
-5
src/vs/platform/lifecycle/electron-browser/lifecycleService.ts
...s/platform/lifecycle/electron-browser/lifecycleService.ts
+6
-6
src/vs/platform/lifecycle/electron-main/lifecycleMain.ts
src/vs/platform/lifecycle/electron-main/lifecycleMain.ts
+15
-3
src/vs/platform/storage2/common/storage2.ts
src/vs/platform/storage2/common/storage2.ts
+10
-10
src/vs/platform/storage2/node/nextStorageService.ts
src/vs/platform/storage2/node/nextStorageService.ts
+2
-2
src/vs/platform/storage2/node/nextWorkspaceStorageService.ts
src/vs/platform/storage2/node/nextWorkspaceStorageService.ts
+15
-12
src/vs/platform/storage2/test/node/nextStorageService.test.ts
...vs/platform/storage2/test/node/nextStorageService.test.ts
+7
-7
src/vs/workbench/electron-browser/main.ts
src/vs/workbench/electron-browser/main.ts
+3
-3
未找到文件。
src/vs/base/node/storage.ts
浏览文件 @
a97e98b1
...
@@ -213,7 +213,7 @@ class SQLiteStorageLogger {
...
@@ -213,7 +213,7 @@ class SQLiteStorageLogger {
private
logError
:
boolean
;
private
logError
:
boolean
;
constructor
(
private
options
?:
ISQLiteStorageLoggingOptions
)
{
constructor
(
private
options
?:
ISQLiteStorageLoggingOptions
)
{
this
.
logInfo
=
this
.
verbose
&&
!!
options
.
infoLogger
;
this
.
logInfo
=
this
.
verbose
&&
options
&&
!!
options
.
infoLogger
;
this
.
logError
=
options
&&
!!
options
.
errorLogger
;
this
.
logError
=
options
&&
!!
options
.
errorLogger
;
}
}
...
...
src/vs/platform/lifecycle/common/lifecycle.ts
浏览文件 @
a97e98b1
...
@@ -16,7 +16,7 @@ export const ILifecycleService = createDecorator<ILifecycleService>('lifecycleSe
...
@@ -16,7 +16,7 @@ export const ILifecycleService = createDecorator<ILifecycleService>('lifecycleSe
* resolves to a boolean. Returning a promise is useful in cases of long running operations
* resolves to a boolean. Returning a promise is useful in cases of long running operations
* on shutdown.
* on shutdown.
*
*
* Note: It is absolutely important to avoid long running promises
on this call
. Please try hard
* Note: It is absolutely important to avoid long running promises
if possible
. Please try hard
* to return a boolean directly. Returning a promise has quite an impact on the shutdown sequence!
* to return a boolean directly. Returning a promise has quite an impact on the shutdown sequence!
*/
*/
export
interface
WillShutdownEvent
{
export
interface
WillShutdownEvent
{
...
@@ -38,7 +38,7 @@ export interface WillShutdownEvent {
...
@@ -38,7 +38,7 @@ export interface WillShutdownEvent {
* by providing a promise from the join method. Returning a promise is useful in cases of long
* by providing a promise from the join method. Returning a promise is useful in cases of long
* running operations on shutdown.
* running operations on shutdown.
*
*
* Note: It is absolutely important to avoid long running promises
on this call
. Please try hard
* Note: It is absolutely important to avoid long running promises
if possible
. Please try hard
* to return a boolean directly. Returning a promise has quite an impact on the shutdown sequence!
* to return a boolean directly. Returning a promise has quite an impact on the shutdown sequence!
*/
*/
export
interface
ShutdownEvent
{
export
interface
ShutdownEvent
{
...
@@ -141,11 +141,11 @@ export interface ILifecycleService {
...
@@ -141,11 +141,11 @@ export interface ILifecycleService {
export
const
NullLifecycleService
:
ILifecycleService
=
{
export
const
NullLifecycleService
:
ILifecycleService
=
{
_serviceBrand
:
null
,
_serviceBrand
:
null
,
onWillShutdown
:
Event
.
None
,
onShutdown
:
Event
.
None
,
phase
:
LifecyclePhase
.
Running
,
phase
:
LifecyclePhase
.
Running
,
when
()
{
return
Promise
.
resolve
();
},
startupKind
:
StartupKind
.
NewWindow
,
startupKind
:
StartupKind
.
NewWindow
,
onWillShutdown
:
Event
.
None
,
when
()
{
return
Promise
.
resolve
();
}
onShutdown
:
Event
.
None
};
};
// Shared veto handling across main and renderer
// Shared veto handling across main and renderer
...
...
src/vs/platform/lifecycle/electron-browser/lifecycleService.ts
浏览文件 @
a97e98b1
...
@@ -35,7 +35,7 @@ export class LifecycleService extends Disposable implements ILifecycleService {
...
@@ -35,7 +35,7 @@ export class LifecycleService extends Disposable implements ILifecycleService {
private
_phase
:
LifecyclePhase
=
LifecyclePhase
.
Starting
;
private
_phase
:
LifecyclePhase
=
LifecyclePhase
.
Starting
;
get
phase
():
LifecyclePhase
{
return
this
.
_phase
;
}
get
phase
():
LifecyclePhase
{
return
this
.
_phase
;
}
private
_
phaseWhen
=
new
Map
<
LifecyclePhase
,
Barrier
>
();
private
phaseWhen
=
new
Map
<
LifecyclePhase
,
Barrier
>
();
constructor
(
constructor
(
@
INotificationService
private
notificationService
:
INotificationService
,
@
INotificationService
private
notificationService
:
INotificationService
,
...
@@ -150,9 +150,9 @@ export class LifecycleService extends Disposable implements ILifecycleService {
...
@@ -150,9 +150,9 @@ export class LifecycleService extends Disposable implements ILifecycleService {
this
.
_phase
=
value
;
this
.
_phase
=
value
;
mark
(
`LifecyclePhase/
${
LifecyclePhaseToString
(
value
)}
`
);
mark
(
`LifecyclePhase/
${
LifecyclePhaseToString
(
value
)}
`
);
if
(
this
.
_
phaseWhen
.
has
(
this
.
_phase
))
{
if
(
this
.
phaseWhen
.
has
(
this
.
_phase
))
{
this
.
_
phaseWhen
.
get
(
this
.
_phase
).
open
();
this
.
phaseWhen
.
get
(
this
.
_phase
).
open
();
this
.
_
phaseWhen
.
delete
(
this
.
_phase
);
this
.
phaseWhen
.
delete
(
this
.
_phase
);
}
}
}
}
...
@@ -161,10 +161,10 @@ export class LifecycleService extends Disposable implements ILifecycleService {
...
@@ -161,10 +161,10 @@ export class LifecycleService extends Disposable implements ILifecycleService {
return
Promise
.
resolve
();
return
Promise
.
resolve
();
}
}
let
barrier
=
this
.
_
phaseWhen
.
get
(
phase
);
let
barrier
=
this
.
phaseWhen
.
get
(
phase
);
if
(
!
barrier
)
{
if
(
!
barrier
)
{
barrier
=
new
Barrier
();
barrier
=
new
Barrier
();
this
.
_
phaseWhen
.
set
(
phase
,
barrier
);
this
.
phaseWhen
.
set
(
phase
,
barrier
);
}
}
return
barrier
.
wait
();
return
barrier
.
wait
();
...
...
src/vs/platform/lifecycle/electron-main/lifecycleMain.ts
浏览文件 @
a97e98b1
...
@@ -69,16 +69,28 @@ export interface ILifecycleService {
...
@@ -69,16 +69,28 @@ export interface ILifecycleService {
*/
*/
onBeforeWindowUnload
:
Event
<
IWindowUnloadEvent
>
;
onBeforeWindowUnload
:
Event
<
IWindowUnloadEvent
>
;
ready
():
void
;
/**
registerWindow
(
window
:
ICodeWindow
):
void
;
* Close a window for the provided reason. Shutdown handlers are triggered.
*/
unload
(
window
:
ICodeWindow
,
reason
:
UnloadReason
):
TPromise
<
boolean
/* veto */
>
;
unload
(
window
:
ICodeWindow
,
reason
:
UnloadReason
):
TPromise
<
boolean
/* veto */
>
;
/**
* Restart the application with optional arguments (CLI). Shutdown handlers are triggered.
*/
relaunch
(
options
?:
{
addArgs
?:
string
[],
removeArgs
?:
string
[]
}):
void
;
relaunch
(
options
?:
{
addArgs
?:
string
[],
removeArgs
?:
string
[]
}):
void
;
/**
* Shutdown the application normally. Shutdown handlers are triggered.
*/
quit
(
fromUpdate
?:
boolean
):
TPromise
<
boolean
/* veto */
>
;
quit
(
fromUpdate
?:
boolean
):
TPromise
<
boolean
/* veto */
>
;
/**
* Forcefully shutdown the application. No shutdown handlers are triggered.
*/
kill
(
code
?:
number
):
void
;
kill
(
code
?:
number
):
void
;
ready
():
void
;
registerWindow
(
window
:
ICodeWindow
):
void
;
}
}
export
class
LifecycleService
extends
Disposable
implements
ILifecycleService
{
export
class
LifecycleService
extends
Disposable
implements
ILifecycleService
{
...
...
src/vs/platform/storage2/common/storage2.ts
浏览文件 @
a97e98b1
...
@@ -62,47 +62,47 @@ export interface INextWorkspaceStorageService {
...
@@ -62,47 +62,47 @@ export interface INextWorkspaceStorageService {
* Retrieve an element stored with the given key from storage. Use
* Retrieve an element stored with the given key from storage. Use
* the provided defaultValue if the element is null or undefined.
* the provided defaultValue if the element is null or undefined.
*
*
* The
optional
scope argument allows to define the scope of the storage
* The scope argument allows to define the scope of the storage
* operation to either the current workspace only or all workspaces.
* operation to either the current workspace only or all workspaces.
*/
*/
get
(
key
:
string
,
scope
?
:
StorageScope
,
fallbackValue
?:
string
):
string
;
get
(
key
:
string
,
scope
:
StorageScope
,
fallbackValue
?:
string
):
string
;
/**
/**
* Retrieve an element stored with the given key from storage. Use
* Retrieve an element stored with the given key from storage. Use
* the provided defaultValue if the element is null or undefined. The element
* the provided defaultValue if the element is null or undefined. The element
* will be converted to a boolean.
* will be converted to a boolean.
*
*
* The
optional
scope argument allows to define the scope of the storage
* The scope argument allows to define the scope of the storage
* operation to either the current workspace only or all workspaces.
* operation to either the current workspace only or all workspaces.
*/
*/
getBoolean
(
key
:
string
,
scope
?
:
StorageScope
,
fallbackValue
?:
boolean
):
boolean
;
getBoolean
(
key
:
string
,
scope
:
StorageScope
,
fallbackValue
?:
boolean
):
boolean
;
/**
/**
* Retrieve an element stored with the given key from storage. Use
* Retrieve an element stored with the given key from storage. Use
* the provided defaultValue if the element is null or undefined. The element
* the provided defaultValue if the element is null or undefined. The element
* will be converted to a number using parseInt with a base of 10.
* will be converted to a number using parseInt with a base of 10.
*
*
* The
optional
scope argument allows to define the scope of the storage
* The scope argument allows to define the scope of the storage
* operation to either the current workspace only or all workspaces.
* operation to either the current workspace only or all workspaces.
*/
*/
getInteger
(
key
:
string
,
scope
?
:
StorageScope
,
fallbackValue
?:
number
):
number
;
getInteger
(
key
:
string
,
scope
:
StorageScope
,
fallbackValue
?:
number
):
number
;
/**
/**
* Store a string value under the given key to storage. The value will
* Store a string value under the given key to storage. The value will
* be converted to a string.
* be converted to a string.
*
*
* The
optional
scope argument allows to define the scope of the storage
* The scope argument allows to define the scope of the storage
* operation to either the current workspace only or all workspaces.
* operation to either the current workspace only or all workspaces.
*/
*/
set
(
key
:
string
,
value
:
any
,
scope
?
:
StorageScope
):
Promise
<
void
>
;
set
(
key
:
string
,
value
:
any
,
scope
:
StorageScope
):
Promise
<
void
>
;
/**
/**
* Delete an element stored under the provided key from storage.
* Delete an element stored under the provided key from storage.
*
*
* The
optional
scope argument allows to define the scope of the storage
* The scope argument allows to define the scope of the storage
* operation to either the current workspace only or all workspaces.
* operation to either the current workspace only or all workspaces.
*/
*/
delete
(
key
:
string
,
scope
?
:
StorageScope
):
Promise
<
void
>
;
delete
(
key
:
string
,
scope
:
StorageScope
):
Promise
<
void
>
;
}
}
export
const
enum
StorageScope
{
export
const
enum
StorageScope
{
...
...
src/vs/platform/storage2/node/nextStorageService
Impl
.ts
→
src/vs/platform/storage2/node/nextStorageService.ts
浏览文件 @
a97e98b1
...
@@ -18,7 +18,7 @@ enum StorageState {
...
@@ -18,7 +18,7 @@ enum StorageState {
Closed
Closed
}
}
export
class
NextStorageService
Impl
extends
Disposable
implements
INextStorageService
{
export
class
NextStorageService
extends
Disposable
implements
INextStorageService
{
_serviceBrand
:
any
;
_serviceBrand
:
any
;
private
static
readonly
FLUSH_DELAY
=
10
;
private
static
readonly
FLUSH_DELAY
=
10
;
...
@@ -52,7 +52,7 @@ export class NextStorageServiceImpl extends Disposable implements INextStorageSe
...
@@ -52,7 +52,7 @@ export class NextStorageServiceImpl extends Disposable implements INextStorageSe
}
}
});
});
this
.
pendingScheduler
=
new
RunOnceScheduler
(()
=>
this
.
flushPending
(),
NextStorageService
Impl
.
FLUSH_DELAY
);
this
.
pendingScheduler
=
new
RunOnceScheduler
(()
=>
this
.
flushPending
(),
NextStorageService
.
FLUSH_DELAY
);
}
}
init
():
Promise
<
void
>
{
init
():
Promise
<
void
>
{
...
...
src/vs/platform/storage2/node/nextWorkspaceStorageService
Impl
.ts
→
src/vs/platform/storage2/node/nextWorkspaceStorageService.ts
浏览文件 @
a97e98b1
...
@@ -8,16 +8,16 @@ import { Event, Emitter } from 'vs/base/common/event';
...
@@ -8,16 +8,16 @@ import { Event, Emitter } from 'vs/base/common/event';
import
{
ILogService
}
from
'
vs/platform/log/common/log
'
;
import
{
ILogService
}
from
'
vs/platform/log/common/log
'
;
import
{
IEnvironmentService
}
from
'
vs/platform/environment/common/environment
'
;
import
{
IEnvironmentService
}
from
'
vs/platform/environment/common/environment
'
;
import
{
INextStorageService
,
IWorkspaceStorageChangeEvent
,
INextWorkspaceStorageService
,
StorageScope
}
from
'
vs/platform/storage2/common/storage2
'
;
import
{
INextStorageService
,
IWorkspaceStorageChangeEvent
,
INextWorkspaceStorageService
,
StorageScope
}
from
'
vs/platform/storage2/common/storage2
'
;
import
{
NextStorageService
Impl
}
from
'
vs/platform/storage2/node/nextStorageServiceImpl
'
;
import
{
NextStorageService
}
from
'
vs/platform/storage2/node/nextStorageService
'
;
export
class
NextWorkspaceStorageService
Impl
extends
Disposable
implements
INextWorkspaceStorageService
{
export
class
NextWorkspaceStorageService
extends
Disposable
implements
INextWorkspaceStorageService
{
_serviceBrand
:
any
;
_serviceBrand
:
any
;
private
_onDidChangeStorage
:
Emitter
<
IWorkspaceStorageChangeEvent
>
=
this
.
_register
(
new
Emitter
<
IWorkspaceStorageChangeEvent
>
());
private
_onDidChangeStorage
:
Emitter
<
IWorkspaceStorageChangeEvent
>
=
this
.
_register
(
new
Emitter
<
IWorkspaceStorageChangeEvent
>
());
get
onDidChangeStorage
():
Event
<
IWorkspaceStorageChangeEvent
>
{
return
this
.
_onDidChangeStorage
.
event
;
}
get
onDidChangeStorage
():
Event
<
IWorkspaceStorageChangeEvent
>
{
return
this
.
_onDidChangeStorage
.
event
;
}
private
globalStorage
:
NextStorageService
Impl
;
private
globalStorage
:
NextStorageService
;
private
workspaceStorage
:
NextStorageService
Impl
;
private
workspaceStorage
:
NextStorageService
;
constructor
(
constructor
(
workspaceDBPath
:
string
,
workspaceDBPath
:
string
,
...
@@ -26,8 +26,8 @@ export class NextWorkspaceStorageServiceImpl extends Disposable implements INext
...
@@ -26,8 +26,8 @@ export class NextWorkspaceStorageServiceImpl extends Disposable implements INext
)
{
)
{
super
();
super
();
this
.
globalStorage
=
new
NextStorageService
Impl
(
'
:memory:
'
,
logService
,
environmentService
);
// TODO proxy from main side!
this
.
globalStorage
=
new
NextStorageService
(
'
:memory:
'
,
logService
,
environmentService
);
this
.
workspaceStorage
=
new
NextStorageService
Impl
(
workspaceDBPath
,
logService
,
environmentService
);
this
.
workspaceStorage
=
new
NextStorageService
(
workspaceDBPath
,
logService
,
environmentService
);
this
.
registerListeners
();
this
.
registerListeners
();
}
}
...
@@ -45,28 +45,31 @@ export class NextWorkspaceStorageServiceImpl extends Disposable implements INext
...
@@ -45,28 +45,31 @@ export class NextWorkspaceStorageServiceImpl extends Disposable implements INext
return
Promise
.
all
([
this
.
globalStorage
.
init
(),
this
.
workspaceStorage
.
init
()]).
then
(()
=>
void
0
);
return
Promise
.
all
([
this
.
globalStorage
.
init
(),
this
.
workspaceStorage
.
init
()]).
then
(()
=>
void
0
);
}
}
get
(
key
:
string
,
scope
:
StorageScope
=
StorageScope
.
GLOBAL
,
fallbackValue
?:
any
):
string
{
get
(
key
:
string
,
scope
:
StorageScope
,
fallbackValue
?:
any
):
string
{
return
this
.
getStorage
(
scope
).
get
(
key
,
fallbackValue
);
return
this
.
getStorage
(
scope
).
get
(
key
,
fallbackValue
);
}
}
getBoolean
(
key
:
string
,
scope
:
StorageScope
=
StorageScope
.
GLOBAL
,
fallbackValue
?:
boolean
):
boolean
{
getBoolean
(
key
:
string
,
scope
:
StorageScope
,
fallbackValue
?:
boolean
):
boolean
{
return
this
.
getStorage
(
scope
).
getBoolean
(
key
,
fallbackValue
);
return
this
.
getStorage
(
scope
).
getBoolean
(
key
,
fallbackValue
);
}
}
getInteger
(
key
:
string
,
scope
:
StorageScope
=
StorageScope
.
GLOBAL
,
fallbackValue
?:
number
):
number
{
getInteger
(
key
:
string
,
scope
:
StorageScope
,
fallbackValue
?:
number
):
number
{
return
this
.
getStorage
(
scope
).
getInteger
(
key
,
fallbackValue
);
return
this
.
getStorage
(
scope
).
getInteger
(
key
,
fallbackValue
);
}
}
set
(
key
:
string
,
value
:
any
,
scope
:
StorageScope
=
StorageScope
.
GLOBAL
):
Promise
<
void
>
{
set
(
key
:
string
,
value
:
any
,
scope
:
StorageScope
):
Promise
<
void
>
{
return
this
.
getStorage
(
scope
).
set
(
key
,
value
);
return
this
.
getStorage
(
scope
).
set
(
key
,
value
);
}
}
delete
(
key
:
string
,
scope
:
StorageScope
=
StorageScope
.
GLOBAL
):
Promise
<
void
>
{
delete
(
key
:
string
,
scope
:
StorageScope
):
Promise
<
void
>
{
return
this
.
getStorage
(
scope
).
delete
(
key
);
return
this
.
getStorage
(
scope
).
delete
(
key
);
}
}
close
():
Promise
<
void
>
{
close
():
Promise
<
void
>
{
return
this
.
workspaceStorage
.
close
();
return
Promise
.
all
([
this
.
globalStorage
.
close
(),
this
.
workspaceStorage
.
close
()
]).
then
(()
=>
void
0
);
}
}
private
getStorage
(
scope
:
StorageScope
):
INextStorageService
{
private
getStorage
(
scope
:
StorageScope
):
INextStorageService
{
...
...
src/vs/platform/storage2/test/node/nextStorageService.test.ts
浏览文件 @
a97e98b1
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
import
{
NullLogService
}
from
'
vs/platform/log/common/log
'
;
import
{
NullLogService
}
from
'
vs/platform/log/common/log
'
;
import
{
TestEnvironmentService
}
from
'
vs/workbench/test/workbenchTestServices
'
;
import
{
TestEnvironmentService
}
from
'
vs/workbench/test/workbenchTestServices
'
;
import
{
NextStorageService
Impl
}
from
'
vs/platform/storage2/node/nextStorageServiceImpl
'
;
import
{
NextStorageService
}
from
'
vs/platform/storage2/node/nextStorageService
'
;
import
{
generateUuid
}
from
'
vs/base/common/uuid
'
;
import
{
generateUuid
}
from
'
vs/base/common/uuid
'
;
import
{
join
}
from
'
path
'
;
import
{
join
}
from
'
path
'
;
import
{
tmpdir
}
from
'
os
'
;
import
{
tmpdir
}
from
'
os
'
;
...
@@ -33,7 +33,7 @@ suite('Workbench NextStorageService', () => {
...
@@ -33,7 +33,7 @@ suite('Workbench NextStorageService', () => {
const
storageDir
=
uniqueStorageDir
();
const
storageDir
=
uniqueStorageDir
();
await
mkdirp
(
storageDir
);
await
mkdirp
(
storageDir
);
const
storageService
=
new
NextStorageService
Impl
(
join
(
storageDir
,
'
storage.db
'
),
new
NullLogService
(),
TestEnvironmentService
);
const
storageService
=
new
NextStorageService
(
join
(
storageDir
,
'
storage.db
'
),
new
NullLogService
(),
TestEnvironmentService
);
await
storageService
.
init
();
await
storageService
.
init
();
...
@@ -90,7 +90,7 @@ suite('Workbench NextStorageService', () => {
...
@@ -90,7 +90,7 @@ suite('Workbench NextStorageService', () => {
const
storageDir
=
uniqueStorageDir
();
const
storageDir
=
uniqueStorageDir
();
await
mkdirp
(
storageDir
);
await
mkdirp
(
storageDir
);
let
storageService
=
new
NextStorageService
Impl
(
join
(
storageDir
,
'
storage.db
'
),
new
NullLogService
(),
TestEnvironmentService
);
let
storageService
=
new
NextStorageService
(
join
(
storageDir
,
'
storage.db
'
),
new
NullLogService
(),
TestEnvironmentService
);
await
storageService
.
init
();
await
storageService
.
init
();
const
set1Promise
=
storageService
.
set
(
'
foo
'
,
'
bar
'
);
const
set1Promise
=
storageService
.
set
(
'
foo
'
,
'
bar
'
);
...
@@ -106,7 +106,7 @@ suite('Workbench NextStorageService', () => {
...
@@ -106,7 +106,7 @@ suite('Workbench NextStorageService', () => {
equal
(
setPromiseResolved
,
true
);
equal
(
setPromiseResolved
,
true
);
storageService
=
new
NextStorageService
Impl
(
join
(
storageDir
,
'
storage.db
'
),
new
NullLogService
(),
TestEnvironmentService
);
storageService
=
new
NextStorageService
(
join
(
storageDir
,
'
storage.db
'
),
new
NullLogService
(),
TestEnvironmentService
);
await
storageService
.
init
();
await
storageService
.
init
();
equal
(
storageService
.
get
(
'
foo
'
),
'
bar
'
);
equal
(
storageService
.
get
(
'
foo
'
),
'
bar
'
);
...
@@ -114,7 +114,7 @@ suite('Workbench NextStorageService', () => {
...
@@ -114,7 +114,7 @@ suite('Workbench NextStorageService', () => {
await
storageService
.
close
();
await
storageService
.
close
();
storageService
=
new
NextStorageService
Impl
(
join
(
storageDir
,
'
storage.db
'
),
new
NullLogService
(),
TestEnvironmentService
);
storageService
=
new
NextStorageService
(
join
(
storageDir
,
'
storage.db
'
),
new
NullLogService
(),
TestEnvironmentService
);
await
storageService
.
init
();
await
storageService
.
init
();
const
delete1Promise
=
storageService
.
delete
(
'
foo
'
);
const
delete1Promise
=
storageService
.
delete
(
'
foo
'
);
...
@@ -130,7 +130,7 @@ suite('Workbench NextStorageService', () => {
...
@@ -130,7 +130,7 @@ suite('Workbench NextStorageService', () => {
equal
(
deletePromiseResolved
,
true
);
equal
(
deletePromiseResolved
,
true
);
storageService
=
new
NextStorageService
Impl
(
join
(
storageDir
,
'
storage.db
'
),
new
NullLogService
(),
TestEnvironmentService
);
storageService
=
new
NextStorageService
(
join
(
storageDir
,
'
storage.db
'
),
new
NullLogService
(),
TestEnvironmentService
);
await
storageService
.
init
();
await
storageService
.
init
();
ok
(
!
storageService
.
get
(
'
foo
'
));
ok
(
!
storageService
.
get
(
'
foo
'
));
...
@@ -144,7 +144,7 @@ suite('Workbench NextStorageService', () => {
...
@@ -144,7 +144,7 @@ suite('Workbench NextStorageService', () => {
const
storageDir
=
uniqueStorageDir
();
const
storageDir
=
uniqueStorageDir
();
await
mkdirp
(
storageDir
);
await
mkdirp
(
storageDir
);
let
storageService
=
new
NextStorageService
Impl
(
join
(
storageDir
,
'
storage.db
'
),
new
NullLogService
(),
TestEnvironmentService
);
let
storageService
=
new
NextStorageService
(
join
(
storageDir
,
'
storage.db
'
),
new
NullLogService
(),
TestEnvironmentService
);
await
storageService
.
init
();
await
storageService
.
init
();
const
set1Promise
=
storageService
.
set
(
'
foo
'
,
'
bar1
'
);
const
set1Promise
=
storageService
.
set
(
'
foo
'
,
'
bar1
'
);
...
...
src/vs/workbench/electron-browser/main.ts
浏览文件 @
a97e98b1
...
@@ -36,7 +36,7 @@ import { IWorkspacesService, ISingleFolderWorkspaceIdentifier } from 'vs/platfor
...
@@ -36,7 +36,7 @@ import { IWorkspacesService, ISingleFolderWorkspaceIdentifier } from 'vs/platfor
import
{
createSpdLogService
}
from
'
vs/platform/log/node/spdlogService
'
;
import
{
createSpdLogService
}
from
'
vs/platform/log/node/spdlogService
'
;
import
*
as
fs
from
'
fs
'
;
import
*
as
fs
from
'
fs
'
;
import
{
ConsoleLogService
,
MultiplexLogService
,
ILogService
}
from
'
vs/platform/log/common/log
'
;
import
{
ConsoleLogService
,
MultiplexLogService
,
ILogService
}
from
'
vs/platform/log/common/log
'
;
import
{
NextWorkspaceStorageService
Impl
}
from
'
vs/platform/storage2/node/nextWorkspaceStorageServiceImpl
'
;
import
{
NextWorkspaceStorageService
}
from
'
vs/platform/storage2/node/nextWorkspaceStorageService
'
;
import
{
IssueChannelClient
}
from
'
vs/platform/issue/node/issueIpc
'
;
import
{
IssueChannelClient
}
from
'
vs/platform/issue/node/issueIpc
'
;
import
{
IIssueService
}
from
'
vs/platform/issue/common/issue
'
;
import
{
IIssueService
}
from
'
vs/platform/issue/common/issue
'
;
import
{
LogLevelSetterChannelClient
,
FollowerLogService
}
from
'
vs/platform/log/node/logIpc
'
;
import
{
LogLevelSetterChannelClient
,
FollowerLogService
}
from
'
vs/platform/log/node/logIpc
'
;
...
@@ -166,8 +166,8 @@ function validateFolderUri(folderUri: ISingleFolderWorkspaceIdentifier, verbose:
...
@@ -166,8 +166,8 @@ function validateFolderUri(folderUri: ISingleFolderWorkspaceIdentifier, verbose:
});
});
}
}
function
createNextWorkspaceStorageService
(
environmentService
:
IEnvironmentService
,
logService
:
ILogService
):
Promise
<
NextWorkspaceStorageService
Impl
>
{
function
createNextWorkspaceStorageService
(
environmentService
:
IEnvironmentService
,
logService
:
ILogService
):
Promise
<
NextWorkspaceStorageService
>
{
const
nextStorageService
=
new
NextWorkspaceStorageService
Impl
(
'
:memory:
'
,
logService
,
environmentService
);
const
nextStorageService
=
new
NextWorkspaceStorageService
(
'
:memory:
'
,
logService
,
environmentService
);
return
nextStorageService
.
init
().
then
(()
=>
nextStorageService
);
return
nextStorageService
.
init
().
then
(()
=>
nextStorageService
);
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录