Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
30fbbd7a
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,发现更多精彩内容 >>
提交
30fbbd7a
编写于
10月 05, 2018
作者:
J
Jeremy Shore
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Makes Modified in scopes navigable
上级
ceb8f18f
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
49 addition
and
7 deletion
+49
-7
src/vs/workbench/parts/preferences/browser/preferencesWidgets.ts
...workbench/parts/preferences/browser/preferencesWidgets.ts
+1
-1
src/vs/workbench/parts/preferences/browser/settingsTree.ts
src/vs/workbench/parts/preferences/browser/settingsTree.ts
+30
-3
src/vs/workbench/parts/preferences/electron-browser/media/settingsEditor2.css
...ts/preferences/electron-browser/media/settingsEditor2.css
+5
-0
src/vs/workbench/parts/preferences/electron-browser/settingsEditor2.ts
...nch/parts/preferences/electron-browser/settingsEditor2.ts
+13
-3
未找到文件。
src/vs/workbench/parts/preferences/browser/preferencesWidgets.ts
浏览文件 @
30fbbd7a
...
...
@@ -539,7 +539,7 @@ export class SettingsTargetsWidget extends Widget {
}
}
p
rivate
updateTarget
(
settingsTarget
:
SettingsTarget
):
TPromise
<
void
>
{
p
ublic
updateTarget
(
settingsTarget
:
SettingsTarget
):
TPromise
<
void
>
{
const
isSameTarget
=
this
.
settingsTarget
===
settingsTarget
||
settingsTarget
instanceof
URI
&&
this
.
settingsTarget
instanceof
URI
&&
this
.
settingsTarget
.
toString
()
===
settingsTarget
.
toString
();
if
(
!
isSameTarget
)
{
this
.
settingsTarget
=
settingsTarget
;
...
...
src/vs/workbench/parts/preferences/browser/settingsTree.ts
浏览文件 @
30fbbd7a
...
...
@@ -339,6 +339,11 @@ export interface ISettingLinkClickEvent {
targetKey
:
string
;
}
export
interface
ISettingOverrideClickEvent
{
scope
:
string
;
targetKey
:
string
;
}
export
class
SettingsRenderer
implements
ITreeRenderer
{
public
static
readonly
CONTROL_CLASS
=
'
setting-control-focus-target
'
;
...
...
@@ -346,6 +351,9 @@ export class SettingsRenderer implements ITreeRenderer {
public
static
readonly
SETTING_KEY_ATTR
=
'
data-key
'
;
private
readonly
_onDidClickOverrideElement
:
Emitter
<
ISettingOverrideClickEvent
>
=
new
Emitter
<
ISettingOverrideClickEvent
>
();
public
readonly
onDidClickOverrideElement
:
Event
<
ISettingOverrideClickEvent
>
=
this
.
_onDidClickOverrideElement
.
event
;
private
readonly
_onDidChangeSetting
:
Emitter
<
ISettingChangeEvent
>
=
new
Emitter
<
ISettingChangeEvent
>
();
public
readonly
onDidChangeSetting
:
Event
<
ISettingChangeEvent
>
=
this
.
_onDidChangeSetting
.
event
;
...
...
@@ -1059,14 +1067,33 @@ export class SettingsRenderer implements ITreeRenderer {
template
.
descriptionElement
.
setAttribute
(
'
checkbox_label_target_id
'
,
baseId
+
'
_setting_item
'
);
}
template
.
otherOverridesElement
.
innerHTML
=
''
;
if
(
element
.
overriddenScopeList
.
length
)
{
const
otherOverridesLabel
=
element
.
isConfigured
?
localize
(
'
alsoConfiguredIn
'
,
"
Also modified in
"
)
:
localize
(
'
configuredIn
'
,
"
Modified in
"
);
template
.
otherOverridesElement
.
textContent
=
`(
${
otherOverridesLabel
}
:
${
element
.
overriddenScopeList
.
join
(
'
,
'
)}
)`
;
}
else
{
template
.
otherOverridesElement
.
textContent
=
''
;
DOM
.
append
(
template
.
otherOverridesElement
,
$
(
'
span
'
,
null
,
`(
${
otherOverridesLabel
}
: `
));
for
(
let
i
=
0
;
i
<
element
.
overriddenScopeList
.
length
;
i
++
)
{
let
view
=
DOM
.
append
(
template
.
otherOverridesElement
,
$
(
'
a.modified-scope
'
,
null
,
element
.
overriddenScopeList
[
i
]));
if
(
i
!==
element
.
overriddenScopeList
.
length
-
1
)
{
DOM
.
append
(
template
.
otherOverridesElement
,
$
(
'
span
'
,
null
,
'
,
'
));
}
else
{
DOM
.
append
(
template
.
otherOverridesElement
,
$
(
'
span
'
,
null
,
'
)
'
));
}
DOM
.
addStandardDisposableListener
(
view
,
DOM
.
EventType
.
CLICK
,
(
e
:
IMouseEvent
)
=>
{
this
.
_onDidClickOverrideElement
.
fire
({
targetKey
:
element
.
setting
.
key
,
scope
:
element
.
overriddenScopeList
[
i
]
});
e
.
preventDefault
();
e
.
stopPropagation
();
});
}
}
// Remove tree attributes - sometimes overridden by tree - should be managed there
...
...
src/vs/workbench/parts/preferences/electron-browser/media/settingsEditor2.css
浏览文件 @
30fbbd7a
...
...
@@ -330,6 +330,11 @@
font-style
:
italic
;
}
.settings-editor
>
.settings-body
>
.settings-tree-container
.setting-item
.setting-item-title
.setting-item-overrides
a
.modified-scope
{
text-decoration
:
underline
;
cursor
:
pointer
;
}
.settings-editor
>
.settings-body
>
.settings-tree-container
.setting-item
.setting-item-label
{
margin-right
:
7px
;
}
...
...
src/vs/workbench/parts/preferences/electron-browser/settingsEditor2.ts
浏览文件 @
30fbbd7a
...
...
@@ -19,7 +19,7 @@ import { Tree } from 'vs/base/parts/tree/browser/treeImpl';
import
{
collapseAll
,
expandAll
}
from
'
vs/base/parts/tree/browser/treeUtils
'
;
import
'
vs/css!./media/settingsEditor2
'
;
import
{
localize
}
from
'
vs/nls
'
;
import
{
ConfigurationTarget
,
IConfigurationOverrides
,
IConfigurationService
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
ConfigurationTarget
,
IConfigurationOverrides
,
IConfigurationService
,
ConfigurationTargetToString
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
IContextKey
,
IContextKeyService
}
from
'
vs/platform/contextkey/common/contextkey
'
;
import
{
IContextMenuService
}
from
'
vs/platform/contextview/browser/contextView
'
;
import
{
IEnvironmentService
}
from
'
vs/platform/environment/common/environment
'
;
...
...
@@ -39,7 +39,7 @@ import { attachSuggestEnabledInputBoxStyler, SuggestEnabledInput } from 'vs/work
import
{
PreferencesEditor
}
from
'
vs/workbench/parts/preferences/browser/preferencesEditor
'
;
import
{
SettingsTarget
,
SettingsTargetsWidget
}
from
'
vs/workbench/parts/preferences/browser/preferencesWidgets
'
;
import
{
commonlyUsedData
,
tocData
}
from
'
vs/workbench/parts/preferences/browser/settingsLayout
'
;
import
{
ISettingLinkClickEvent
,
resolveExtensionsSettings
,
resolveSettingsTree
,
SettingsDataSource
,
SettingsRenderer
,
SettingsTree
,
SimplePagedDataSource
}
from
'
vs/workbench/parts/preferences/browser/settingsTree
'
;
import
{
ISettingLinkClickEvent
,
resolveExtensionsSettings
,
resolveSettingsTree
,
SettingsDataSource
,
SettingsRenderer
,
SettingsTree
,
SimplePagedDataSource
,
ISettingOverrideClickEvent
}
from
'
vs/workbench/parts/preferences/browser/settingsTree
'
;
import
{
ISettingsEditorViewState
,
MODIFIED_SETTING_TAG
,
ONLINE_SERVICES_SETTING_TAG
,
parseQuery
,
SearchResultIdx
,
SearchResultModel
,
SettingsTreeGroupElement
,
SettingsTreeModel
,
SettingsTreeSettingElement
}
from
'
vs/workbench/parts/preferences/browser/settingsTreeModels
'
;
import
{
settingsTextInputBorder
}
from
'
vs/workbench/parts/preferences/browser/settingsWidgets
'
;
import
{
TOCRenderer
,
TOCTree
,
TOCTreeModel
}
from
'
vs/workbench/parts/preferences/browser/tocTree
'
;
...
...
@@ -362,7 +362,8 @@ export class SettingsEditor2 extends BaseEditor {
placeholderText
:
searchBoxLabel
,
focusContextKey
:
this
.
searchFocusContextKey
,
// TODO: Aria-live
}));
})
);
this
.
_register
(
attachSuggestEnabledInputBoxStyler
(
this
.
searchWidget
,
this
.
themeService
,
{
inputBorder
:
settingsTextInputBorder
...
...
@@ -622,6 +623,15 @@ export class SettingsEditor2 extends BaseEditor {
this
.
lastFocusedSettingElement
=
element
.
setting
.
key
;
this
.
settingsTree
.
reveal
(
element
);
}));
this
.
_register
(
this
.
settingsTreeRenderer
.
onDidClickOverrideElement
((
element
:
ISettingOverrideClickEvent
)
=>
{
if
(
ConfigurationTargetToString
(
ConfigurationTarget
.
WORKSPACE
)
===
element
.
scope
.
toUpperCase
())
{
this
.
settingsTargetsWidget
.
updateTarget
(
ConfigurationTarget
.
WORKSPACE
);
}
else
if
(
ConfigurationTargetToString
(
ConfigurationTarget
.
USER
)
===
element
.
scope
.
toUpperCase
())
{
this
.
settingsTargetsWidget
.
updateTarget
(
ConfigurationTarget
.
USER
);
}
this
.
searchWidget
.
setValue
(
element
.
targetKey
);
}));
this
.
settingsTreeDataSource
=
this
.
instantiationService
.
createInstance
(
SimplePagedDataSource
,
this
.
instantiationService
.
createInstance
(
SettingsDataSource
,
this
.
viewState
));
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录