Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
9676646c
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,发现更多精彩内容 >>
未验证
提交
9676646c
编写于
10月 23, 2020
作者:
R
Rob Lourens
提交者:
GitHub
10月 23, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #108120 from ryanclarke:106737-enumdescriptions-in-settings-ui
Add new property to IConfigurationPropertySchema
上级
e4e12adc
f59bbd42
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
20 addition
and
12 deletion
+20
-12
src/vs/platform/configuration/common/configurationRegistry.ts
...vs/platform/configuration/common/configurationRegistry.ts
+1
-0
src/vs/workbench/contrib/files/browser/files.contribution.ts
src/vs/workbench/contrib/files/browser/files.contribution.ts
+2
-1
src/vs/workbench/contrib/preferences/browser/settingsTree.ts
src/vs/workbench/contrib/preferences/browser/settingsTree.ts
+14
-10
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
+2
-1
未找到文件。
src/vs/platform/configuration/common/configurationRegistry.ts
浏览文件 @
9676646c
...
...
@@ -113,6 +113,7 @@ export interface IConfigurationPropertySchema extends IJSONSchema {
included
?:
boolean
;
tags
?:
string
[];
disallowSyncIgnore
?:
boolean
;
enumItemLabels
?:
string
[];
}
export
interface
IConfigurationExtensionInfo
{
...
...
src/vs/workbench/contrib/files/browser/files.contribution.ts
浏览文件 @
9676646c
...
...
@@ -248,7 +248,8 @@ configurationRegistry.registerConfiguration({
'
default
'
:
'
utf8
'
,
'
description
'
:
nls
.
localize
(
'
encoding
'
,
"
The default character set encoding to use when reading and writing files. This setting can also be configured per language.
"
),
'
scope
'
:
ConfigurationScope
.
LANGUAGE_OVERRIDABLE
,
'
enumDescriptions
'
:
Object
.
keys
(
SUPPORTED_ENCODINGS
).
map
(
key
=>
SUPPORTED_ENCODINGS
[
key
].
labelLong
)
'
enumDescriptions
'
:
Object
.
keys
(
SUPPORTED_ENCODINGS
).
map
(
key
=>
SUPPORTED_ENCODINGS
[
key
].
labelLong
),
'
enumItemLabels
'
:
Object
.
keys
(
SUPPORTED_ENCODINGS
).
map
(
key
=>
SUPPORTED_ENCODINGS
[
key
].
labelLong
)
},
'
files.autoGuessEncoding
'
:
{
'
type
'
:
'
boolean
'
,
...
...
src/vs/workbench/contrib/preferences/browser/settingsTree.ts
浏览文件 @
9676646c
...
...
@@ -1318,6 +1318,7 @@ export class SettingEnumRenderer extends AbstractSettingRenderer implements ITre
}
protected
renderValue
(
dataElement
:
SettingsTreeSettingElement
,
template
:
ISettingEnumItemTemplate
,
onChange
:
(
value
:
string
)
=>
void
):
void
{
const
enumItemLabels
=
dataElement
.
setting
.
enumItemLabels
;
const
enumDescriptions
=
dataElement
.
setting
.
enumDescriptions
;
const
enumDescriptionsAreMarkdown
=
dataElement
.
setting
.
enumDescriptionsAreMarkdown
;
...
...
@@ -1327,17 +1328,20 @@ export class SettingEnumRenderer extends AbstractSettingRenderer implements ITre
const
displayOptions
=
dataElement
.
setting
.
enum
!
.
map
(
String
)
.
map
(
escapeInvisibleChars
)
.
map
((
data
,
index
)
=>
<
ISelectOptionItem
>
{
text
:
data
,
description
:
(
enumDescriptions
&&
enumDescriptions
[
index
]
&&
(
enumDescriptionsAreMarkdown
?
fixSettingLinks
(
enumDescriptions
[
index
],
false
)
:
enumDescriptions
[
index
])),
descriptionIsMarkdown
:
enumDescriptionsAreMarkdown
,
descriptionMarkdownActionHandler
:
{
callback
:
(
content
)
=>
{
this
.
_openerService
.
open
(
content
).
catch
(
onUnexpectedError
);
.
map
((
data
,
index
)
=>
{
const
description
=
(
enumDescriptions
&&
enumDescriptions
[
index
]
&&
(
enumDescriptionsAreMarkdown
?
fixSettingLinks
(
enumDescriptions
[
index
],
false
)
:
enumDescriptions
[
index
]));
return
<
ISelectOptionItem
>
{
text
:
enumItemLabels
&&
enumItemLabels
[
index
]
?
enumItemLabels
[
index
]
:
data
,
description
:
enumItemLabels
&&
enumItemLabels
[
index
]
?
`[
${
data
}
]
${
description
}
`
:
description
,
descriptionIsMarkdown
:
enumDescriptionsAreMarkdown
,
descriptionMarkdownActionHandler
:
{
callback
:
(
content
)
=>
{
this
.
_openerService
.
open
(
content
).
catch
(
onUnexpectedError
);
},
disposeables
:
disposables
},
disposeables
:
disposables
},
decoratorRight
:
(
data
===
dataElement
.
defaultValue
?
localize
(
'
settings.Default
'
,
"
default
"
)
:
''
)
decoratorRight
:
(
data
===
dataElement
.
defaultValue
?
localize
(
'
settings.Default
'
,
"
default
"
)
:
''
)
};
});
template
.
selectBox
.
setOptions
(
displayOptions
);
...
...
src/vs/workbench/services/preferences/common/preferences.ts
浏览文件 @
9676646c
...
...
@@ -76,6 +76,7 @@ export interface ISetting {
disallowSyncIgnore
?:
boolean
;
extensionInfo
?:
IConfigurationExtensionInfo
;
validator
?:
(
value
:
any
)
=>
string
|
null
;
enumItemLabels
?:
string
[];
}
export
interface
IExtensionSetting
extends
ISetting
{
...
...
src/vs/workbench/services/preferences/common/preferencesModels.ts
浏览文件 @
9676646c
...
...
@@ -646,7 +646,8 @@ export class DefaultSettings extends Disposable {
extensionInfo
:
extensionInfo
,
deprecationMessage
:
prop
.
markdownDeprecationMessage
||
prop
.
deprecationMessage
,
deprecationMessageIsMarkdown
:
!!
prop
.
markdownDeprecationMessage
,
validator
:
createValidator
(
prop
)
validator
:
createValidator
(
prop
),
enumItemLabels
:
prop
.
enumItemLabels
});
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录