Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
70d9efea
V
vscode
项目概览
掘金者说
/
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,发现更多精彩内容 >>
提交
70d9efea
编写于
6月 07, 2019
作者:
S
Sandeep Somavarapu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
#75079 Use URI for settings
上级
50e1c61c
变更
16
隐藏空白更改
内联
并排
Showing
16 changed file
with
34 addition
and
33 deletion
+34
-33
src/vs/code/electron-browser/sharedProcess/sharedProcessMain.ts
.../code/electron-browser/sharedProcess/sharedProcessMain.ts
+1
-1
src/vs/code/electron-main/main.ts
src/vs/code/electron-main/main.ts
+1
-1
src/vs/code/node/cliProcessMain.ts
src/vs/code/node/cliProcessMain.ts
+1
-1
src/vs/platform/environment/common/environment.ts
src/vs/platform/environment/common/environment.ts
+1
-1
src/vs/platform/environment/node/environmentService.ts
src/vs/platform/environment/node/environmentService.ts
+1
-1
src/vs/workbench/browser/web.main.ts
src/vs/workbench/browser/web.main.ts
+1
-1
src/vs/workbench/browser/web.simpleservices.ts
src/vs/workbench/browser/web.simpleservices.ts
+1
-1
src/vs/workbench/contrib/preferences/common/preferencesContribution.ts
...nch/contrib/preferences/common/preferencesContribution.ts
+1
-1
src/vs/workbench/contrib/preferences/electron-browser/preferences.contribution.ts
.../preferences/electron-browser/preferences.contribution.ts
+1
-1
src/vs/workbench/electron-browser/main.ts
src/vs/workbench/electron-browser/main.ts
+1
-1
src/vs/workbench/services/configuration/common/configurationEditingService.ts
...vices/configuration/common/configurationEditingService.ts
+1
-1
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
+16
-16
src/vs/workbench/services/keybinding/test/electron-browser/keybindingEditing.test.ts
...eybinding/test/electron-browser/keybindingEditing.test.ts
+2
-1
src/vs/workbench/services/preferences/browser/preferencesService.ts
...kbench/services/preferences/browser/preferencesService.ts
+2
-2
src/vs/workbench/services/textfile/common/textFileEditorModel.ts
...workbench/services/textfile/common/textFileEditorModel.ts
+1
-1
未找到文件。
src/vs/code/electron-browser/sharedProcess/sharedProcessMain.ts
浏览文件 @
70d9efea
...
...
@@ -98,7 +98,7 @@ async function main(server: Server, initData: ISharedProcessInitData, configurat
disposables
.
push
(
logService
);
logService
.
info
(
'
main
'
,
JSON
.
stringify
(
configuration
));
const
configurationService
=
new
ConfigurationService
(
environmentService
.
appSettingsP
ath
);
const
configurationService
=
new
ConfigurationService
(
environmentService
.
settingsResource
.
p
ath
);
disposables
.
push
(
configurationService
);
await
configurationService
.
initialize
();
...
...
src/vs/code/electron-main/main.ts
浏览文件 @
70d9efea
...
...
@@ -141,7 +141,7 @@ class CodeMain {
process
.
once
(
'
exit
'
,
()
=>
logService
.
dispose
());
services
.
set
(
ILogService
,
logService
);
services
.
set
(
IConfigurationService
,
new
ConfigurationService
(
environmentService
.
appSettingsP
ath
));
services
.
set
(
IConfigurationService
,
new
ConfigurationService
(
environmentService
.
settingsResource
.
p
ath
));
services
.
set
(
ILifecycleService
,
new
SyncDescriptor
(
LifecycleService
));
services
.
set
(
IStateService
,
new
SyncDescriptor
(
StateService
));
services
.
set
(
IRequestService
,
new
SyncDescriptor
(
RequestService
));
...
...
src/vs/code/node/cliProcessMain.ts
浏览文件 @
70d9efea
...
...
@@ -285,7 +285,7 @@ export async function main(argv: ParsedArgs): Promise<void> {
await
Promise
.
all
([
environmentService
.
appSettingsHome
,
environmentService
.
extensionsPath
].
map
(
p
=>
mkdirp
(
p
)));
const
configurationService
=
new
ConfigurationService
(
environmentService
.
appSettingsP
ath
);
const
configurationService
=
new
ConfigurationService
(
environmentService
.
settingsResource
.
p
ath
);
await
configurationService
.
initialize
();
services
.
set
(
IEnvironmentService
,
environmentService
);
...
...
src/vs/platform/environment/common/environment.ts
浏览文件 @
70d9efea
...
...
@@ -97,7 +97,7 @@ export interface IEnvironmentService {
appNameLong
:
string
;
appQuality
?:
string
;
appSettingsHome
:
string
;
appSettingsPath
:
string
;
settingsResource
:
URI
;
appKeybindingsPath
:
string
;
machineSettingsHome
:
string
;
...
...
src/vs/platform/environment/node/environmentService.ts
浏览文件 @
70d9efea
...
...
@@ -111,7 +111,7 @@ export class EnvironmentService implements IEnvironmentService {
get
appSettingsHome
():
string
{
return
path
.
join
(
this
.
userDataPath
,
'
User
'
);
}
@
memoize
get
appSettingsPath
():
string
{
return
path
.
join
(
this
.
appSettingsHome
,
'
settings.json
'
);
}
get
settingsResource
():
URI
{
return
URI
.
file
(
path
.
join
(
this
.
appSettingsHome
,
'
settings.json
'
)
);
}
@
memoize
get
machineSettingsHome
():
string
{
return
path
.
join
(
this
.
userDataPath
,
'
Machine
'
);
}
...
...
src/vs/workbench/browser/web.main.ts
浏览文件 @
70d9efea
...
...
@@ -133,7 +133,7 @@ class CodeRendererMain extends Disposable {
environmentService
.
appRoot
=
'
/web/
'
;
environmentService
.
args
=
{
_
:
[]
};
environmentService
.
appSettingsHome
=
'
/web/settings
'
;
environmentService
.
appSettingsPath
=
this
.
configuration
.
settingsUri
.
path
;
environmentService
.
settingsResource
=
this
.
configuration
.
settingsUri
;
environmentService
.
appKeybindingsPath
=
'
/web/settings/keybindings.json
'
;
environmentService
.
logsPath
=
'
/web/logs
'
;
environmentService
.
debugExtensionHost
=
{
...
...
src/vs/workbench/browser/web.simpleservices.ts
浏览文件 @
70d9efea
...
...
@@ -208,7 +208,7 @@ export class SimpleWorkbenchEnvironmentService implements IWorkbenchEnvironmentS
appNameLong
:
string
;
appQuality
?:
string
;
appSettingsHome
:
string
;
appSettingsPath
:
string
;
settingsResource
:
URI
;
appKeybindingsPath
:
string
;
machineSettingsHome
:
string
;
machineSettingsPath
:
string
;
...
...
src/vs/workbench/contrib/preferences/common/preferencesContribution.ts
浏览文件 @
70d9efea
...
...
@@ -79,7 +79,7 @@ export class PreferencesContribution implements IWorkbenchContribution {
}
// Global User Settings File
if
(
isEqual
(
resource
,
URI
.
file
(
this
.
environmentService
.
appSettingsPath
)
,
!
isLinux
))
{
if
(
isEqual
(
resource
,
this
.
environmentService
.
settingsResource
,
!
isLinux
))
{
return
{
override
:
this
.
preferencesService
.
openGlobalSettings
(
true
,
options
,
group
)
};
}
...
...
src/vs/workbench/contrib/preferences/electron-browser/preferences.contribution.ts
浏览文件 @
70d9efea
...
...
@@ -405,7 +405,7 @@ class PreferencesActionsContribution extends Disposable implements IWorkbenchCon
dark
:
URI
.
parse
(
require
.
toUrl
(
`vs/workbench/contrib/preferences/electron-browser/media/preferences-editor-inverse.svg`
))
}
},
when
:
ResourceContextKey
.
Resource
.
isEqualTo
(
URI
.
file
(
environmentService
.
appSettingsPath
)
.
toString
()),
when
:
ResourceContextKey
.
Resource
.
isEqualTo
(
environmentService
.
settingsResource
.
toString
()),
group
:
'
navigation
'
,
order
:
1
});
...
...
src/vs/workbench/electron-browser/main.ts
浏览文件 @
70d9efea
...
...
@@ -303,7 +303,7 @@ class CodeRendererMain extends Disposable {
const
configurationFileService
=
new
ConfigurationFileService
();
configurationFileService
.
fileService
=
fileService
;
const
workspaceService
=
new
WorkspaceService
({
userSettingsResource
:
URI
.
file
(
environmentService
.
appSettingsPath
)
,
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
)
},
configurationFileService
,
remoteAgentService
);
try
{
await
workspaceService
.
initialize
(
payload
);
...
...
src/vs/workbench/services/configuration/common/configurationEditingService.ts
浏览文件 @
70d9efea
...
...
@@ -528,7 +528,7 @@ export class ConfigurationEditingService {
private
getConfigurationFileResource
(
target
:
EditableConfigurationTarget
,
config
:
IConfigurationValue
,
relativePath
:
string
,
resource
:
URI
|
null
|
undefined
):
URI
|
null
{
if
(
target
===
EditableConfigurationTarget
.
USER_LOCAL
)
{
return
URI
.
file
(
this
.
environmentService
.
appSettingsPath
)
;
return
this
.
environmentService
.
settingsResource
;
}
if
(
target
===
EditableConfigurationTarget
.
USER_REMOTE
)
{
return
this
.
remoteSettingsResource
;
...
...
src/vs/workbench/services/configuration/test/electron-browser/configurationEditingService.test.ts
浏览文件 @
70d9efea
...
...
@@ -47,7 +47,7 @@ class SettingsTestEnvironmentService extends EnvironmentService {
super
(
args
,
_execPath
);
}
get
appSettingsPath
():
string
{
return
this
.
customAppSettingsHome
;
}
get
settingsResource
():
URI
{
return
URI
.
file
(
this
.
customAppSettingsHome
)
;
}
}
suite
(
'
ConfigurationEditingService
'
,
()
=>
{
...
...
@@ -105,7 +105,7 @@ suite('ConfigurationEditingService', () => {
instantiationService
.
stub
(
IEnvironmentService
,
environmentService
);
const
remoteAgentService
=
instantiationService
.
createInstance
(
RemoteAgentService
,
{});
instantiationService
.
stub
(
IRemoteAgentService
,
remoteAgentService
);
const
workspaceService
=
new
WorkspaceService
({
userSettingsResource
:
URI
.
file
(
environmentService
.
appSettingsPath
)
,
configurationCache
:
new
ConfigurationCache
(
environmentService
)
},
new
ConfigurationFileService
(),
remoteAgentService
);
const
workspaceService
=
new
WorkspaceService
({
userSettingsResource
:
environmentService
.
settingsResource
,
configurationCache
:
new
ConfigurationCache
(
environmentService
)
},
new
ConfigurationFileService
(),
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
浏览文件 @
70d9efea
...
...
@@ -52,7 +52,7 @@ class SettingsTestEnvironmentService extends EnvironmentService {
super
(
args
,
_execPath
);
}
get
appSettingsPath
():
string
{
return
this
.
customAppSettingsHome
;
}
get
settingsResource
():
URI
{
return
URI
.
file
(
this
.
customAppSettingsHome
)
;
}
}
function
setUpFolderWorkspace
(
folderName
:
string
):
Promise
<
{
parentDir
:
string
,
folderDir
:
string
}
>
{
...
...
@@ -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
:
URI
.
file
(
environmentService
.
appSettingsPath
)
,
configurationCache
:
new
ConfigurationCache
(
environmentService
)
},
new
ConfigurationFileService
(),
new
RemoteAgentService
(
<
IWindowConfiguration
>
{},
environmentService
,
new
RemoteAuthorityResolverService
()));
workspaceContextService
=
new
WorkspaceService
({
userSettingsResource
:
environmentService
.
settingsResource
,
configurationCache
:
new
ConfigurationCache
(
environmentService
)
},
new
ConfigurationFileService
(),
new
RemoteAgentService
(
<
IWindowConfiguration
>
{},
environmentService
,
new
RemoteAuthorityResolverService
()));
return
(
<
WorkspaceService
>
workspaceContextService
).
initialize
(
convertToWorkspacePayload
(
URI
.
file
(
folderDir
)));
});
});
...
...
@@ -165,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
:
URI
.
file
(
environmentService
.
appSettingsPath
)
,
configurationCache
:
new
ConfigurationCache
(
environmentService
)
},
new
ConfigurationFileService
(),
remoteAgentService
);
const
workspaceService
=
new
WorkspaceService
({
userSettingsResource
:
environmentService
.
settingsResource
,
configurationCache
:
new
ConfigurationCache
(
environmentService
)
},
new
ConfigurationFileService
(),
remoteAgentService
);
instantiationService
.
stub
(
IWorkspaceContextService
,
workspaceService
);
instantiationService
.
stub
(
IConfigurationService
,
workspaceService
);
...
...
@@ -225,7 +225,7 @@ suite('WorkspaceContextService - Workspace Editing', () => {
fileService
.
registerProvider
(
Schemas
.
file
,
new
DiskFileSystemProvider
(
new
NullLogService
()));
const
configurationFileService
=
new
ConfigurationFileService
();
configurationFileService
.
fileService
=
fileService
;
const
workspaceService
=
new
WorkspaceService
({
userSettingsResource
:
URI
.
file
(
environmentService
.
appSettingsPath
)
,
configurationCache
:
new
ConfigurationCache
(
environmentService
)
},
configurationFileService
,
remoteAgentService
);
const
workspaceService
=
new
WorkspaceService
({
userSettingsResource
:
environmentService
.
settingsResource
,
configurationCache
:
new
ConfigurationCache
(
environmentService
)
},
configurationFileService
,
remoteAgentService
);
instantiationService
.
stub
(
IWorkspaceContextService
,
workspaceService
);
instantiationService
.
stub
(
IConfigurationService
,
workspaceService
);
...
...
@@ -486,7 +486,7 @@ suite('WorkspaceService - Initialization', () => {
fileService
.
registerProvider
(
Schemas
.
file
,
new
DiskFileSystemProvider
(
new
NullLogService
()));
const
configurationFileService
=
new
ConfigurationFileService
();
configurationFileService
.
fileService
=
fileService
;
const
workspaceService
=
new
WorkspaceService
({
userSettingsResource
:
URI
.
file
(
environmentService
.
appSettingsPath
)
,
configurationCache
:
new
ConfigurationCache
(
environmentService
)
},
configurationFileService
,
remoteAgentService
);
const
workspaceService
=
new
WorkspaceService
({
userSettingsResource
:
environmentService
.
settingsResource
,
configurationCache
:
new
ConfigurationCache
(
environmentService
)
},
configurationFileService
,
remoteAgentService
);
instantiationService
.
stub
(
IWorkspaceContextService
,
workspaceService
);
instantiationService
.
stub
(
IConfigurationService
,
workspaceService
);
instantiationService
.
stub
(
IEnvironmentService
,
environmentService
);
...
...
@@ -750,7 +750,7 @@ suite('WorkspaceConfigurationService - Folder', () => {
fileService
.
registerProvider
(
Schemas
.
file
,
new
DiskFileSystemProvider
(
new
NullLogService
()));
const
configurationFileService
=
new
ConfigurationFileService
();
configurationFileService
.
fileService
=
fileService
;
const
workspaceService
=
new
WorkspaceService
({
userSettingsResource
:
URI
.
file
(
environmentService
.
appSettingsPath
)
,
configurationCache
:
new
ConfigurationCache
(
environmentService
)
},
configurationFileService
,
remoteAgentService
);
const
workspaceService
=
new
WorkspaceService
({
userSettingsResource
:
environmentService
.
settingsResource
,
configurationCache
:
new
ConfigurationCache
(
environmentService
)
},
configurationFileService
,
remoteAgentService
);
instantiationService
.
stub
(
IWorkspaceContextService
,
workspaceService
);
instantiationService
.
stub
(
IConfigurationService
,
workspaceService
);
instantiationService
.
stub
(
IEnvironmentService
,
environmentService
);
...
...
@@ -1078,7 +1078,7 @@ suite('WorkspaceConfigurationService-Multiroot', () => {
fileService
.
registerProvider
(
Schemas
.
file
,
new
DiskFileSystemProvider
(
new
NullLogService
()));
const
configurationFileService
=
new
ConfigurationFileService
();
configurationFileService
.
fileService
=
fileService
;
const
workspaceService
=
new
WorkspaceService
({
userSettingsResource
:
URI
.
file
(
environmentService
.
appSettingsPath
)
,
configurationCache
:
new
ConfigurationCache
(
environmentService
)
},
configurationFileService
,
remoteAgentService
);
const
workspaceService
=
new
WorkspaceService
({
userSettingsResource
:
environmentService
.
settingsResource
,
configurationCache
:
new
ConfigurationCache
(
environmentService
)
},
configurationFileService
,
remoteAgentService
);
instantiationService
.
stub
(
IWorkspaceContextService
,
workspaceService
);
instantiationService
.
stub
(
IConfigurationService
,
workspaceService
);
...
...
@@ -1108,21 +1108,21 @@ suite('WorkspaceConfigurationService-Multiroot', () => {
});
test
(
'
application settings are not read from workspace
'
,
()
=>
{
fs
.
writeFileSync
(
environmentService
.
appSetting
sPath
,
'
{ "configurationService.workspace.applicationSetting": "userValue" }
'
);
fs
.
writeFileSync
(
environmentService
.
settingsResource
.
f
sPath
,
'
{ "configurationService.workspace.applicationSetting": "userValue" }
'
);
return
jsonEditingServce
.
write
(
workspaceContextService
.
getWorkspace
().
configuration
!
,
{
key
:
'
settings
'
,
value
:
{
'
configurationService.workspace.applicationSetting
'
:
'
workspaceValue
'
}
},
true
)
.
then
(()
=>
testObject
.
reloadConfiguration
())
.
then
(()
=>
assert
.
equal
(
testObject
.
getValue
(
'
configurationService.workspace.applicationSetting
'
),
'
userValue
'
));
});
test
(
'
machine settings are not read from workspace
'
,
()
=>
{
fs
.
writeFileSync
(
environmentService
.
appSetting
sPath
,
'
{ "configurationService.workspace.machineSetting": "userValue" }
'
);
fs
.
writeFileSync
(
environmentService
.
settingsResource
.
f
sPath
,
'
{ "configurationService.workspace.machineSetting": "userValue" }
'
);
return
jsonEditingServce
.
write
(
workspaceContextService
.
getWorkspace
().
configuration
!
,
{
key
:
'
settings
'
,
value
:
{
'
configurationService.workspace.machineSetting
'
:
'
workspaceValue
'
}
},
true
)
.
then
(()
=>
testObject
.
reloadConfiguration
())
.
then
(()
=>
assert
.
equal
(
testObject
.
getValue
(
'
configurationService.workspace.machineSetting
'
),
'
userValue
'
));
});
test
(
'
workspace settings override user settings after defaults are registered
'
,
()
=>
{
fs
.
writeFileSync
(
environmentService
.
appSetting
sPath
,
'
{ "configurationService.workspace.newSetting": "userValue" }
'
);
fs
.
writeFileSync
(
environmentService
.
settingsResource
.
f
sPath
,
'
{ "configurationService.workspace.newSetting": "userValue" }
'
);
return
jsonEditingServce
.
write
(
workspaceContextService
.
getWorkspace
().
configuration
!
,
{
key
:
'
settings
'
,
value
:
{
'
configurationService.workspace.newSetting
'
:
'
workspaceValue
'
}
},
true
)
.
then
(()
=>
testObject
.
reloadConfiguration
())
.
then
(()
=>
{
...
...
@@ -1141,21 +1141,21 @@ suite('WorkspaceConfigurationService-Multiroot', () => {
});
test
(
'
application settings are not read from workspace folder
'
,
()
=>
{
fs
.
writeFileSync
(
environmentService
.
appSetting
sPath
,
'
{ "configurationService.workspace.applicationSetting": "userValue" }
'
);
fs
.
writeFileSync
(
environmentService
.
settingsResource
.
f
sPath
,
'
{ "configurationService.workspace.applicationSetting": "userValue" }
'
);
fs
.
writeFileSync
(
workspaceContextService
.
getWorkspace
().
folders
[
0
].
toResource
(
'
.vscode/settings.json
'
).
fsPath
,
'
{ "configurationService.workspace.applicationSetting": "workspaceFolderValue" }
'
);
return
testObject
.
reloadConfiguration
()
.
then
(()
=>
assert
.
equal
(
testObject
.
getValue
(
'
configurationService.workspace.applicationSetting
'
),
'
userValue
'
));
});
test
(
'
machine settings are not read from workspace folder
'
,
()
=>
{
fs
.
writeFileSync
(
environmentService
.
appSetting
sPath
,
'
{ "configurationService.workspace.machineSetting": "userValue" }
'
);
fs
.
writeFileSync
(
environmentService
.
settingsResource
.
f
sPath
,
'
{ "configurationService.workspace.machineSetting": "userValue" }
'
);
fs
.
writeFileSync
(
workspaceContextService
.
getWorkspace
().
folders
[
0
].
toResource
(
'
.vscode/settings.json
'
).
fsPath
,
'
{ "configurationService.workspace.machineSetting": "workspaceFolderValue" }
'
);
return
testObject
.
reloadConfiguration
()
.
then
(()
=>
assert
.
equal
(
testObject
.
getValue
(
'
configurationService.workspace.machineSetting
'
),
'
userValue
'
));
});
test
(
'
application settings are not read from workspace folder after defaults are registered
'
,
()
=>
{
fs
.
writeFileSync
(
environmentService
.
appSetting
sPath
,
'
{ "configurationService.workspace.testNewApplicationSetting": "userValue" }
'
);
fs
.
writeFileSync
(
environmentService
.
settingsResource
.
f
sPath
,
'
{ "configurationService.workspace.testNewApplicationSetting": "userValue" }
'
);
fs
.
writeFileSync
(
workspaceContextService
.
getWorkspace
().
folders
[
0
].
toResource
(
'
.vscode/settings.json
'
).
fsPath
,
'
{ "configurationService.workspace.testNewApplicationSetting": "workspaceFolderValue" }
'
);
return
testObject
.
reloadConfiguration
()
.
then
(()
=>
{
...
...
@@ -1175,7 +1175,7 @@ suite('WorkspaceConfigurationService-Multiroot', () => {
});
test
(
'
application settings are not read from workspace folder after defaults are registered
'
,
()
=>
{
fs
.
writeFileSync
(
environmentService
.
appSetting
sPath
,
'
{ "configurationService.workspace.testNewMachineSetting": "userValue" }
'
);
fs
.
writeFileSync
(
environmentService
.
settingsResource
.
f
sPath
,
'
{ "configurationService.workspace.testNewMachineSetting": "userValue" }
'
);
fs
.
writeFileSync
(
workspaceContextService
.
getWorkspace
().
folders
[
0
].
toResource
(
'
.vscode/settings.json
'
).
fsPath
,
'
{ "configurationService.workspace.testNewMachineSetting": "workspaceFolderValue" }
'
);
return
testObject
.
reloadConfiguration
()
.
then
(()
=>
{
...
...
@@ -1229,7 +1229,7 @@ suite('WorkspaceConfigurationService-Multiroot', () => {
assert
.
equal
(
actual
.
workspaceFolder
,
undefined
);
assert
.
equal
(
actual
.
value
,
'
isSet
'
);
fs
.
writeFileSync
(
environmentService
.
appSetting
sPath
,
'
{ "configurationService.workspace.testResourceSetting": "userValue" }
'
);
fs
.
writeFileSync
(
environmentService
.
settingsResource
.
f
sPath
,
'
{ "configurationService.workspace.testResourceSetting": "userValue" }
'
);
return
testObject
.
reloadConfiguration
()
.
then
(()
=>
{
actual
=
testObject
.
inspect
(
'
configurationService.workspace.testResourceSetting
'
);
...
...
@@ -1481,7 +1481,7 @@ suite('WorkspaceConfigurationService - Remote Folder', () => {
const
configurationFileService
=
new
ConfigurationFileService
();
configurationFileService
.
fileService
=
fileService
;
const
configurationCache
:
IConfigurationCache
=
{
read
:
()
=>
Promise
.
resolve
(
''
),
write
:
()
=>
Promise
.
resolve
(),
remove
:
()
=>
Promise
.
resolve
()
};
testObject
=
new
WorkspaceService
({
userSettingsResource
:
URI
.
file
(
environmentService
.
appSettingsPath
)
,
configurationCache
,
remoteAuthority
},
configurationFileService
,
remoteAgentService
);
testObject
=
new
WorkspaceService
({
userSettingsResource
:
environmentService
.
settingsResource
,
configurationCache
,
remoteAuthority
},
configurationFileService
,
remoteAgentService
);
instantiationService
.
stub
(
IWorkspaceContextService
,
testObject
);
instantiationService
.
stub
(
IConfigurationService
,
testObject
);
instantiationService
.
stub
(
IEnvironmentService
,
environmentService
);
...
...
src/vs/workbench/services/keybinding/test/electron-browser/keybindingEditing.test.ts
浏览文件 @
70d9efea
...
...
@@ -44,6 +44,7 @@ import { TestBackupFileService, TestContextService, TestEditorGroupsService, Tes
import
{
FileService
}
from
'
vs/workbench/services/files/common/fileService
'
;
import
{
Schemas
}
from
'
vs/base/common/network
'
;
import
{
DiskFileSystemProvider
}
from
'
vs/workbench/services/files/node/diskFileSystemProvider
'
;
import
{
URI
}
from
'
vs/base/common/uri
'
;
interface
Modifiers
{
metaKey
?:
boolean
;
...
...
@@ -65,7 +66,7 @@ suite('KeybindingsEditing', () => {
instantiationService
=
new
TestInstantiationService
();
instantiationService
.
stub
(
IEnvironmentService
,
<
IEnvironmentService
>
{
appKeybindingsPath
:
keybindingsFile
,
appSettingsPath
:
path
.
join
(
testDir
,
'
settings.json
'
)
});
instantiationService
.
stub
(
IEnvironmentService
,
<
IEnvironmentService
>
{
appKeybindingsPath
:
keybindingsFile
,
settingsResource
:
URI
.
file
(
path
.
join
(
testDir
,
'
settings.json
'
)
)
});
instantiationService
.
stub
(
IConfigurationService
,
ConfigurationService
);
instantiationService
.
stub
(
IConfigurationService
,
'
getValue
'
,
{
'
eol
'
:
'
\n
'
});
instantiationService
.
stub
(
IConfigurationService
,
'
onDidUpdateConfiguration
'
,
()
=>
{
});
...
...
src/vs/workbench/services/preferences/browser/preferencesService.ts
浏览文件 @
70d9efea
...
...
@@ -524,9 +524,9 @@ export class PreferencesService extends Disposable implements IPreferencesServic
switch
(
configurationTarget
)
{
case
ConfigurationTarget
.
USER
:
case
ConfigurationTarget
.
USER_LOCAL
:
return
URI
.
file
(
this
.
environmentService
.
appSettingsPath
)
;
return
this
.
environmentService
.
settingsResource
;
case
ConfigurationTarget
.
USER_REMOTE
:
return
URI
.
file
(
this
.
environmentService
.
appSettingsPath
)
;
return
this
.
environmentService
.
settingsResource
;
case
ConfigurationTarget
.
WORKSPACE
:
if
(
this
.
contextService
.
getWorkbenchState
()
===
WorkbenchState
.
EMPTY
)
{
return
null
;
...
...
src/vs/workbench/services/textfile/common/textFileEditorModel.ts
浏览文件 @
70d9efea
...
...
@@ -783,7 +783,7 @@ export class TextFileEditorModel extends BaseTextEditorModel implements ITextFil
}
// Check for global settings file
if
(
isEqual
(
this
.
resource
,
URI
.
file
(
this
.
environmentService
.
appSettingsPath
)
,
!
isLinux
))
{
if
(
isEqual
(
this
.
resource
,
this
.
environmentService
.
settingsResource
,
!
isLinux
))
{
return
'
global-settings
'
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录