Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
cc311ee1
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,发现更多精彩内容 >>
未验证
提交
cc311ee1
编写于
6月 25, 2018
作者:
R
Rob Lourens
提交者:
GitHub
6月 25, 2018
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #52649 from Microsoft/roblou/extSettings
Track which settings were contributed by extensions
上级
9719d316
c7f17d53
变更
7
显示空白变更内容
内联
并排
Showing
7 changed file
with
40 addition
and
14 deletion
+40
-14
src/vs/platform/configuration/common/configurationRegistry.ts
...vs/platform/configuration/common/configurationRegistry.ts
+1
-0
src/vs/workbench/parts/preferences/browser/settingsEditor2.ts
...vs/workbench/parts/preferences/browser/settingsEditor2.ts
+7
-3
src/vs/workbench/parts/preferences/browser/settingsLayout.ts
src/vs/workbench/parts/preferences/browser/settingsLayout.ts
+0
-5
src/vs/workbench/parts/preferences/browser/settingsTree.ts
src/vs/workbench/parts/preferences/browser/settingsTree.ts
+25
-2
src/vs/workbench/services/configuration/common/configurationExtensionPoint.ts
...vices/configuration/common/configurationExtensionPoint.ts
+2
-1
src/vs/workbench/services/preferences/common/preferences.ts
src/vs/workbench/services/preferences/common/preferences.ts
+1
-0
src/vs/workbench/services/preferences/common/preferencesModels.ts
...orkbench/services/preferences/common/preferencesModels.ts
+4
-3
未找到文件。
src/vs/platform/configuration/common/configurationRegistry.ts
浏览文件 @
cc311ee1
...
...
@@ -84,6 +84,7 @@ export interface IConfigurationNode {
allOf
?:
IConfigurationNode
[];
overridable
?:
boolean
;
scope
?:
ConfigurationScope
;
contributedByExtension
?:
boolean
;
}
export
interface
IDefaultConfigurationExtension
{
...
...
src/vs/workbench/parts/preferences/browser/settingsEditor2.ts
浏览文件 @
cc311ee1
...
...
@@ -6,6 +6,7 @@
import
*
as
DOM
from
'
vs/base/browser/dom
'
;
import
{
Button
}
from
'
vs/base/browser/ui/button/button
'
;
import
*
as
arrays
from
'
vs/base/common/arrays
'
;
import
*
as
collections
from
'
vs/base/common/collections
'
;
import
{
Delayer
,
ThrottledDelayer
}
from
'
vs/base/common/async
'
;
import
{
CancellationToken
}
from
'
vs/base/common/cancellation
'
;
import
{
Color
}
from
'
vs/base/common/color
'
;
...
...
@@ -30,7 +31,7 @@ import { BaseEditor } from 'vs/workbench/browser/parts/editor/baseEditor';
import
{
EditorOptions
,
IEditor
}
from
'
vs/workbench/common/editor
'
;
import
{
SearchWidget
,
SettingsTarget
,
SettingsTargetsWidget
}
from
'
vs/workbench/parts/preferences/browser/preferencesWidgets
'
;
import
{
tocData
,
commonlyUsedData
}
from
'
vs/workbench/parts/preferences/browser/settingsLayout
'
;
import
{
ISettingsEditorViewState
,
SearchResultIdx
,
SearchResultModel
,
SettingsAccessibilityProvider
,
SettingsDataSource
,
SettingsRenderer
,
SettingsTreeController
,
SettingsTreeElement
,
SettingsTreeFilter
,
SettingsTreeModel
,
SettingsTreeSettingElement
,
SettingsTreeGroupElement
,
resolveSettingsTree
,
NonExpandableTree
}
from
'
vs/workbench/parts/preferences/browser/settingsTree
'
;
import
{
ISettingsEditorViewState
,
SearchResultIdx
,
SearchResultModel
,
SettingsAccessibilityProvider
,
SettingsDataSource
,
SettingsRenderer
,
SettingsTreeController
,
SettingsTreeElement
,
SettingsTreeFilter
,
SettingsTreeModel
,
SettingsTreeSettingElement
,
SettingsTreeGroupElement
,
resolveSettingsTree
,
NonExpandableTree
,
resolveExtensionsSettings
}
from
'
vs/workbench/parts/preferences/browser/settingsTree
'
;
import
{
TOCDataSource
,
TOCRenderer
,
TOCTreeModel
}
from
'
vs/workbench/parts/preferences/browser/tocTree
'
;
import
{
CONTEXT_SETTINGS_EDITOR
,
CONTEXT_SETTINGS_SEARCH_FOCUS
,
IPreferencesSearchService
,
ISearchProvider
}
from
'
vs/workbench/parts/preferences/common/preferences
'
;
import
{
IPreferencesService
,
ISearchResult
,
ISettingsEditorModel
}
from
'
vs/workbench/services/preferences/common/preferences
'
;
...
...
@@ -486,10 +487,13 @@ export class SettingsEditor2 extends BaseEditor {
private
onConfigUpdate
():
TPromise
<
void
>
{
const
groups
=
this
.
defaultSettingsEditorModel
.
settingsGroups
.
slice
(
1
);
// Without commonlyUsed
const
resolvedSettingsRoot
=
resolveSettingsTree
(
tocData
,
groups
);
const
commonlyUsed
=
resolveSettingsTree
(
commonlyUsedData
,
groups
);
const
dividedGroups
=
collections
.
groupBy
(
groups
,
g
=>
g
.
contributedByExtension
?
'
extension
'
:
'
core
'
);
const
resolvedSettingsRoot
=
resolveSettingsTree
(
tocData
,
dividedGroups
.
core
);
const
commonlyUsed
=
resolveSettingsTree
(
commonlyUsedData
,
dividedGroups
.
core
);
resolvedSettingsRoot
.
children
.
unshift
(
commonlyUsed
);
resolvedSettingsRoot
.
children
.
push
(
resolveExtensionsSettings
(
dividedGroups
.
extension
||
[]));
if
(
this
.
settingsTreeModel
)
{
this
.
settingsTreeModel
.
update
(
resolvedSettingsRoot
);
}
else
{
...
...
src/vs/workbench/parts/preferences/browser/settingsLayout.ts
浏览文件 @
cc311ee1
...
...
@@ -184,11 +184,6 @@ export const tocData: ITOCEntry = {
settings
:
[
'
telemetry.*
'
]
}
]
},
{
id
:
'
extensions
'
,
label
:
localize
(
'
extensions
'
,
"
Extensions
"
),
settings
:
[
'
*
'
]
}
]
};
src/vs/workbench/parts/preferences/browser/settingsTree.ts
浏览文件 @
cc311ee1
...
...
@@ -200,8 +200,31 @@ function inspectSetting(key: string, target: SettingsTarget, configurationServic
return
{
isConfigured
,
inspected
,
targetSelector
};
}
export
function
resolveSettingsTree
(
tocData
:
ITOCEntry
,
settingsGroups
:
ISettingsGroup
[]):
ITOCEntry
{
return
_resolveSettingsTree
(
tocData
,
getFlatSettings
(
settingsGroups
));
export
function
resolveSettingsTree
(
tocData
:
ITOCEntry
,
coreSettingsGroups
:
ISettingsGroup
[]):
ITOCEntry
{
return
_resolveSettingsTree
(
tocData
,
getFlatSettings
(
coreSettingsGroups
));
}
export
function
resolveExtensionsSettings
(
groups
:
ISettingsGroup
[]):
ITOCEntry
{
const
settingsGroupToEntry
=
(
group
:
ISettingsGroup
)
=>
{
const
flatSettings
=
arrays
.
flatten
(
group
.
sections
.
map
(
section
=>
section
.
settings
));
return
{
id
:
group
.
id
,
label
:
group
.
title
,
settings
:
flatSettings
};
};
const
extGroups
=
groups
.
sort
((
a
,
b
)
=>
a
.
title
.
localeCompare
(
b
.
title
))
.
map
(
g
=>
settingsGroupToEntry
(
g
));
return
{
id
:
'
extensions
'
,
label
:
localize
(
'
extensions
'
,
"
Extensions
"
),
children
:
extGroups
};
}
function
_resolveSettingsTree
(
tocData
:
ITOCEntry
,
allSettings
:
Set
<
ISetting
>
):
ITOCEntry
{
...
...
src/vs/workbench/services/configuration/common/configurationExtensionPoint.ts
浏览文件 @
cc311ee1
...
...
@@ -106,7 +106,8 @@ configurationExtPoint.setHandler(extensions => {
validateProperties
(
configuration
,
extension
);
configuration
.
id
=
extension
.
description
.
uuid
||
extension
.
description
.
id
;
configuration
.
id
=
node
.
id
||
extension
.
description
.
uuid
||
extension
.
description
.
id
;
configuration
.
contributedByExtension
=
true
;
configuration
.
title
=
configuration
.
title
||
extension
.
description
.
displayName
||
extension
.
description
.
id
;
configurations
.
push
(
configuration
);
}
...
...
src/vs/workbench/services/preferences/common/preferences.ts
浏览文件 @
cc311ee1
...
...
@@ -25,6 +25,7 @@ export interface ISettingsGroup {
title
:
string
;
titleRange
:
IRange
;
sections
:
ISettingsSection
[];
contributedByExtension
:
boolean
;
}
export
interface
ISettingsSection
{
...
...
src/vs/workbench/services/preferences/common/preferencesModels.ts
浏览文件 @
cc311ee1
...
...
@@ -189,7 +189,8 @@ export class SettingsEditorModel extends AbstractSettingsModel implements ISetti
settings
:
filteredSettings
}],
title
:
modelGroup
.
title
,
titleRange
:
modelGroup
.
titleRange
titleRange
:
modelGroup
.
titleRange
,
contributedByExtension
:
!!
modelGroup
.
contributedByExtension
};
}
...
...
@@ -503,7 +504,7 @@ export class DefaultSettings extends Disposable {
if
(
!
settingsGroup
)
{
settingsGroup
=
result
.
filter
(
g
=>
g
.
title
===
title
)[
0
];
if
(
!
settingsGroup
)
{
settingsGroup
=
{
sections
:
[{
settings
:
[]
}],
id
:
config
.
id
,
title
:
title
,
titleRange
:
null
,
range
:
null
};
settingsGroup
=
{
sections
:
[{
settings
:
[]
}],
id
:
config
.
id
,
title
:
title
,
titleRange
:
null
,
range
:
null
,
contributedByExtension
:
!!
config
.
contributedByExtension
};
result
.
push
(
settingsGroup
);
}
}
else
{
...
...
@@ -512,7 +513,7 @@ export class DefaultSettings extends Disposable {
}
if
(
config
.
properties
)
{
if
(
!
settingsGroup
)
{
settingsGroup
=
{
sections
:
[{
settings
:
[]
}],
id
:
config
.
id
,
title
:
config
.
id
,
titleRange
:
null
,
range
:
null
};
settingsGroup
=
{
sections
:
[{
settings
:
[]
}],
id
:
config
.
id
,
title
:
config
.
id
,
titleRange
:
null
,
range
:
null
,
contributedByExtension
:
!!
config
.
contributedByExtension
};
result
.
push
(
settingsGroup
);
}
const
configurationSettings
:
ISetting
[]
=
[...
settingsGroup
.
sections
[
settingsGroup
.
sections
.
length
-
1
].
settings
,
...
this
.
parseSettings
(
config
.
properties
)];
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录