Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
703fb75e
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,发现更多精彩内容 >>
提交
703fb75e
编写于
7月 28, 2017
作者:
S
Sandeep Somavarapu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix #31593
上级
0a1b82ca
变更
7
显示空白变更内容
内联
并排
Showing
7 changed file
with
19 addition
and
19 deletion
+19
-19
src/vs/platform/configuration/common/configurationRegistry.ts
...vs/platform/configuration/common/configurationRegistry.ts
+2
-2
src/vs/workbench/parts/preferences/browser/preferencesRenderers.ts
...rkbench/parts/preferences/browser/preferencesRenderers.ts
+1
-1
src/vs/workbench/parts/preferences/browser/preferencesService.ts
...workbench/parts/preferences/browser/preferencesService.ts
+1
-1
src/vs/workbench/parts/preferences/common/preferencesModels.ts
...s/workbench/parts/preferences/common/preferencesModels.ts
+1
-1
src/vs/workbench/services/configuration/common/configurationModels.ts
...ench/services/configuration/common/configurationModels.ts
+3
-3
src/vs/workbench/services/configuration/node/configuration.ts
...vs/workbench/services/configuration/node/configuration.ts
+6
-6
src/vs/workbench/services/configuration/test/common/configurationModels.test.ts
...ces/configuration/test/common/configurationModels.test.ts
+5
-5
未找到文件。
src/vs/platform/configuration/common/configurationRegistry.ts
浏览文件 @
703fb75e
...
@@ -53,7 +53,7 @@ export interface IConfigurationRegistry {
...
@@ -53,7 +53,7 @@ export interface IConfigurationRegistry {
}
}
export
enum
ConfigurationScope
{
export
enum
ConfigurationScope
{
W
ORKBENCH
=
1
,
W
INDOW
=
1
,
RESOURCE
RESOURCE
}
}
...
@@ -158,7 +158,7 @@ class ConfigurationRegistry implements IConfigurationRegistry {
...
@@ -158,7 +158,7 @@ class ConfigurationRegistry implements IConfigurationRegistry {
}
}
}
}
private
validateAndRegisterProperties
(
configuration
:
IConfigurationNode
,
validate
:
boolean
=
true
,
scope
:
ConfigurationScope
=
ConfigurationScope
.
W
ORKBENCH
,
overridable
:
boolean
=
false
)
{
private
validateAndRegisterProperties
(
configuration
:
IConfigurationNode
,
validate
:
boolean
=
true
,
scope
:
ConfigurationScope
=
ConfigurationScope
.
W
INDOW
,
overridable
:
boolean
=
false
)
{
scope
=
configuration
.
scope
!==
void
0
&&
configuration
.
scope
!==
null
?
configuration
.
scope
:
scope
;
scope
=
configuration
.
scope
!==
void
0
&&
configuration
.
scope
!==
null
?
configuration
.
scope
:
scope
;
overridable
=
configuration
.
overridable
||
overridable
;
overridable
=
configuration
.
overridable
||
overridable
;
let
properties
=
configuration
.
properties
;
let
properties
=
configuration
.
properties
;
...
...
src/vs/workbench/parts/preferences/browser/preferencesRenderers.ts
浏览文件 @
703fb75e
...
@@ -1003,7 +1003,7 @@ class UnsupportedWorkbenchSettingsRenderer extends Disposable {
...
@@ -1003,7 +1003,7 @@ class UnsupportedWorkbenchSettingsRenderer extends Disposable {
const
configurationRegistry
=
Registry
.
as
<
IConfigurationRegistry
>
(
ConfigurationExtensions
.
Configuration
).
getConfigurationProperties
();
const
configurationRegistry
=
Registry
.
as
<
IConfigurationRegistry
>
(
ConfigurationExtensions
.
Configuration
).
getConfigurationProperties
();
const
folderKeys
=
this
.
configurationService
.
keys
({
resource
:
this
.
workspaceSettingsEditorModel
.
uri
}).
folder
;
const
folderKeys
=
this
.
configurationService
.
keys
({
resource
:
this
.
workspaceSettingsEditorModel
.
uri
}).
folder
;
const
workbenchKeys
=
folderKeys
.
filter
(
key
=>
configurationRegistry
[
key
]
&&
configurationRegistry
[
key
].
scope
===
ConfigurationScope
.
W
ORKBENCH
);
const
workbenchKeys
=
folderKeys
.
filter
(
key
=>
configurationRegistry
[
key
]
&&
configurationRegistry
[
key
].
scope
===
ConfigurationScope
.
W
INDOW
);
if
(
workbenchKeys
.
length
)
{
if
(
workbenchKeys
.
length
)
{
const
ranges
:
IRange
[]
=
[];
const
ranges
:
IRange
[]
=
[];
for
(
const
unsupportedKey
of
workbenchKeys
)
{
for
(
const
unsupportedKey
of
workbenchKeys
)
{
...
...
src/vs/workbench/parts/preferences/browser/preferencesService.ts
浏览文件 @
703fb75e
...
@@ -135,7 +135,7 @@ export class PreferencesService extends Disposable implements IPreferencesServic
...
@@ -135,7 +135,7 @@ export class PreferencesService extends Disposable implements IPreferencesServic
promise
=
TPromise
.
join
<
any
>
([
this
.
extensionService
.
onReady
(),
this
.
fetchMostCommonlyUsedSettings
()])
promise
=
TPromise
.
join
<
any
>
([
this
.
extensionService
.
onReady
(),
this
.
fetchMostCommonlyUsedSettings
()])
.
then
(
result
=>
{
.
then
(
result
=>
{
const
mostCommonSettings
=
result
[
1
];
const
mostCommonSettings
=
result
[
1
];
const
model
=
this
.
instantiationService
.
createInstance
(
DefaultSettingsEditorModel
,
uri
,
mostCommonSettings
,
ConfigurationScope
.
W
ORKBENCH
);
const
model
=
this
.
instantiationService
.
createInstance
(
DefaultSettingsEditorModel
,
uri
,
mostCommonSettings
,
ConfigurationScope
.
W
INDOW
);
return
model
;
return
model
;
});
});
this
.
defaultPreferencesEditorModels
.
set
(
uri
,
promise
);
this
.
defaultPreferencesEditorModels
.
set
(
uri
,
promise
);
...
...
src/vs/workbench/parts/preferences/common/preferencesModels.ts
浏览文件 @
703fb75e
...
@@ -751,7 +751,7 @@ export class DefaultSettingsEditorModel extends AbstractSettingsModel implements
...
@@ -751,7 +751,7 @@ export class DefaultSettingsEditorModel extends AbstractSettingsModel implements
}
}
private
matchesScope
(
property
:
IConfigurationNode
):
boolean
{
private
matchesScope
(
property
:
IConfigurationNode
):
boolean
{
if
(
this
.
configurationScope
===
ConfigurationScope
.
W
ORKBENCH
)
{
if
(
this
.
configurationScope
===
ConfigurationScope
.
W
INDOW
)
{
return
true
;
return
true
;
}
}
return
property
.
scope
===
this
.
configurationScope
;
return
property
.
scope
===
this
.
configurationScope
;
...
...
src/vs/workbench/services/configuration/common/configurationModels.ts
浏览文件 @
703fb75e
...
@@ -131,7 +131,7 @@ export class FolderSettingsModel<T> extends CustomConfigurationModel<T> {
...
@@ -131,7 +131,7 @@ export class FolderSettingsModel<T> extends CustomConfigurationModel<T> {
}
}
public
createWorkspaceConfigurationModel
():
ConfigurationModel
<
any
>
{
public
createWorkspaceConfigurationModel
():
ConfigurationModel
<
any
>
{
return
this
.
createScopedConfigurationModel
(
ConfigurationScope
.
W
ORKBENCH
);
return
this
.
createScopedConfigurationModel
(
ConfigurationScope
.
W
INDOW
);
}
}
public
createFolderScopedConfigurationModel
():
ConfigurationModel
<
any
>
{
public
createFolderScopedConfigurationModel
():
ConfigurationModel
<
any
>
{
...
@@ -153,7 +153,7 @@ export class FolderSettingsModel<T> extends CustomConfigurationModel<T> {
...
@@ -153,7 +153,7 @@ export class FolderSettingsModel<T> extends CustomConfigurationModel<T> {
private
getScope
(
key
:
string
,
configurationProperties
:
{
[
qualifiedKey
:
string
]:
IConfigurationPropertySchema
}):
ConfigurationScope
{
private
getScope
(
key
:
string
,
configurationProperties
:
{
[
qualifiedKey
:
string
]:
IConfigurationPropertySchema
}):
ConfigurationScope
{
const
propertySchema
=
configurationProperties
[
key
];
const
propertySchema
=
configurationProperties
[
key
];
return
propertySchema
?
propertySchema
.
scope
:
ConfigurationScope
.
W
ORKBENCH
;
return
propertySchema
?
propertySchema
.
scope
:
ConfigurationScope
.
W
INDOW
;
}
}
}
}
...
@@ -168,7 +168,7 @@ export class FolderConfigurationModel<T> extends CustomConfigurationModel<T> {
...
@@ -168,7 +168,7 @@ export class FolderConfigurationModel<T> extends CustomConfigurationModel<T> {
this
.
_contents
=
<
T
>
{};
this
.
_contents
=
<
T
>
{};
this
.
_overrides
=
[];
this
.
_overrides
=
[];
this
.
doMerge
(
this
,
ConfigurationScope
.
W
ORKBENCH
===
this
.
scope
?
this
.
workspaceSettingsConfig
:
this
.
workspaceSettingsConfig
.
createFolderScopedConfigurationModel
());
this
.
doMerge
(
this
,
ConfigurationScope
.
W
INDOW
===
this
.
scope
?
this
.
workspaceSettingsConfig
:
this
.
workspaceSettingsConfig
.
createFolderScopedConfigurationModel
());
for
(
const
configModel
of
this
.
scopedConfigs
)
{
for
(
const
configModel
of
this
.
scopedConfigs
)
{
this
.
doMerge
(
this
,
configModel
);
this
.
doMerge
(
this
,
configModel
);
}
}
...
...
src/vs/workbench/services/configuration/node/configuration.ts
浏览文件 @
703fb75e
...
@@ -79,13 +79,13 @@ const configurationExtPoint = ExtensionsRegistry.registerExtensionPoint<IConfigu
...
@@ -79,13 +79,13 @@ const configurationExtPoint = ExtensionsRegistry.registerExtensionPoint<IConfigu
},
},
scope
:
{
scope
:
{
type
:
'
string
'
,
type
:
'
string
'
,
enum
:
[
'
w
orkbench
'
,
'
resource
'
],
enum
:
[
'
w
indow
'
,
'
resource
'
],
default
:
'
w
orkbench
'
,
default
:
'
w
indow
'
,
enumDescriptions
:
[
enumDescriptions
:
[
nls
.
localize
(
'
scope.w
orkbench.description
'
,
"
Workbench
specific configuration, which can be configured in the User or Workspace settings.
"
),
nls
.
localize
(
'
scope.w
indow.description
'
,
"
Window
specific configuration, which can be configured in the User or Workspace settings.
"
),
nls
.
localize
(
'
scope.resource.description
'
,
"
Resource specific configuration, which can be configured in the User, Workspace or Folder settings.
"
)
nls
.
localize
(
'
scope.resource.description
'
,
"
Resource specific configuration, which can be configured in the User, Workspace or Folder settings.
"
)
],
],
description
:
nls
.
localize
(
'
scope.description
'
,
"
Scope in which the configuration is applicable. Available scopes are `w
orkbench
` and `resource`.
"
)
description
:
nls
.
localize
(
'
scope.description
'
,
"
Scope in which the configuration is applicable. Available scopes are `w
indow
` and `resource`.
"
)
}
}
}
}
}
}
...
@@ -158,7 +158,7 @@ function validateProperties(configuration: IConfigurationNode, collector: Extens
...
@@ -158,7 +158,7 @@ function validateProperties(configuration: IConfigurationNode, collector: Extens
for
(
let
key
in
properties
)
{
for
(
let
key
in
properties
)
{
const
message
=
validateProperty
(
key
);
const
message
=
validateProperty
(
key
);
const
propertyConfiguration
=
configuration
.
properties
[
key
];
const
propertyConfiguration
=
configuration
.
properties
[
key
];
propertyConfiguration
.
scope
=
propertyConfiguration
.
scope
&&
propertyConfiguration
.
scope
.
toString
()
===
'
resource
'
?
ConfigurationScope
.
RESOURCE
:
ConfigurationScope
.
W
ORKBENCH
;
propertyConfiguration
.
scope
=
propertyConfiguration
.
scope
&&
propertyConfiguration
.
scope
.
toString
()
===
'
resource
'
?
ConfigurationScope
.
RESOURCE
:
ConfigurationScope
.
W
INDOW
;
if
(
message
)
{
if
(
message
)
{
collector
.
warn
(
message
);
collector
.
warn
(
message
);
delete
properties
[
key
];
delete
properties
[
key
];
...
@@ -499,7 +499,7 @@ export class WorkspaceServiceImpl extends WorkspaceService {
...
@@ -499,7 +499,7 @@ export class WorkspaceServiceImpl extends WorkspaceService {
private
initCachesForFolders
(
folders
:
URI
[]):
void
{
private
initCachesForFolders
(
folders
:
URI
[]):
void
{
for
(
const
folder
of
folders
)
{
for
(
const
folder
of
folders
)
{
this
.
cachedFolderConfigs
.
set
(
folder
,
this
.
_register
(
new
FolderConfiguration
(
folder
,
this
.
workspaceSettingsRootFolder
,
this
.
hasMultiFolderWorkspace
()
?
ConfigurationScope
.
RESOURCE
:
ConfigurationScope
.
W
ORKBENCH
)));
this
.
cachedFolderConfigs
.
set
(
folder
,
this
.
_register
(
new
FolderConfiguration
(
folder
,
this
.
workspaceSettingsRootFolder
,
this
.
hasMultiFolderWorkspace
()
?
ConfigurationScope
.
RESOURCE
:
ConfigurationScope
.
W
INDOW
)));
this
.
updateFolderConfiguration
(
folder
,
new
FolderConfigurationModel
<
any
>
(
new
FolderSettingsModel
<
any
>
(
null
),
[],
ConfigurationScope
.
RESOURCE
),
false
);
this
.
updateFolderConfiguration
(
folder
,
new
FolderConfigurationModel
<
any
>
(
new
FolderSettingsModel
<
any
>
(
null
),
[],
ConfigurationScope
.
RESOURCE
),
false
);
}
}
}
}
...
...
src/vs/workbench/services/configuration/test/common/configurationModels.test.ts
浏览文件 @
703fb75e
...
@@ -15,7 +15,7 @@ suite('ConfigurationService - Model', () => {
...
@@ -15,7 +15,7 @@ suite('ConfigurationService - Model', () => {
awesome
:
true
awesome
:
true
}));
}));
const
testObject
=
new
FolderConfigurationModel
(
settingsConfig
,
[],
ConfigurationScope
.
W
ORKBENCH
);
const
testObject
=
new
FolderConfigurationModel
(
settingsConfig
,
[],
ConfigurationScope
.
W
INDOW
);
assert
.
equal
(
testObject
.
getContentsFor
(
'
task
'
),
undefined
);
assert
.
equal
(
testObject
.
getContentsFor
(
'
task
'
),
undefined
);
});
});
...
@@ -36,7 +36,7 @@ suite('ConfigurationService - Model', () => {
...
@@ -36,7 +36,7 @@ suite('ConfigurationService - Model', () => {
}
}
};
};
assert
.
deepEqual
(
new
FolderConfigurationModel
(
settingsConfig
,
[
tasksConfig
],
ConfigurationScope
.
W
ORKBENCH
).
contents
,
expected
);
assert
.
deepEqual
(
new
FolderConfigurationModel
(
settingsConfig
,
[
tasksConfig
],
ConfigurationScope
.
W
INDOW
).
contents
,
expected
);
});
});
test
(
'
Test consolidate (settings and launch)
'
,
()
=>
{
test
(
'
Test consolidate (settings and launch)
'
,
()
=>
{
...
@@ -55,7 +55,7 @@ suite('ConfigurationService - Model', () => {
...
@@ -55,7 +55,7 @@ suite('ConfigurationService - Model', () => {
}
}
};
};
assert
.
deepEqual
(
new
FolderConfigurationModel
(
settingsConfig
,
[
launchConfig
],
ConfigurationScope
.
W
ORKBENCH
).
contents
,
expected
);
assert
.
deepEqual
(
new
FolderConfigurationModel
(
settingsConfig
,
[
launchConfig
],
ConfigurationScope
.
W
INDOW
).
contents
,
expected
);
});
});
test
(
'
Test consolidate (settings and launch and tasks) - launch/tasks wins over settings file
'
,
()
=>
{
test
(
'
Test consolidate (settings and launch and tasks) - launch/tasks wins over settings file
'
,
()
=>
{
...
@@ -91,7 +91,7 @@ suite('ConfigurationService - Model', () => {
...
@@ -91,7 +91,7 @@ suite('ConfigurationService - Model', () => {
}
}
};
};
assert
.
deepEqual
(
new
FolderConfigurationModel
(
settingsConfig
,
[
launchConfig
,
tasksConfig
],
ConfigurationScope
.
W
ORKBENCH
).
contents
,
expected
);
assert
.
deepEqual
(
new
FolderConfigurationModel
(
settingsConfig
,
[
launchConfig
,
tasksConfig
],
ConfigurationScope
.
W
INDOW
).
contents
,
expected
);
assert
.
deepEqual
(
new
FolderConfigurationModel
(
settingsConfig
,
[
tasksConfig
,
launchConfig
],
ConfigurationScope
.
W
ORKBENCH
).
contents
,
expected
);
assert
.
deepEqual
(
new
FolderConfigurationModel
(
settingsConfig
,
[
tasksConfig
,
launchConfig
],
ConfigurationScope
.
W
INDOW
).
contents
,
expected
);
});
});
});
});
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录