Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
徽霖
Vscode
提交
27ef2915
V
Vscode
项目概览
徽霖
/
Vscode
通知
9
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,发现更多精彩内容 >>
提交
27ef2915
编写于
6月 20, 2019
作者:
S
Sandeep Somavarapu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
debt create configuration file service inside configuration service
上级
24e05597
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
32 addition
and
41 deletion
+32
-41
src/vs/workbench/browser/web.main.ts
src/vs/workbench/browser/web.main.ts
+1
-2
src/vs/workbench/electron-browser/main.ts
src/vs/workbench/electron-browser/main.ts
+1
-4
src/vs/workbench/services/configuration/browser/configuration.ts
...workbench/services/configuration/browser/configuration.ts
+9
-9
src/vs/workbench/services/configuration/browser/configurationService.ts
...ch/services/configuration/browser/configurationService.ts
+8
-5
src/vs/workbench/services/configuration/common/configuration.ts
.../workbench/services/configuration/common/configuration.ts
+3
-11
src/vs/workbench/services/configuration/test/electron-browser/configurationEditingService.test.ts
...test/electron-browser/configurationEditingService.test.ts
+2
-2
src/vs/workbench/services/configuration/test/electron-browser/configurationService.test.ts
...ration/test/electron-browser/configurationService.test.ts
+8
-8
未找到文件。
src/vs/workbench/browser/web.main.ts
浏览文件 @
27ef2915
...
...
@@ -29,7 +29,6 @@ import { URI } from 'vs/base/common/uri';
import
{
IWorkspaceInitializationPayload
}
from
'
vs/platform/workspaces/common/workspaces
'
;
import
{
WorkspaceService
}
from
'
vs/workbench/services/configuration/browser/configurationService
'
;
import
{
ConfigurationCache
}
from
'
vs/workbench/services/configuration/browser/configurationCache
'
;
import
{
ConfigurationFileService
}
from
'
vs/workbench/services/configuration/common/configuration
'
;
import
{
WebResources
}
from
'
vs/workbench/browser/web.resources
'
;
import
{
ISignService
}
from
'
vs/platform/sign/common/sign
'
;
import
{
SignService
}
from
'
vs/platform/sign/browser/signService
'
;
...
...
@@ -137,7 +136,7 @@ class CodeRendererMain extends Disposable {
}
private
async
createWorkspaceService
(
payload
:
IWorkspaceInitializationPayload
,
environmentService
:
IWorkbenchEnvironmentService
,
fileService
:
FileService
,
remoteAgentService
:
IRemoteAgentService
,
logService
:
ILogService
):
Promise
<
WorkspaceService
>
{
const
workspaceService
=
new
WorkspaceService
({
userSettingsResource
:
environmentService
.
settingsResource
,
remoteAuthority
:
this
.
configuration
.
remoteAuthority
,
configurationCache
:
new
ConfigurationCache
()
},
new
ConfigurationFileService
(
fileService
)
,
remoteAgentService
);
const
workspaceService
=
new
WorkspaceService
({
userSettingsResource
:
environmentService
.
settingsResource
,
remoteAuthority
:
this
.
configuration
.
remoteAuthority
,
configurationCache
:
new
ConfigurationCache
()
},
fileService
,
remoteAgentService
);
try
{
await
workspaceService
.
initialize
(
payload
);
...
...
src/vs/workbench/electron-browser/main.ts
浏览文件 @
27ef2915
...
...
@@ -50,7 +50,6 @@ import { ConfigurationCache } from 'vs/workbench/services/configuration/node/con
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,9 +305,7 @@ class CodeRendererMain extends Disposable {
}
private
async
createWorkspaceService
(
payload
:
IWorkspaceInitializationPayload
,
environmentService
:
IWorkbenchEnvironmentService
,
fileService
:
FileService
,
remoteAgentService
:
IRemoteAgentService
,
logService
:
ILogService
):
Promise
<
WorkspaceService
>
{
const
configurationFileService
=
new
ConfigurationFileService
(
fileService
);
const
workspaceService
=
new
WorkspaceService
({
userSettingsResource
:
environmentService
.
settingsResource
,
remoteAuthority
:
this
.
configuration
.
remoteAuthority
,
configurationCache
:
new
ConfigurationCache
(
environmentService
)
},
configurationFileService
,
remoteAgentService
);
const
workspaceService
=
new
WorkspaceService
({
userSettingsResource
:
environmentService
.
settingsResource
,
remoteAuthority
:
this
.
configuration
.
remoteAuthority
,
configurationCache
:
new
ConfigurationCache
(
environmentService
)
},
fileService
,
remoteAgentService
);
try
{
await
workspaceService
.
initialize
(
payload
);
...
...
src/vs/workbench/services/configuration/browser/configuration.ts
浏览文件 @
27ef2915
...
...
@@ -12,7 +12,7 @@ import { RunOnceScheduler } from 'vs/base/common/async';
import
{
FileChangeType
,
FileChangesEvent
}
from
'
vs/platform/files/common/files
'
;
import
{
ConfigurationModel
,
ConfigurationModelParser
}
from
'
vs/platform/configuration/common/configurationModels
'
;
import
{
WorkspaceConfigurationModelParser
,
StandaloneConfigurationModelParser
}
from
'
vs/workbench/services/configuration/common/configurationModels
'
;
import
{
FOLDER_SETTINGS_PATH
,
TASKS_CONFIGURATION_KEY
,
FOLDER_SETTINGS_NAME
,
LAUNCH_CONFIGURATION_KEY
,
IConfigurationCache
,
ConfigurationKey
,
IConfigurationFileService
,
REMOTE_MACHINE_SCOPES
,
FOLDER_SCOPES
,
WORKSPACE_SCOPES
}
from
'
vs/workbench/services/configuration/common/configuration
'
;
import
{
FOLDER_SETTINGS_PATH
,
TASKS_CONFIGURATION_KEY
,
FOLDER_SETTINGS_NAME
,
LAUNCH_CONFIGURATION_KEY
,
IConfigurationCache
,
ConfigurationKey
,
REMOTE_MACHINE_SCOPES
,
FOLDER_SCOPES
,
WORKSPACE_SCOPES
,
ConfigurationFileService
}
from
'
vs/workbench/services/configuration/common/configuration
'
;
import
{
IStoredWorkspaceFolder
,
IWorkspaceIdentifier
}
from
'
vs/platform/workspaces/common/workspaces
'
;
import
{
JSONEditingService
}
from
'
vs/workbench/services/configuration/common/jsonEditingService
'
;
import
{
WorkbenchState
,
IWorkspaceFolder
}
from
'
vs/platform/workspace/common/workspace
'
;
...
...
@@ -27,7 +27,7 @@ import { hash } from 'vs/base/common/hash';
export
class
RemoteUserConfiguration
extends
Disposable
{
private
readonly
_cachedConfiguration
:
CachedUserConfiguration
;
private
readonly
_configurationFileService
:
I
ConfigurationFileService
;
private
readonly
_configurationFileService
:
ConfigurationFileService
;
private
_userConfiguration
:
UserConfiguration
|
CachedUserConfiguration
;
private
_userConfigurationInitializationPromise
:
Promise
<
ConfigurationModel
>
|
null
=
null
;
...
...
@@ -37,7 +37,7 @@ export class RemoteUserConfiguration extends Disposable {
constructor
(
remoteAuthority
:
string
,
configurationCache
:
IConfigurationCache
,
configurationFileService
:
I
ConfigurationFileService
,
configurationFileService
:
ConfigurationFileService
,
remoteAgentService
:
IRemoteAgentService
)
{
super
();
...
...
@@ -103,7 +103,7 @@ export class UserConfiguration extends Disposable {
constructor
(
private
readonly
configurationResource
:
URI
,
private
readonly
scopes
:
ConfigurationScope
[]
|
undefined
,
private
readonly
configurationFileService
:
I
ConfigurationFileService
private
readonly
configurationFileService
:
ConfigurationFileService
)
{
super
();
...
...
@@ -240,7 +240,7 @@ class CachedUserConfiguration extends Disposable {
export
class
WorkspaceConfiguration
extends
Disposable
{
private
readonly
_configurationFileService
:
I
ConfigurationFileService
;
private
readonly
_configurationFileService
:
ConfigurationFileService
;
private
readonly
_cachedConfiguration
:
CachedWorkspaceConfiguration
;
private
_workspaceConfiguration
:
IWorkspaceConfiguration
;
private
_workspaceConfigurationChangeDisposable
:
IDisposable
=
Disposable
.
None
;
...
...
@@ -254,7 +254,7 @@ export class WorkspaceConfiguration extends Disposable {
constructor
(
configurationCache
:
IConfigurationCache
,
configurationFileService
:
I
ConfigurationFileService
configurationFileService
:
ConfigurationFileService
)
{
super
();
this
.
_configurationFileService
=
configurationFileService
;
...
...
@@ -357,7 +357,7 @@ class FileServiceBasedWorkspaceConfiguration extends Disposable implements IWork
protected
readonly
_onDidChange
:
Emitter
<
void
>
=
this
.
_register
(
new
Emitter
<
void
>
());
readonly
onDidChange
:
Event
<
void
>
=
this
.
_onDidChange
.
event
;
constructor
(
private
configurationFileService
:
I
ConfigurationFileService
)
{
constructor
(
private
configurationFileService
:
ConfigurationFileService
)
{
super
();
this
.
workspaceConfigurationModelParser
=
new
WorkspaceConfigurationModelParser
(
''
);
...
...
@@ -518,7 +518,7 @@ class FileServiceBasedFolderConfiguration extends Disposable implements IFolderC
protected
readonly
_onDidChange
:
Emitter
<
void
>
=
this
.
_register
(
new
Emitter
<
void
>
());
readonly
onDidChange
:
Event
<
void
>
=
this
.
_onDidChange
.
event
;
constructor
(
protected
readonly
configurationFolder
:
URI
,
workbenchState
:
WorkbenchState
,
private
configurationFileService
:
I
ConfigurationFileService
)
{
constructor
(
protected
readonly
configurationFolder
:
URI
,
workbenchState
:
WorkbenchState
,
private
configurationFileService
:
ConfigurationFileService
)
{
super
();
this
.
configurationNames
=
[
FOLDER_SETTINGS_NAME
/*First one should be settings */
,
TASKS_CONFIGURATION_KEY
,
LAUNCH_CONFIGURATION_KEY
];
...
...
@@ -685,7 +685,7 @@ export class FolderConfiguration extends Disposable implements IFolderConfigurat
readonly
workspaceFolder
:
IWorkspaceFolder
,
configFolderRelativePath
:
string
,
private
readonly
workbenchState
:
WorkbenchState
,
configurationFileService
:
I
ConfigurationFileService
,
configurationFileService
:
ConfigurationFileService
,
configurationCache
:
IConfigurationCache
)
{
super
();
...
...
src/vs/workbench/services/configuration/browser/configurationService.ts
浏览文件 @
27ef2915
...
...
@@ -15,7 +15,7 @@ import { isLinux } from 'vs/base/common/platform';
import
{
ConfigurationChangeEvent
,
ConfigurationModel
,
DefaultConfigurationModel
}
from
'
vs/platform/configuration/common/configurationModels
'
;
import
{
IConfigurationChangeEvent
,
ConfigurationTarget
,
IConfigurationOverrides
,
keyFromOverrideIdentifier
,
isConfigurationOverrides
,
IConfigurationData
,
IConfigurationService
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
Configuration
,
WorkspaceConfigurationChangeEvent
,
AllKeysConfigurationChangeEvent
}
from
'
vs/workbench/services/configuration/common/configurationModels
'
;
import
{
FOLDER_CONFIG_FOLDER_NAME
,
defaultSettingsSchemaId
,
userSettingsSchemaId
,
workspaceSettingsSchemaId
,
folderSettingsSchemaId
,
IConfigurationCache
,
IConfigurationFileService
,
machineSettingsSchemaId
,
LOCAL_MACHINE_SCOPES
}
from
'
vs/workbench/services/configuration/common/configuration
'
;
import
{
FOLDER_CONFIG_FOLDER_NAME
,
defaultSettingsSchemaId
,
userSettingsSchemaId
,
workspaceSettingsSchemaId
,
folderSettingsSchemaId
,
IConfigurationCache
,
machineSettingsSchemaId
,
LOCAL_MACHINE_SCOPES
,
ConfigurationFileService
}
from
'
vs/workbench/services/configuration/common/configuration
'
;
import
{
Registry
}
from
'
vs/platform/registry/common/platform
'
;
import
{
IConfigurationRegistry
,
Extensions
,
allSettings
,
windowSettings
,
resourceSettings
,
applicationSettings
,
machineSettings
}
from
'
vs/platform/configuration/common/configurationRegistry
'
;
import
{
IWorkspaceIdentifier
,
isWorkspaceIdentifier
,
IStoredWorkspaceFolder
,
isStoredWorkspaceFolder
,
IWorkspaceFolderCreationData
,
ISingleFolderWorkspaceIdentifier
,
isSingleFolderWorkspaceIdentifier
,
IWorkspaceInitializationPayload
,
isSingleFolderWorkspaceInitializationPayload
,
ISingleFolderWorkspaceInitializationPayload
,
IEmptyWorkspaceInitializationPayload
,
useSlashForPath
,
getStoredWorkspaceFolder
}
from
'
vs/platform/workspaces/common/workspaces
'
;
...
...
@@ -28,6 +28,7 @@ import { localize } from 'vs/nls';
import
{
isEqual
,
dirname
}
from
'
vs/base/common/resources
'
;
import
{
mark
}
from
'
vs/base/common/performance
'
;
import
{
IRemoteAgentService
}
from
'
vs/workbench/services/remote/common/remoteAgentService
'
;
import
{
IFileService
}
from
'
vs/platform/files/common/files
'
;
export
class
WorkspaceService
extends
Disposable
implements
IConfigurationService
,
IWorkspaceContextService
{
...
...
@@ -43,9 +44,10 @@ export class WorkspaceService extends Disposable implements IConfigurationServic
private
remoteUserConfiguration
:
RemoteUserConfiguration
|
null
=
null
;
private
workspaceConfiguration
:
WorkspaceConfiguration
;
private
cachedFolderConfigs
:
ResourceMap
<
FolderConfiguration
>
;
private
workspaceEditingQueue
:
Queue
<
void
>
;
private
readonly
configurationFileService
:
ConfigurationFileService
;
protected
readonly
_onDidChangeConfiguration
:
Emitter
<
IConfigurationChangeEvent
>
=
this
.
_register
(
new
Emitter
<
IConfigurationChangeEvent
>
());
public
readonly
onDidChangeConfiguration
:
Event
<
IConfigurationChangeEvent
>
=
this
.
_onDidChangeConfiguration
.
event
;
...
...
@@ -66,7 +68,7 @@ export class WorkspaceService extends Disposable implements IConfigurationServic
constructor
(
{
userSettingsResource
,
remoteAuthority
,
configurationCache
}:
{
userSettingsResource
?:
URI
,
remoteAuthority
?:
string
,
configurationCache
:
IConfigurationCache
},
private
readonly
configurationFileService
:
IConfiguration
FileService
,
fileService
:
I
FileService
,
remoteAgentService
:
IRemoteAgentService
,
)
{
super
();
...
...
@@ -74,14 +76,15 @@ export class WorkspaceService extends Disposable implements IConfigurationServic
this
.
completeWorkspaceBarrier
=
new
Barrier
();
this
.
defaultConfiguration
=
new
DefaultConfigurationModel
();
this
.
configurationCache
=
configurationCache
;
this
.
configurationFileService
=
new
ConfigurationFileService
(
fileService
);
this
.
_configuration
=
new
Configuration
(
this
.
defaultConfiguration
,
new
ConfigurationModel
(),
new
ConfigurationModel
(),
new
ConfigurationModel
(),
new
ResourceMap
(),
new
ConfigurationModel
(),
new
ResourceMap
<
ConfigurationModel
>
(),
this
.
workspace
);
this
.
cachedFolderConfigs
=
new
ResourceMap
<
FolderConfiguration
>
();
if
(
userSettingsResource
)
{
this
.
localUserConfiguration
=
this
.
_register
(
new
UserConfiguration
(
userSettingsResource
,
remoteAuthority
?
LOCAL_MACHINE_SCOPES
:
undefined
,
configurationFileService
));
this
.
localUserConfiguration
=
this
.
_register
(
new
UserConfiguration
(
userSettingsResource
,
remoteAuthority
?
LOCAL_MACHINE_SCOPES
:
undefined
,
this
.
configurationFileService
));
this
.
_register
(
this
.
localUserConfiguration
.
onDidChangeConfiguration
(
userConfiguration
=>
this
.
onLocalUserConfigurationChanged
(
userConfiguration
)));
}
if
(
remoteAuthority
)
{
this
.
remoteUserConfiguration
=
this
.
_register
(
new
RemoteUserConfiguration
(
remoteAuthority
,
configurationCache
,
configurationFileService
,
remoteAgentService
));
this
.
remoteUserConfiguration
=
this
.
_register
(
new
RemoteUserConfiguration
(
remoteAuthority
,
configurationCache
,
this
.
configurationFileService
,
remoteAgentService
));
this
.
_register
(
this
.
remoteUserConfiguration
.
onDidChangeConfiguration
(
userConfiguration
=>
this
.
onRemoteUserConfigurationChanged
(
userConfiguration
)));
}
this
.
workspaceConfiguration
=
this
.
_register
(
new
WorkspaceConfiguration
(
configurationCache
,
this
.
configurationFileService
));
...
...
src/vs/workbench/services/configuration/common/configuration.ts
浏览文件 @
27ef2915
...
...
@@ -5,10 +5,10 @@
import
{
URI
}
from
'
vs/base/common/uri
'
;
import
{
IDisposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
Event
}
from
'
vs/base/common/event
'
;
import
{
FileChangesEvent
,
IFileService
}
from
'
vs/platform/files/common/files
'
;
import
{
IFileService
}
from
'
vs/platform/files/common/files
'
;
import
{
ConfigurationScope
}
from
'
vs/platform/configuration/common/configurationRegistry
'
;
export
const
USER_CONFIGURATION_KEY
=
'
settings.json
'
;
export
const
FOLDER_CONFIG_FOLDER_NAME
=
'
.vscode
'
;
export
const
FOLDER_SETTINGS_NAME
=
'
settings
'
;
export
const
FOLDER_SETTINGS_PATH
=
`
${
FOLDER_CONFIG_FOLDER_NAME
}
/
${
FOLDER_SETTINGS_NAME
}
.json`
;
...
...
@@ -42,15 +42,7 @@ export interface IConfigurationCache {
}
export
interface
IConfigurationFileService
{
readonly
onFileChanges
:
Event
<
FileChangesEvent
>
;
whenProviderRegistered
(
scheme
:
string
):
Promise
<
void
>
;
watch
(
resource
:
URI
):
IDisposable
;
exists
(
resource
:
URI
):
Promise
<
boolean
>
;
readFile
(
resource
:
URI
):
Promise
<
string
>
;
}
export
class
ConfigurationFileService
implements
IConfigurationFileService
{
export
class
ConfigurationFileService
{
constructor
(
private
readonly
fileService
:
IFileService
)
{
}
...
...
src/vs/workbench/services/configuration/test/electron-browser/configurationEditingService.test.ts
浏览文件 @
27ef2915
...
...
@@ -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
,
ConfigurationFileService
}
from
'
vs/workbench/services/configuration/common/configuration
'
;
import
{
WORKSPACE_STANDALONE_CONFIGURATIONS
}
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
'
;
...
...
@@ -107,7 +107,7 @@ suite('ConfigurationEditingService', () => {
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
(
fileService
)
,
remoteAgentService
);
const
workspaceService
=
new
WorkspaceService
({
userSettingsResource
:
environmentService
.
settingsResource
,
configurationCache
:
new
ConfigurationCache
(
environmentService
)
},
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
);
...
...
src/vs/workbench/services/configuration/test/electron-browser/configurationService.test.ts
浏览文件 @
27ef2915
...
...
@@ -42,7 +42,7 @@ 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
{
IRemoteAgentEnvironment
}
from
'
vs/platform/remote/common/remoteAgentEnvironment
'
;
import
{
IConfigurationCache
,
ConfigurationFileService
}
from
'
vs/workbench/services/configuration/common/configuration
'
;
import
{
IConfigurationCache
}
from
'
vs/workbench/services/configuration/common/configuration
'
;
import
{
VSBuffer
}
from
'
vs/base/common/buffer
'
;
import
{
SignService
}
from
'
vs/platform/sign/browser/signService
'
;
...
...
@@ -103,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
FileService
(
new
NullLogService
()
)),
new
RemoteAgentService
(
<
IWindowConfiguration
>
{},
environmentService
,
new
RemoteAuthorityResolverService
(),
new
SignService
()));
workspaceContextService
=
new
WorkspaceService
({
userSettingsResource
:
environmentService
.
settingsResource
,
configurationCache
:
new
ConfigurationCache
(
environmentService
)
},
new
FileService
(
new
NullLogService
(
)),
new
RemoteAgentService
(
<
IWindowConfiguration
>
{},
environmentService
,
new
RemoteAuthorityResolverService
(),
new
SignService
()));
return
(
<
WorkspaceService
>
workspaceContextService
).
initialize
(
convertToWorkspacePayload
(
URI
.
file
(
folderDir
)));
});
});
...
...
@@ -167,7 +167,7 @@ suite('WorkspaceContextService - Workspace', () => {
instantiationService
.
stub
(
IRemoteAgentService
,
remoteAgentService
);
const
fileService
=
new
FileService
(
new
NullLogService
());
fileService
.
registerProvider
(
Schemas
.
file
,
new
DiskFileSystemProvider
(
new
NullLogService
()));
const
workspaceService
=
new
WorkspaceService
({
userSettingsResource
:
environmentService
.
settingsResource
,
configurationCache
:
new
ConfigurationCache
(
environmentService
)
},
new
ConfigurationFileService
(
fileService
)
,
remoteAgentService
);
const
workspaceService
=
new
WorkspaceService
({
userSettingsResource
:
environmentService
.
settingsResource
,
configurationCache
:
new
ConfigurationCache
(
environmentService
)
},
fileService
,
remoteAgentService
);
instantiationService
.
stub
(
IWorkspaceContextService
,
workspaceService
);
instantiationService
.
stub
(
IConfigurationService
,
workspaceService
);
...
...
@@ -225,7 +225,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
(
fileService
)
;
const
configurationFileService
=
fileService
;
const
workspaceService
=
new
WorkspaceService
({
userSettingsResource
:
environmentService
.
settingsResource
,
configurationCache
:
new
ConfigurationCache
(
environmentService
)
},
configurationFileService
,
remoteAgentService
);
instantiationService
.
stub
(
IWorkspaceContextService
,
workspaceService
);
...
...
@@ -485,7 +485,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
(
fileService
)
;
const
configurationFileService
=
fileService
;
const
workspaceService
=
new
WorkspaceService
({
userSettingsResource
:
environmentService
.
settingsResource
,
configurationCache
:
new
ConfigurationCache
(
environmentService
)
},
configurationFileService
,
remoteAgentService
);
instantiationService
.
stub
(
IWorkspaceContextService
,
workspaceService
);
instantiationService
.
stub
(
IConfigurationService
,
workspaceService
);
...
...
@@ -748,7 +748,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
(
fileService
)
;
const
configurationFileService
=
fileService
;
const
workspaceService
=
new
WorkspaceService
({
userSettingsResource
:
environmentService
.
settingsResource
,
configurationCache
:
new
ConfigurationCache
(
environmentService
)
},
configurationFileService
,
remoteAgentService
);
instantiationService
.
stub
(
IWorkspaceContextService
,
workspaceService
);
instantiationService
.
stub
(
IConfigurationService
,
workspaceService
);
...
...
@@ -1075,7 +1075,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
(
fileService
)
;
const
configurationFileService
=
fileService
;
const
workspaceService
=
new
WorkspaceService
({
userSettingsResource
:
environmentService
.
settingsResource
,
configurationCache
:
new
ConfigurationCache
(
environmentService
)
},
configurationFileService
,
remoteAgentService
);
instantiationService
.
stub
(
IWorkspaceContextService
,
workspaceService
);
...
...
@@ -1476,7 +1476,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
(
fileService
)
;
const
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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录