Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
旅途_2012
vscode
提交
0bbe1399
V
vscode
项目概览
旅途_2012
/
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,发现更多精彩内容 >>
提交
0bbe1399
编写于
6月 20, 2019
作者:
S
Sandeep Somavarapu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
debt - use file service based configuration file service
上级
e1ac9a24
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
18 addition
and
150 deletion
+18
-150
src/vs/workbench/electron-browser/main.ts
src/vs/workbench/electron-browser/main.ts
+2
-3
src/vs/workbench/services/configuration/browser/configuration.ts
...workbench/services/configuration/browser/configuration.ts
+2
-42
src/vs/workbench/services/configuration/common/configuration.ts
.../workbench/services/configuration/common/configuration.ts
+1
-6
src/vs/workbench/services/configuration/node/configurationFileService.ts
...h/services/configuration/node/configurationFileService.ts
+0
-79
src/vs/workbench/services/configuration/test/electron-browser/configurationEditingService.test.ts
...test/electron-browser/configurationEditingService.test.ts
+5
-6
src/vs/workbench/services/configuration/test/electron-browser/configurationService.test.ts
...ration/test/electron-browser/configurationService.test.ts
+8
-14
未找到文件。
src/vs/workbench/electron-browser/main.ts
浏览文件 @
0bbe1399
...
...
@@ -47,10 +47,10 @@ import { IChannel } from 'vs/base/parts/ipc/common/ipc';
import
{
REMOTE_FILE_SYSTEM_CHANNEL_NAME
,
RemoteExtensionsFileSystemProvider
}
from
'
vs/platform/remote/common/remoteAgentFileSystemChannel
'
;
import
{
DefaultConfigurationExportHelper
}
from
'
vs/workbench/services/configuration/node/configurationExportHelper
'
;
import
{
ConfigurationCache
}
from
'
vs/workbench/services/configuration/node/configurationCache
'
;
import
{
ConfigurationFileService
}
from
'
vs/workbench/services/configuration/node/configurationFileService
'
;
import
{
SpdLogService
}
from
'
vs/platform/log/node/spdlogService
'
;
import
{
SignService
}
from
'
vs/platform/sign/node/signService
'
;
import
{
ISignService
}
from
'
vs/platform/sign/common/sign
'
;
import
{
ConfigurationFileService
}
from
'
../services/configuration/common/configuration
'
;
class
CodeRendererMain
extends
Disposable
{
...
...
@@ -306,8 +306,7 @@ class CodeRendererMain extends Disposable {
}
private
async
createWorkspaceService
(
payload
:
IWorkspaceInitializationPayload
,
environmentService
:
IWorkbenchEnvironmentService
,
fileService
:
FileService
,
remoteAgentService
:
IRemoteAgentService
,
logService
:
ILogService
):
Promise
<
WorkspaceService
>
{
const
configurationFileService
=
new
ConfigurationFileService
();
configurationFileService
.
fileService
=
fileService
;
const
configurationFileService
=
new
ConfigurationFileService
(
fileService
);
const
workspaceService
=
new
WorkspaceService
({
userSettingsResource
:
environmentService
.
settingsResource
,
remoteAuthority
:
this
.
configuration
.
remoteAuthority
,
configurationCache
:
new
ConfigurationCache
(
environmentService
)
},
configurationFileService
,
remoteAgentService
);
...
...
src/vs/workbench/services/configuration/browser/configuration.ts
浏览文件 @
0bbe1399
...
...
@@ -20,7 +20,7 @@ import { ConfigurationScope } from 'vs/platform/configuration/common/configurati
import
{
extname
,
join
}
from
'
vs/base/common/path
'
;
import
{
equals
}
from
'
vs/base/common/objects
'
;
import
{
Schemas
}
from
'
vs/base/common/network
'
;
import
{
IConfigurationModel
,
compare
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
IConfigurationModel
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
IRemoteAgentService
}
from
'
vs/workbench/services/remote/common/remoteAgentService
'
;
import
{
hash
}
from
'
vs/base/common/hash
'
;
...
...
@@ -138,11 +138,7 @@ export class UserConfiguration extends Disposable {
async
initialize
():
Promise
<
ConfigurationModel
>
{
const
exists
=
await
this
.
configurationFileService
.
exists
(
this
.
configurationResource
);
this
.
onResourceExists
(
exists
);
const
configuraitonModel
=
await
this
.
reload
();
if
(
!
this
.
configurationFileService
.
isWatching
)
{
this
.
configurationFileService
.
whenWatchingStarted
.
then
(()
=>
this
.
onWatchStarted
(
configuraitonModel
));
}
return
configuraitonModel
;
return
this
.
reload
();
}
async
reload
():
Promise
<
ConfigurationModel
>
{
...
...
@@ -160,14 +156,6 @@ export class UserConfiguration extends Disposable {
return
this
.
parser
.
configurationModel
;
}
private
async
onWatchStarted
(
currentModel
:
ConfigurationModel
):
Promise
<
void
>
{
const
configuraitonModel
=
await
this
.
reload
();
const
{
added
,
removed
,
updated
}
=
compare
(
currentModel
,
configuraitonModel
);
if
(
added
.
length
||
removed
.
length
||
updated
.
length
)
{
this
.
_onDidChangeConfiguration
.
fire
(
configuraitonModel
);
}
}
private
async
handleFileEvents
(
event
:
FileChangesEvent
):
Promise
<
void
>
{
const
events
=
event
.
changes
;
...
...
@@ -378,10 +366,6 @@ class FileServiceBasedWorkspaceConfiguration extends Disposable implements IWork
this
.
_register
(
configurationFileService
.
onFileChanges
(
e
=>
this
.
handleWorkspaceFileEvents
(
e
)));
this
.
reloadConfigurationScheduler
=
this
.
_register
(
new
RunOnceScheduler
(()
=>
this
.
_onDidChange
.
fire
(),
50
));
this
.
workspaceConfigWatcher
=
this
.
_register
(
this
.
watchWorkspaceConfigurationFile
());
if
(
!
this
.
configurationFileService
.
isWatching
)
{
this
.
configurationFileService
.
whenWatchingStarted
.
then
(()
=>
this
.
onWatchStarted
());
}
}
get
workspaceIdentifier
():
IWorkspaceIdentifier
|
null
{
...
...
@@ -426,18 +410,6 @@ class FileServiceBasedWorkspaceConfiguration extends Disposable implements IWork
return
this
.
getWorkspaceSettings
();
}
private
async
onWatchStarted
():
Promise
<
void
>
{
if
(
this
.
workspaceIdentifier
)
{
const
currentModel
=
this
.
getConfigurationModel
();
await
this
.
load
(
this
.
workspaceIdentifier
);
const
newModel
=
this
.
getConfigurationModel
();
const
{
added
,
removed
,
updated
}
=
compare
(
currentModel
,
newModel
);
if
(
added
.
length
||
removed
.
length
||
updated
.
length
)
{
this
.
_onDidChange
.
fire
();
}
}
}
private
consolidate
():
void
{
this
.
workspaceSettings
=
this
.
workspaceConfigurationModelParser
.
settingsModel
.
merge
(
this
.
workspaceConfigurationModelParser
.
launchModel
);
}
...
...
@@ -557,9 +529,6 @@ class FileServiceBasedFolderConfiguration extends Disposable implements IFolderC
this
.
changeEventTriggerScheduler
=
this
.
_register
(
new
RunOnceScheduler
(()
=>
this
.
_onDidChange
.
fire
(),
50
));
this
.
_register
(
configurationFileService
.
onFileChanges
(
e
=>
this
.
handleWorkspaceFileEvents
(
e
)));
if
(
!
this
.
configurationFileService
.
isWatching
)
{
this
.
configurationFileService
.
whenWatchingStarted
.
then
(()
=>
this
.
onWatchStarted
());
}
}
async
loadConfiguration
():
Promise
<
ConfigurationModel
>
{
...
...
@@ -611,15 +580,6 @@ class FileServiceBasedFolderConfiguration extends Disposable implements IFolderC
this
.
_cache
=
this
.
_folderSettingsModelParser
.
configurationModel
.
merge
(...
this
.
_standAloneConfigurations
);
}
private
async
onWatchStarted
():
Promise
<
void
>
{
const
currentModel
=
this
.
_cache
;
const
newModel
=
await
this
.
loadConfiguration
();
const
{
added
,
removed
,
updated
}
=
compare
(
currentModel
,
newModel
);
if
(
added
.
length
||
removed
.
length
||
updated
.
length
)
{
this
.
_onDidChange
.
fire
();
}
}
private
handleWorkspaceFileEvents
(
event
:
FileChangesEvent
):
void
{
const
events
=
event
.
changes
;
let
affectedByChanges
=
false
;
...
...
src/vs/workbench/services/configuration/common/configuration.ts
浏览文件 @
0bbe1399
...
...
@@ -43,10 +43,7 @@ export interface IConfigurationCache {
}
export
interface
IConfigurationFileService
{
fileService
:
IFileService
|
null
;
readonly
onFileChanges
:
Event
<
FileChangesEvent
>
;
readonly
isWatching
:
boolean
;
readonly
whenWatchingStarted
:
Promise
<
void
>
;
whenProviderRegistered
(
scheme
:
string
):
Promise
<
void
>
;
watch
(
resource
:
URI
):
IDisposable
;
exists
(
resource
:
URI
):
Promise
<
boolean
>
;
...
...
@@ -55,11 +52,9 @@ export interface IConfigurationFileService {
export
class
ConfigurationFileService
implements
IConfigurationFileService
{
constructor
(
p
ublic
fileService
:
IFileService
)
{
}
constructor
(
p
rivate
readonly
fileService
:
IFileService
)
{
}
get
onFileChanges
()
{
return
this
.
fileService
.
onFileChanges
;
}
readonly
whenWatchingStarted
:
Promise
<
void
>
=
Promise
.
resolve
();
readonly
isWatching
:
boolean
=
true
;
whenProviderRegistered
(
scheme
:
string
):
Promise
<
void
>
{
if
(
this
.
fileService
.
canHandleResource
(
URI
.
from
({
scheme
})))
{
...
...
src/vs/workbench/services/configuration/node/configurationFileService.ts
已删除
100644 → 0
浏览文件 @
e1ac9a24
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import
*
as
pfs
from
'
vs/base/node/pfs
'
;
import
{
IConfigurationFileService
,
ConfigurationFileService
as
FileServiceBasedConfigurationFileService
}
from
'
vs/workbench/services/configuration/common/configuration
'
;
import
{
URI
}
from
'
vs/base/common/uri
'
;
import
{
Event
,
Emitter
}
from
'
vs/base/common/event
'
;
import
{
FileChangesEvent
,
IFileService
}
from
'
vs/platform/files/common/files
'
;
import
{
Disposable
,
IDisposable
,
toDisposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
Schemas
}
from
'
vs/base/common/network
'
;
export
class
ConfigurationFileService
extends
Disposable
implements
IConfigurationFileService
{
private
_fileServiceBasedConfigurationFileService
:
FileServiceBasedConfigurationFileService
|
null
=
null
;
private
_fileServiceBasedConfigurationFileServiceCallback
:
(
fileServiceBasedConfigurationFileService
:
FileServiceBasedConfigurationFileService
)
=>
void
;
private
_whenFileServiceBasedConfigurationFileServiceAvailable
:
Promise
<
FileServiceBasedConfigurationFileService
>
=
new
Promise
((
c
)
=>
this
.
_fileServiceBasedConfigurationFileServiceCallback
=
c
);
private
_watchResources
:
{
resource
:
URI
,
disposable
:
{
disposable
:
IDisposable
|
null
}
}[]
=
[];
readonly
whenWatchingStarted
:
Promise
<
void
>
=
this
.
_whenFileServiceBasedConfigurationFileServiceAvailable
.
then
(()
=>
undefined
);
private
readonly
_onFileChanges
:
Emitter
<
FileChangesEvent
>
=
this
.
_register
(
new
Emitter
<
FileChangesEvent
>
());
readonly
onFileChanges
:
Event
<
FileChangesEvent
>
=
this
.
_onFileChanges
.
event
;
get
isWatching
():
boolean
{
return
this
.
_fileServiceBasedConfigurationFileService
?
this
.
_fileServiceBasedConfigurationFileService
.
isWatching
:
false
;
}
watch
(
resource
:
URI
):
IDisposable
{
if
(
this
.
_fileServiceBasedConfigurationFileService
)
{
return
this
.
_fileServiceBasedConfigurationFileService
.
watch
(
resource
);
}
const
disposable
:
{
disposable
:
IDisposable
|
null
}
=
{
disposable
:
null
};
this
.
_watchResources
.
push
({
resource
,
disposable
});
return
toDisposable
(()
=>
{
if
(
disposable
.
disposable
)
{
disposable
.
disposable
.
dispose
();
}
});
}
whenProviderRegistered
(
scheme
:
string
):
Promise
<
void
>
{
if
(
scheme
===
Schemas
.
file
)
{
return
Promise
.
resolve
();
}
return
this
.
_whenFileServiceBasedConfigurationFileServiceAvailable
.
then
(
fileServiceBasedConfigurationFileService
=>
fileServiceBasedConfigurationFileService
.
whenProviderRegistered
(
scheme
));
}
exists
(
resource
:
URI
):
Promise
<
boolean
>
{
return
this
.
_fileServiceBasedConfigurationFileService
?
this
.
_fileServiceBasedConfigurationFileService
.
exists
(
resource
)
:
pfs
.
exists
(
resource
.
fsPath
);
}
async
readFile
(
resource
:
URI
):
Promise
<
string
>
{
if
(
this
.
_fileServiceBasedConfigurationFileService
)
{
return
this
.
_fileServiceBasedConfigurationFileService
.
readFile
(
resource
);
}
else
{
const
contents
=
await
pfs
.
readFile
(
resource
.
fsPath
);
return
contents
.
toString
();
}
}
private
_fileService
:
IFileService
|
null
;
get
fileService
():
IFileService
|
null
{
return
this
.
_fileService
;
}
set
fileService
(
fileService
:
IFileService
|
null
)
{
if
(
fileService
&&
!
this
.
_fileServiceBasedConfigurationFileService
)
{
this
.
_fileServiceBasedConfigurationFileService
=
new
FileServiceBasedConfigurationFileService
(
fileService
);
this
.
_fileService
=
fileService
;
this
.
_register
(
this
.
_fileServiceBasedConfigurationFileService
.
onFileChanges
(
e
=>
this
.
_onFileChanges
.
fire
(
e
)));
for
(
const
{
resource
,
disposable
}
of
this
.
_watchResources
)
{
disposable
.
disposable
=
this
.
_fileServiceBasedConfigurationFileService
.
watch
(
resource
);
}
this
.
_fileServiceBasedConfigurationFileServiceCallback
(
this
.
_fileServiceBasedConfigurationFileService
);
}
}
}
src/vs/workbench/services/configuration/test/electron-browser/configurationEditingService.test.ts
浏览文件 @
0bbe1399
...
...
@@ -19,7 +19,7 @@ import * as uuid from 'vs/base/common/uuid';
import
{
IConfigurationRegistry
,
Extensions
as
ConfigurationExtensions
}
from
'
vs/platform/configuration/common/configurationRegistry
'
;
import
{
WorkspaceService
}
from
'
vs/workbench/services/configuration/browser/configurationService
'
;
import
{
ConfigurationEditingService
,
ConfigurationEditingError
,
ConfigurationEditingErrorCode
,
EditableConfigurationTarget
}
from
'
vs/workbench/services/configuration/common/configurationEditingService
'
;
import
{
WORKSPACE_STANDALONE_CONFIGURATIONS
}
from
'
vs/workbench/services/configuration/common/configuration
'
;
import
{
WORKSPACE_STANDALONE_CONFIGURATIONS
,
ConfigurationFileService
}
from
'
vs/workbench/services/configuration/common/configuration
'
;
import
{
IConfigurationService
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
TestInstantiationService
}
from
'
vs/platform/instantiation/test/common/instantiationServiceMock
'
;
import
{
ITextFileService
}
from
'
vs/workbench/services/textfile/common/textfiles
'
;
...
...
@@ -39,7 +39,6 @@ import { Schemas } from 'vs/base/common/network';
import
{
DiskFileSystemProvider
}
from
'
vs/workbench/services/files/node/diskFileSystemProvider
'
;
import
{
IFileService
}
from
'
vs/platform/files/common/files
'
;
import
{
ConfigurationCache
}
from
'
vs/workbench/services/configuration/node/configurationCache
'
;
import
{
ConfigurationFileService
}
from
'
vs/workbench/services/configuration/node/configurationFileService
'
;
class
SettingsTestEnvironmentService
extends
EnvironmentService
{
...
...
@@ -104,14 +103,14 @@ suite('ConfigurationEditingService', () => {
const
environmentService
=
new
SettingsTestEnvironmentService
(
parseArgs
(
process
.
argv
),
process
.
execPath
,
globalSettingsFile
);
instantiationService
.
stub
(
IEnvironmentService
,
environmentService
);
const
remoteAgentService
=
instantiationService
.
createInstance
(
RemoteAgentService
,
{});
const
fileService
=
new
FileService
(
new
NullLogService
());
fileService
.
registerProvider
(
Schemas
.
file
,
new
DiskFileSystemProvider
(
new
NullLogService
()));
instantiationService
.
stub
(
IFileService
,
fileService
);
instantiationService
.
stub
(
IRemoteAgentService
,
remoteAgentService
);
const
workspaceService
=
new
WorkspaceService
({
userSettingsResource
:
environmentService
.
settingsResource
,
configurationCache
:
new
ConfigurationCache
(
environmentService
)
},
new
ConfigurationFileService
(),
remoteAgentService
);
const
workspaceService
=
new
WorkspaceService
({
userSettingsResource
:
environmentService
.
settingsResource
,
configurationCache
:
new
ConfigurationCache
(
environmentService
)
},
new
ConfigurationFileService
(
fileService
),
remoteAgentService
);
instantiationService
.
stub
(
IWorkspaceContextService
,
workspaceService
);
return
workspaceService
.
initialize
(
noWorkspace
?
{
id
:
''
}
:
{
folder
:
URI
.
file
(
workspaceDir
),
id
:
createHash
(
'
md5
'
).
update
(
URI
.
file
(
workspaceDir
).
toString
()).
digest
(
'
hex
'
)
}).
then
(()
=>
{
instantiationService
.
stub
(
IConfigurationService
,
workspaceService
);
const
fileService
=
new
FileService
(
new
NullLogService
());
fileService
.
registerProvider
(
Schemas
.
file
,
new
DiskFileSystemProvider
(
new
NullLogService
()));
instantiationService
.
stub
(
IFileService
,
fileService
);
instantiationService
.
stub
(
ITextFileService
,
instantiationService
.
createInstance
(
TestTextFileService
));
instantiationService
.
stub
(
ITextModelService
,
<
ITextModelService
>
instantiationService
.
createInstance
(
TextModelResolverService
));
instantiationService
.
stub
(
ICommandService
,
CommandService
);
...
...
src/vs/workbench/services/configuration/test/electron-browser/configurationService.test.ts
浏览文件 @
0bbe1399
...
...
@@ -41,9 +41,8 @@ import { FileService } from 'vs/workbench/services/files/common/fileService';
import
{
NullLogService
}
from
'
vs/platform/log/common/log
'
;
import
{
DiskFileSystemProvider
}
from
'
vs/workbench/services/files/node/diskFileSystemProvider
'
;
import
{
ConfigurationCache
}
from
'
vs/workbench/services/configuration/node/configurationCache
'
;
import
{
ConfigurationFileService
}
from
'
vs/workbench/services/configuration/node/configurationFileService
'
;
import
{
IRemoteAgentEnvironment
}
from
'
vs/platform/remote/common/remoteAgentEnvironment
'
;
import
{
IConfigurationCache
}
from
'
vs/workbench/services/configuration/common/configuration
'
;
import
{
IConfigurationCache
,
ConfigurationFileService
}
from
'
vs/workbench/services/configuration/common/configuration
'
;
import
{
VSBuffer
}
from
'
vs/base/common/buffer
'
;
import
{
SignService
}
from
'
vs/platform/sign/browser/signService
'
;
...
...
@@ -104,7 +103,7 @@ suite('WorkspaceContextService - Folder', () => {
workspaceResource
=
folderDir
;
const
globalSettingsFile
=
path
.
join
(
parentDir
,
'
settings.json
'
);
const
environmentService
=
new
SettingsTestEnvironmentService
(
parseArgs
(
process
.
argv
),
process
.
execPath
,
globalSettingsFile
);
workspaceContextService
=
new
WorkspaceService
({
userSettingsResource
:
environmentService
.
settingsResource
,
configurationCache
:
new
ConfigurationCache
(
environmentService
)
},
new
ConfigurationFileService
(),
new
RemoteAgentService
(
<
IWindowConfiguration
>
{},
environmentService
,
new
RemoteAuthorityResolverService
(),
new
SignService
()));
workspaceContextService
=
new
WorkspaceService
({
userSettingsResource
:
environmentService
.
settingsResource
,
configurationCache
:
new
ConfigurationCache
(
environmentService
)
},
new
ConfigurationFileService
(
new
FileService
(
new
NullLogService
())
),
new
RemoteAgentService
(
<
IWindowConfiguration
>
{},
environmentService
,
new
RemoteAuthorityResolverService
(),
new
SignService
()));
return
(
<
WorkspaceService
>
workspaceContextService
).
initialize
(
convertToWorkspacePayload
(
URI
.
file
(
folderDir
)));
});
});
...
...
@@ -166,7 +165,7 @@ suite('WorkspaceContextService - Workspace', () => {
const
environmentService
=
new
SettingsTestEnvironmentService
(
parseArgs
(
process
.
argv
),
process
.
execPath
,
path
.
join
(
parentDir
,
'
settings.json
'
));
const
remoteAgentService
=
instantiationService
.
createInstance
(
RemoteAgentService
,
{});
instantiationService
.
stub
(
IRemoteAgentService
,
remoteAgentService
);
const
workspaceService
=
new
WorkspaceService
({
userSettingsResource
:
environmentService
.
settingsResource
,
configurationCache
:
new
ConfigurationCache
(
environmentService
)
},
new
ConfigurationFileService
(),
remoteAgentService
);
const
workspaceService
=
new
WorkspaceService
({
userSettingsResource
:
environmentService
.
settingsResource
,
configurationCache
:
new
ConfigurationCache
(
environmentService
)
},
new
ConfigurationFileService
(
new
FileService
(
new
NullLogService
())
),
remoteAgentService
);
instantiationService
.
stub
(
IWorkspaceContextService
,
workspaceService
);
instantiationService
.
stub
(
IConfigurationService
,
workspaceService
);
...
...
@@ -224,8 +223,7 @@ suite('WorkspaceContextService - Workspace Editing', () => {
instantiationService
.
stub
(
IRemoteAgentService
,
remoteAgentService
);
const
fileService
=
new
FileService
(
new
NullLogService
());
fileService
.
registerProvider
(
Schemas
.
file
,
new
DiskFileSystemProvider
(
new
NullLogService
()));
const
configurationFileService
=
new
ConfigurationFileService
();
configurationFileService
.
fileService
=
fileService
;
const
configurationFileService
=
new
ConfigurationFileService
(
fileService
);
const
workspaceService
=
new
WorkspaceService
({
userSettingsResource
:
environmentService
.
settingsResource
,
configurationCache
:
new
ConfigurationCache
(
environmentService
)
},
configurationFileService
,
remoteAgentService
);
instantiationService
.
stub
(
IWorkspaceContextService
,
workspaceService
);
...
...
@@ -485,8 +483,7 @@ suite('WorkspaceService - Initialization', () => {
instantiationService
.
stub
(
IRemoteAgentService
,
remoteAgentService
);
const
fileService
=
new
FileService
(
new
NullLogService
());
fileService
.
registerProvider
(
Schemas
.
file
,
new
DiskFileSystemProvider
(
new
NullLogService
()));
const
configurationFileService
=
new
ConfigurationFileService
();
configurationFileService
.
fileService
=
fileService
;
const
configurationFileService
=
new
ConfigurationFileService
(
fileService
);
const
workspaceService
=
new
WorkspaceService
({
userSettingsResource
:
environmentService
.
settingsResource
,
configurationCache
:
new
ConfigurationCache
(
environmentService
)
},
configurationFileService
,
remoteAgentService
);
instantiationService
.
stub
(
IWorkspaceContextService
,
workspaceService
);
instantiationService
.
stub
(
IConfigurationService
,
workspaceService
);
...
...
@@ -749,8 +746,7 @@ suite('WorkspaceConfigurationService - Folder', () => {
instantiationService
.
stub
(
IRemoteAgentService
,
remoteAgentService
);
const
fileService
=
new
FileService
(
new
NullLogService
());
fileService
.
registerProvider
(
Schemas
.
file
,
new
DiskFileSystemProvider
(
new
NullLogService
()));
const
configurationFileService
=
new
ConfigurationFileService
();
configurationFileService
.
fileService
=
fileService
;
const
configurationFileService
=
new
ConfigurationFileService
(
fileService
);
const
workspaceService
=
new
WorkspaceService
({
userSettingsResource
:
environmentService
.
settingsResource
,
configurationCache
:
new
ConfigurationCache
(
environmentService
)
},
configurationFileService
,
remoteAgentService
);
instantiationService
.
stub
(
IWorkspaceContextService
,
workspaceService
);
instantiationService
.
stub
(
IConfigurationService
,
workspaceService
);
...
...
@@ -1077,8 +1073,7 @@ suite('WorkspaceConfigurationService-Multiroot', () => {
instantiationService
.
stub
(
IRemoteAgentService
,
remoteAgentService
);
const
fileService
=
new
FileService
(
new
NullLogService
());
fileService
.
registerProvider
(
Schemas
.
file
,
new
DiskFileSystemProvider
(
new
NullLogService
()));
const
configurationFileService
=
new
ConfigurationFileService
();
configurationFileService
.
fileService
=
fileService
;
const
configurationFileService
=
new
ConfigurationFileService
(
fileService
);
const
workspaceService
=
new
WorkspaceService
({
userSettingsResource
:
environmentService
.
settingsResource
,
configurationCache
:
new
ConfigurationCache
(
environmentService
)
},
configurationFileService
,
remoteAgentService
);
instantiationService
.
stub
(
IWorkspaceContextService
,
workspaceService
);
...
...
@@ -1479,8 +1474,7 @@ suite('WorkspaceConfigurationService - Remote Folder', () => {
const
remoteAgentService
=
instantiationService
.
stub
(
IRemoteAgentService
,
<
Partial
<
IRemoteAgentService
>>
{
getEnvironment
:
()
=>
remoteEnvironmentPromise
});
const
fileService
=
new
FileService
(
new
NullLogService
());
fileService
.
registerProvider
(
Schemas
.
file
,
diskFileSystemProvider
);
const
configurationFileService
=
new
ConfigurationFileService
();
configurationFileService
.
fileService
=
fileService
;
const
configurationFileService
=
new
ConfigurationFileService
(
fileService
);
const
configurationCache
:
IConfigurationCache
=
{
read
:
()
=>
Promise
.
resolve
(
''
),
write
:
()
=>
Promise
.
resolve
(),
remove
:
()
=>
Promise
.
resolve
()
};
testObject
=
new
WorkspaceService
({
userSettingsResource
:
environmentService
.
settingsResource
,
configurationCache
,
remoteAuthority
},
configurationFileService
,
remoteAgentService
);
instantiationService
.
stub
(
IWorkspaceContextService
,
testObject
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录