Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
63c6a02b
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,发现更多精彩内容 >>
提交
63c6a02b
编写于
3月 27, 2020
作者:
R
Rob Lourens
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add sync ignored label to unsynced settings
Fix #90977
上级
df069b0e
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
51 addition
and
2 deletion
+51
-2
src/vs/workbench/contrib/preferences/browser/media/settingsEditor2.css
...nch/contrib/preferences/browser/media/settingsEditor2.css
+12
-1
src/vs/workbench/contrib/preferences/browser/settingsTree.ts
src/vs/workbench/contrib/preferences/browser/settingsTree.ts
+39
-1
未找到文件。
src/vs/workbench/contrib/preferences/browser/media/settingsEditor2.css
浏览文件 @
63c6a02b
...
...
@@ -314,8 +314,19 @@
}
.settings-editor
>
.settings-body
>
.settings-tree-container
.setting-item-contents
.setting-item-title
.setting-item-overrides
{
opacity
:
0.
5
;
opacity
:
0.
9
;
font-style
:
italic
;
margin-right
:
4px
;
}
.settings-editor
>
.settings-body
>
.settings-tree-container
.setting-item-contents
.setting-item-title
.setting-item-ignored
{
opacity
:
0.9
;
font-style
:
italic
;
}
.settings-editor
>
.settings-body
>
.settings-tree-container
.setting-item-contents
.setting-item-title
.setting-item-ignored
.codicon
{
vertical-align
:
text-top
;
padding-left
:
1px
;
}
.settings-editor
>
.settings-body
>
.settings-tree-container
.setting-item-contents
.setting-item-title
.setting-item-overrides
a
.modified-scope
{
...
...
src/vs/workbench/contrib/preferences/browser/settingsTree.ts
浏览文件 @
63c6a02b
...
...
@@ -50,6 +50,7 @@ import { SETTINGS_EDITOR_COMMAND_SHOW_CONTEXT_MENU } from 'vs/workbench/contrib/
import
{
IWorkbenchEnvironmentService
}
from
'
vs/workbench/services/environment/common/environmentService
'
;
import
{
ISetting
,
ISettingsGroup
,
SettingValueType
}
from
'
vs/workbench/services/preferences/common/preferences
'
;
import
{
IUserDataSyncEnablementService
,
getDefaultIgnoredSettings
}
from
'
vs/platform/userDataSync/common/userDataSync
'
;
import
{
CodiconLabel
}
from
'
vs/base/browser/ui/codiconLabel/codiconLabel
'
;
const
$
=
DOM
.
$
;
...
...
@@ -204,6 +205,7 @@ interface ISettingItemTemplate<T = any> extends IDisposableTemplate {
controlElement
:
HTMLElement
;
deprecationWarningElement
:
HTMLElement
;
otherOverridesElement
:
HTMLElement
;
syncIgnoredElement
:
HTMLElement
;
toolbar
:
ToolBar
;
elementDisposables
:
IDisposable
[];
}
...
...
@@ -300,6 +302,10 @@ export abstract class AbstractSettingRenderer extends Disposable implements ITre
private
readonly
_onDidFocusSetting
=
this
.
_register
(
new
Emitter
<
SettingsTreeSettingElement
>
());
readonly
onDidFocusSetting
:
Event
<
SettingsTreeSettingElement
>
=
this
.
_onDidFocusSetting
.
event
;
private
ignoredSettings
:
string
[];
private
readonly
_onDidChangeIgnoredSettings
=
this
.
_register
(
new
Emitter
<
void
>
());
readonly
onDidChangeIgnoredSettings
:
Event
<
void
>
=
this
.
_onDidChangeIgnoredSettings
.
event
;
// Put common injections back here
constructor
(
private
readonly
settingActions
:
IAction
[],
...
...
@@ -311,8 +317,17 @@ export abstract class AbstractSettingRenderer extends Disposable implements ITre
@
ICommandService
protected
readonly
_commandService
:
ICommandService
,
@
IContextMenuService
protected
readonly
_contextMenuService
:
IContextMenuService
,
@
IKeybindingService
protected
readonly
_keybindingService
:
IKeybindingService
,
@
IConfigurationService
protected
readonly
_configService
:
IConfigurationService
,
)
{
super
();
this
.
ignoredSettings
=
getIgnoredSettings
(
getDefaultIgnoredSettings
(),
this
.
_configService
);
this
.
_register
(
this
.
_configService
.
onDidChangeConfiguration
(
e
=>
{
if
(
e
.
affectedKeys
.
includes
(
'
sync.ignoredSettings
'
))
{
this
.
ignoredSettings
=
getIgnoredSettings
(
getDefaultIgnoredSettings
(),
this
.
_configService
);
this
.
_onDidChangeIgnoredSettings
.
fire
();
}
}));
}
renderTemplate
(
container
:
HTMLElement
):
any
{
...
...
@@ -323,6 +338,14 @@ export abstract class AbstractSettingRenderer extends Disposable implements ITre
throw
new
Error
(
'
to override
'
);
}
protected
createSyncIgnoredElement
(
container
:
HTMLElement
):
HTMLElement
{
const
syncIgnoredElement
=
DOM
.
append
(
container
,
$
(
'
span.setting-item-ignored
'
));
const
syncIgnoredLabel
=
new
CodiconLabel
(
syncIgnoredElement
);
syncIgnoredLabel
.
text
=
`($(eye-closed)
${
localize
(
'
extensionSyncIgnoredLabel
'
,
'
Sync: Ignored
'
)}
)`
;
return
syncIgnoredElement
;
}
protected
renderCommonTemplate
(
tree
:
any
,
_container
:
HTMLElement
,
typeClass
:
string
):
ISettingItemTemplate
{
DOM
.
addClass
(
_container
,
'
setting-item
'
);
DOM
.
addClass
(
_container
,
'
setting-item-
'
+
typeClass
);
...
...
@@ -333,6 +356,8 @@ export abstract class AbstractSettingRenderer extends Disposable implements ITre
const
categoryElement
=
DOM
.
append
(
labelCategoryContainer
,
$
(
'
span.setting-item-category
'
));
const
labelElement
=
DOM
.
append
(
labelCategoryContainer
,
$
(
'
span.setting-item-label
'
));
const
otherOverridesElement
=
DOM
.
append
(
titleElement
,
$
(
'
span.setting-item-overrides
'
));
const
syncIgnoredElement
=
this
.
createSyncIgnoredElement
(
titleElement
);
const
descriptionElement
=
DOM
.
append
(
container
,
$
(
'
.setting-item-description
'
));
const
modifiedIndicatorElement
=
DOM
.
append
(
container
,
$
(
'
.setting-item-modified-indicator
'
));
modifiedIndicatorElement
.
title
=
localize
(
'
modified
'
,
"
Modified
"
);
...
...
@@ -358,6 +383,7 @@ export abstract class AbstractSettingRenderer extends Disposable implements ITre
controlElement
,
deprecationWarningElement
,
otherOverridesElement
,
syncIgnoredElement
,
toolbar
};
...
...
@@ -447,8 +473,10 @@ export abstract class AbstractSettingRenderer extends Disposable implements ITre
template
.
descriptionElement
.
id
=
baseId
+
'
_setting_description
'
;
template
.
otherOverridesElement
.
innerHTML
=
''
;
template
.
otherOverridesElement
.
style
.
display
=
'
none
'
;
if
(
element
.
overriddenScopeList
.
length
)
{
template
.
otherOverridesElement
.
style
.
display
=
'
inline
'
;
const
otherOverridesLabel
=
element
.
isConfigured
?
localize
(
'
alsoConfiguredIn
'
,
"
Also modified in
"
)
:
localize
(
'
configuredIn
'
,
"
Modified in
"
);
...
...
@@ -482,6 +510,14 @@ export abstract class AbstractSettingRenderer extends Disposable implements ITre
DOM
.
toggleClass
(
template
.
containerElement
,
'
is-deprecated
'
,
!!
deprecationText
);
this
.
renderValue
(
element
,
<
ISettingItemTemplate
>
template
,
onChange
);
const
update
=
()
=>
{
template
.
syncIgnoredElement
.
style
.
display
=
this
.
ignoredSettings
.
includes
(
element
.
setting
.
key
)
?
'
inline
'
:
'
none
'
;
};
update
();
template
.
elementDisposables
.
push
(
this
.
onDidChangeIgnoredSettings
(()
=>
{
update
();
}));
}
private
renderDescriptionMarkdown
(
element
:
SettingsTreeSettingElement
,
text
:
string
,
disposeables
:
DisposableStore
):
HTMLElement
{
...
...
@@ -1085,6 +1121,7 @@ export class SettingBoolRenderer extends AbstractSettingRenderer implements ITre
const
categoryElement
=
DOM
.
append
(
titleElement
,
$
(
'
span.setting-item-category
'
));
const
labelElement
=
DOM
.
append
(
titleElement
,
$
(
'
span.setting-item-label
'
));
const
otherOverridesElement
=
DOM
.
append
(
titleElement
,
$
(
'
span.setting-item-overrides
'
));
const
syncIgnoredElement
=
this
.
createSyncIgnoredElement
(
titleElement
);
const
descriptionAndValueElement
=
DOM
.
append
(
container
,
$
(
'
.setting-item-value-description
'
));
const
controlElement
=
DOM
.
append
(
descriptionAndValueElement
,
$
(
'
.setting-item-bool-control
'
));
...
...
@@ -1138,6 +1175,7 @@ export class SettingBoolRenderer extends AbstractSettingRenderer implements ITre
descriptionElement
,
deprecationWarningElement
,
otherOverridesElement
,
syncIgnoredElement
,
toolbar
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录