Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
bdd04868
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,发现更多精彩内容 >>
提交
bdd04868
编写于
6月 27, 2018
作者:
R
Rob Lourens
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix #53125 - focus settings list on 'enter' in TOC
上级
a7674d53
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
33 addition
and
2 deletion
+33
-2
src/vs/workbench/parts/preferences/browser/settingsEditor2.ts
...vs/workbench/parts/preferences/browser/settingsEditor2.ts
+12
-1
src/vs/workbench/parts/preferences/common/preferences.ts
src/vs/workbench/parts/preferences/common/preferences.ts
+3
-0
src/vs/workbench/parts/preferences/electron-browser/preferences.contribution.ts
.../preferences/electron-browser/preferences.contribution.ts
+18
-1
未找到文件。
src/vs/workbench/parts/preferences/browser/settingsEditor2.ts
浏览文件 @
bdd04868
...
@@ -33,7 +33,7 @@ import { SearchWidget, SettingsTarget, SettingsTargetsWidget } from 'vs/workbenc
...
@@ -33,7 +33,7 @@ import { SearchWidget, SettingsTarget, SettingsTargetsWidget } from 'vs/workbenc
import
{
commonlyUsedData
,
tocData
}
from
'
vs/workbench/parts/preferences/browser/settingsLayout
'
;
import
{
commonlyUsedData
,
tocData
}
from
'
vs/workbench/parts/preferences/browser/settingsLayout
'
;
import
{
ISettingsEditorViewState
,
NonExpandableTree
,
resolveExtensionsSettings
,
resolveSettingsTree
,
SearchResultIdx
,
SearchResultModel
,
SettingsAccessibilityProvider
,
SettingsDataSource
,
SettingsRenderer
,
SettingsTreeController
,
SettingsTreeElement
,
SettingsTreeFilter
,
SettingsTreeGroupElement
,
SettingsTreeModel
,
SettingsTreeSettingElement
}
from
'
vs/workbench/parts/preferences/browser/settingsTree
'
;
import
{
ISettingsEditorViewState
,
NonExpandableTree
,
resolveExtensionsSettings
,
resolveSettingsTree
,
SearchResultIdx
,
SearchResultModel
,
SettingsAccessibilityProvider
,
SettingsDataSource
,
SettingsRenderer
,
SettingsTreeController
,
SettingsTreeElement
,
SettingsTreeFilter
,
SettingsTreeGroupElement
,
SettingsTreeModel
,
SettingsTreeSettingElement
}
from
'
vs/workbench/parts/preferences/browser/settingsTree
'
;
import
{
TOCDataSource
,
TOCRenderer
,
TOCTreeModel
}
from
'
vs/workbench/parts/preferences/browser/tocTree
'
;
import
{
TOCDataSource
,
TOCRenderer
,
TOCTreeModel
}
from
'
vs/workbench/parts/preferences/browser/tocTree
'
;
import
{
CONTEXT_SETTINGS_EDITOR
,
CONTEXT_SETTINGS_FIRST_ROW_FOCUS
,
CONTEXT_SETTINGS_SEARCH_FOCUS
,
IPreferencesSearchService
,
ISearchProvider
,
CONTEXT_SETTINGS_ROW_FOCUS
}
from
'
vs/workbench/parts/preferences/common/preferences
'
;
import
{
CONTEXT_SETTINGS_EDITOR
,
CONTEXT_SETTINGS_FIRST_ROW_FOCUS
,
CONTEXT_SETTINGS_SEARCH_FOCUS
,
IPreferencesSearchService
,
ISearchProvider
,
CONTEXT_SETTINGS_ROW_FOCUS
,
CONTEXT_TOC_ROW_FOCUS
}
from
'
vs/workbench/parts/preferences/common/preferences
'
;
import
{
IPreferencesService
,
ISearchResult
,
ISettingsEditorModel
}
from
'
vs/workbench/services/preferences/common/preferences
'
;
import
{
IPreferencesService
,
ISearchResult
,
ISettingsEditorModel
}
from
'
vs/workbench/services/preferences/common/preferences
'
;
import
{
SettingsEditor2Input
}
from
'
vs/workbench/services/preferences/common/preferencesEditorInput
'
;
import
{
SettingsEditor2Input
}
from
'
vs/workbench/services/preferences/common/preferencesEditorInput
'
;
import
{
DefaultSettingsEditorModel
}
from
'
vs/workbench/services/preferences/common/preferencesModels
'
;
import
{
DefaultSettingsEditorModel
}
from
'
vs/workbench/services/preferences/common/preferencesModels
'
;
...
@@ -77,6 +77,7 @@ export class SettingsEditor2 extends BaseEditor {
...
@@ -77,6 +77,7 @@ export class SettingsEditor2 extends BaseEditor {
private
firstRowFocused
:
IContextKey
<
boolean
>
;
private
firstRowFocused
:
IContextKey
<
boolean
>
;
private
rowFocused
:
IContextKey
<
boolean
>
;
private
rowFocused
:
IContextKey
<
boolean
>
;
private
tocRowFocused
:
IContextKey
<
boolean
>
;
private
inSettingsEditorContextKey
:
IContextKey
<
boolean
>
;
private
inSettingsEditorContextKey
:
IContextKey
<
boolean
>
;
private
searchFocusContextKey
:
IContextKey
<
boolean
>
;
private
searchFocusContextKey
:
IContextKey
<
boolean
>
;
...
@@ -103,6 +104,7 @@ export class SettingsEditor2 extends BaseEditor {
...
@@ -103,6 +104,7 @@ export class SettingsEditor2 extends BaseEditor {
this
.
searchFocusContextKey
=
CONTEXT_SETTINGS_SEARCH_FOCUS
.
bindTo
(
contextKeyService
);
this
.
searchFocusContextKey
=
CONTEXT_SETTINGS_SEARCH_FOCUS
.
bindTo
(
contextKeyService
);
this
.
firstRowFocused
=
CONTEXT_SETTINGS_FIRST_ROW_FOCUS
.
bindTo
(
contextKeyService
);
this
.
firstRowFocused
=
CONTEXT_SETTINGS_FIRST_ROW_FOCUS
.
bindTo
(
contextKeyService
);
this
.
rowFocused
=
CONTEXT_SETTINGS_ROW_FOCUS
.
bindTo
(
contextKeyService
);
this
.
rowFocused
=
CONTEXT_SETTINGS_ROW_FOCUS
.
bindTo
(
contextKeyService
);
this
.
tocRowFocused
=
CONTEXT_TOC_ROW_FOCUS
.
bindTo
(
contextKeyService
);
this
.
_register
(
configurationService
.
onDidChangeConfiguration
(
e
=>
{
this
.
_register
(
configurationService
.
onDidChangeConfiguration
(
e
=>
{
this
.
onConfigUpdate
();
this
.
onConfigUpdate
();
...
@@ -284,6 +286,15 @@ export class SettingsEditor2 extends BaseEditor {
...
@@ -284,6 +286,15 @@ export class SettingsEditor2 extends BaseEditor {
this
.
settingsTree
.
setFocus
(
element
);
this
.
settingsTree
.
setFocus
(
element
);
}
}
}
}
}));
this
.
_register
(
this
.
tocTree
.
onDidFocus
(()
=>
{
this
.
tocRowFocused
.
set
(
true
);
}));
this
.
_register
(
this
.
tocTree
.
onDidBlur
(()
=>
{
this
.
tocRowFocused
.
set
(
false
);
}));
}));
this
.
updateTOCVisible
();
this
.
updateTOCVisible
();
...
...
src/vs/workbench/parts/preferences/common/preferences.ts
浏览文件 @
bdd04868
...
@@ -62,6 +62,7 @@ export const CONTEXT_SETTINGS_EDITOR = new RawContextKey<boolean>('inSettingsEdi
...
@@ -62,6 +62,7 @@ export const CONTEXT_SETTINGS_EDITOR = new RawContextKey<boolean>('inSettingsEdi
export
const
CONTEXT_SETTINGS_SEARCH_FOCUS
=
new
RawContextKey
<
boolean
>
(
'
inSettingsSearch
'
,
false
);
export
const
CONTEXT_SETTINGS_SEARCH_FOCUS
=
new
RawContextKey
<
boolean
>
(
'
inSettingsSearch
'
,
false
);
export
const
CONTEXT_SETTINGS_FIRST_ROW_FOCUS
=
new
RawContextKey
<
boolean
>
(
'
firstSettingRowFocused
'
,
false
);
export
const
CONTEXT_SETTINGS_FIRST_ROW_FOCUS
=
new
RawContextKey
<
boolean
>
(
'
firstSettingRowFocused
'
,
false
);
export
const
CONTEXT_SETTINGS_ROW_FOCUS
=
new
RawContextKey
<
boolean
>
(
'
settingRowFocused
'
,
false
);
export
const
CONTEXT_SETTINGS_ROW_FOCUS
=
new
RawContextKey
<
boolean
>
(
'
settingRowFocused
'
,
false
);
export
const
CONTEXT_TOC_ROW_FOCUS
=
new
RawContextKey
<
boolean
>
(
'
settingsTocRowFocus
'
,
false
);
export
const
CONTEXT_KEYBINDINGS_EDITOR
=
new
RawContextKey
<
boolean
>
(
'
inKeybindings
'
,
false
);
export
const
CONTEXT_KEYBINDINGS_EDITOR
=
new
RawContextKey
<
boolean
>
(
'
inKeybindings
'
,
false
);
export
const
CONTEXT_KEYBINDINGS_SEARCH_FOCUS
=
new
RawContextKey
<
boolean
>
(
'
inKeybindingsSearch
'
,
false
);
export
const
CONTEXT_KEYBINDINGS_SEARCH_FOCUS
=
new
RawContextKey
<
boolean
>
(
'
inKeybindingsSearch
'
,
false
);
export
const
CONTEXT_KEYBINDING_FOCUS
=
new
RawContextKey
<
boolean
>
(
'
keybindingFocus
'
,
false
);
export
const
CONTEXT_KEYBINDING_FOCUS
=
new
RawContextKey
<
boolean
>
(
'
keybindingFocus
'
,
false
);
...
@@ -74,6 +75,8 @@ export const SETTINGS_EDITOR_COMMAND_FOCUS_FILE = 'settings.action.focusSettings
...
@@ -74,6 +75,8 @@ export const SETTINGS_EDITOR_COMMAND_FOCUS_FILE = 'settings.action.focusSettings
export
const
SETTINGS_EDITOR_COMMAND_EDIT_FOCUSED_SETTING
=
'
settings.action.editFocusedSetting
'
;
export
const
SETTINGS_EDITOR_COMMAND_EDIT_FOCUSED_SETTING
=
'
settings.action.editFocusedSetting
'
;
export
const
SETTINGS_EDITOR_COMMAND_FOCUS_SEARCH_FROM_SETTINGS
=
'
settings.action.focusSearchFromSettings
'
;
export
const
SETTINGS_EDITOR_COMMAND_FOCUS_SEARCH_FROM_SETTINGS
=
'
settings.action.focusSearchFromSettings
'
;
export
const
SETTINGS_EDITOR_COMMAND_FOCUS_SETTINGS_FROM_SEARCH
=
'
settings.action.focusSettingsFromSearch
'
;
export
const
SETTINGS_EDITOR_COMMAND_FOCUS_SETTINGS_FROM_SEARCH
=
'
settings.action.focusSettingsFromSearch
'
;
export
const
SETTINGS_EDITOR_COMMAND_FOCUS_SETTINGS_LIST
=
'
settings.action.focusSettingsList
'
;
export
const
KEYBINDINGS_EDITOR_COMMAND_SEARCH
=
'
keybindings.editor.searchKeybindings
'
;
export
const
KEYBINDINGS_EDITOR_COMMAND_SEARCH
=
'
keybindings.editor.searchKeybindings
'
;
export
const
KEYBINDINGS_EDITOR_COMMAND_CLEAR_SEARCH_RESULTS
=
'
keybindings.editor.clearSearchResults
'
;
export
const
KEYBINDINGS_EDITOR_COMMAND_CLEAR_SEARCH_RESULTS
=
'
keybindings.editor.clearSearchResults
'
;
export
const
KEYBINDINGS_EDITOR_COMMAND_DEFINE
=
'
keybindings.editor.defineKeybinding
'
;
export
const
KEYBINDINGS_EDITOR_COMMAND_DEFINE
=
'
keybindings.editor.defineKeybinding
'
;
...
...
src/vs/workbench/parts/preferences/electron-browser/preferences.contribution.ts
浏览文件 @
bdd04868
...
@@ -22,7 +22,7 @@ import { KeybindingsEditor } from 'vs/workbench/parts/preferences/browser/keybin
...
@@ -22,7 +22,7 @@ import { KeybindingsEditor } from 'vs/workbench/parts/preferences/browser/keybin
import
{
OpenRawDefaultSettingsAction
,
OpenSettingsAction
,
OpenGlobalSettingsAction
,
OpenGlobalKeybindingsFileAction
,
OpenWorkspaceSettingsAction
,
OpenFolderSettingsAction
,
ConfigureLanguageBasedSettingsAction
,
OPEN_FOLDER_SETTINGS_COMMAND
,
OpenGlobalKeybindingsAction
,
OpenSettings2Action
}
from
'
vs/workbench/parts/preferences/browser/preferencesActions
'
;
import
{
OpenRawDefaultSettingsAction
,
OpenSettingsAction
,
OpenGlobalSettingsAction
,
OpenGlobalKeybindingsFileAction
,
OpenWorkspaceSettingsAction
,
OpenFolderSettingsAction
,
ConfigureLanguageBasedSettingsAction
,
OPEN_FOLDER_SETTINGS_COMMAND
,
OpenGlobalKeybindingsAction
,
OpenSettings2Action
}
from
'
vs/workbench/parts/preferences/browser/preferencesActions
'
;
import
{
import
{
IKeybindingsEditor
,
IPreferencesSearchService
,
CONTEXT_KEYBINDING_FOCUS
,
CONTEXT_KEYBINDINGS_EDITOR
,
CONTEXT_KEYBINDINGS_SEARCH_FOCUS
,
KEYBINDINGS_EDITOR_COMMAND_DEFINE
,
KEYBINDINGS_EDITOR_COMMAND_REMOVE
,
KEYBINDINGS_EDITOR_COMMAND_SEARCH
,
IKeybindingsEditor
,
IPreferencesSearchService
,
CONTEXT_KEYBINDING_FOCUS
,
CONTEXT_KEYBINDINGS_EDITOR
,
CONTEXT_KEYBINDINGS_SEARCH_FOCUS
,
KEYBINDINGS_EDITOR_COMMAND_DEFINE
,
KEYBINDINGS_EDITOR_COMMAND_REMOVE
,
KEYBINDINGS_EDITOR_COMMAND_SEARCH
,
KEYBINDINGS_EDITOR_COMMAND_COPY
,
KEYBINDINGS_EDITOR_COMMAND_RESET
,
KEYBINDINGS_EDITOR_COMMAND_COPY_COMMAND
,
KEYBINDINGS_EDITOR_COMMAND_SHOW_SIMILAR
,
KEYBINDINGS_EDITOR_COMMAND_FOCUS_KEYBINDINGS
,
KEYBINDINGS_EDITOR_COMMAND_CLEAR_SEARCH_RESULTS
,
SETTINGS_EDITOR_COMMAND_SEARCH
,
CONTEXT_SETTINGS_EDITOR
,
SETTINGS_EDITOR_COMMAND_FOCUS_FILE
,
CONTEXT_SETTINGS_SEARCH_FOCUS
,
SETTINGS_EDITOR_COMMAND_CLEAR_SEARCH_RESULTS
,
SETTINGS_EDITOR_COMMAND_FOCUS_NEXT_SETTING
,
SETTINGS_EDITOR_COMMAND_FOCUS_PREVIOUS_SETTING
,
SETTINGS_EDITOR_COMMAND_EDIT_FOCUSED_SETTING
,
SETTINGS_EDITOR_COMMAND_FOCUS_SEARCH_FROM_SETTINGS
,
SETTINGS_EDITOR_COMMAND_FOCUS_SETTINGS_FROM_SEARCH
,
CONTEXT_SETTINGS_FIRST_ROW_FOCUS
,
CONTEXT_SETTINGS_ROW_FOCUS
KEYBINDINGS_EDITOR_COMMAND_COPY
,
KEYBINDINGS_EDITOR_COMMAND_RESET
,
KEYBINDINGS_EDITOR_COMMAND_COPY_COMMAND
,
KEYBINDINGS_EDITOR_COMMAND_SHOW_SIMILAR
,
KEYBINDINGS_EDITOR_COMMAND_FOCUS_KEYBINDINGS
,
KEYBINDINGS_EDITOR_COMMAND_CLEAR_SEARCH_RESULTS
,
SETTINGS_EDITOR_COMMAND_SEARCH
,
CONTEXT_SETTINGS_EDITOR
,
SETTINGS_EDITOR_COMMAND_FOCUS_FILE
,
CONTEXT_SETTINGS_SEARCH_FOCUS
,
SETTINGS_EDITOR_COMMAND_CLEAR_SEARCH_RESULTS
,
SETTINGS_EDITOR_COMMAND_FOCUS_NEXT_SETTING
,
SETTINGS_EDITOR_COMMAND_FOCUS_PREVIOUS_SETTING
,
SETTINGS_EDITOR_COMMAND_EDIT_FOCUSED_SETTING
,
SETTINGS_EDITOR_COMMAND_FOCUS_SEARCH_FROM_SETTINGS
,
SETTINGS_EDITOR_COMMAND_FOCUS_SETTINGS_FROM_SEARCH
,
CONTEXT_SETTINGS_FIRST_ROW_FOCUS
,
CONTEXT_SETTINGS_ROW_FOCUS
,
CONTEXT_TOC_ROW_FOCUS
,
SETTINGS_EDITOR_COMMAND_FOCUS_SETTINGS_LIST
}
from
'
vs/workbench/parts/preferences/common/preferences
'
;
}
from
'
vs/workbench/parts/preferences/common/preferences
'
;
import
{
IInstantiationService
,
ServicesAccessor
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
IInstantiationService
,
ServicesAccessor
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
IWorkbenchContributionsRegistry
,
Extensions
as
WorkbenchExtensions
}
from
'
vs/workbench/common/contributions
'
;
import
{
IWorkbenchContributionsRegistry
,
Extensions
as
WorkbenchExtensions
}
from
'
vs/workbench/common/contributions
'
;
...
@@ -476,3 +476,20 @@ const editFocusedSettingCommand2 = new EditFocusedSettingCommand2({
...
@@ -476,3 +476,20 @@ const editFocusedSettingCommand2 = new EditFocusedSettingCommand2({
kbOpts
:
{
primary
:
KeyCode
.
Enter
}
kbOpts
:
{
primary
:
KeyCode
.
Enter
}
});
});
KeybindingsRegistry
.
registerCommandAndKeybindingRule
(
editFocusedSettingCommand2
.
toCommandAndKeybindingRule
(
KeybindingsRegistry
.
WEIGHT
.
workbenchContrib
()));
KeybindingsRegistry
.
registerCommandAndKeybindingRule
(
editFocusedSettingCommand2
.
toCommandAndKeybindingRule
(
KeybindingsRegistry
.
WEIGHT
.
workbenchContrib
()));
class
FocusSettingsListCommand
extends
SettingsCommand
{
public
runCommand
(
accessor
:
ServicesAccessor
,
args
:
any
):
void
{
const
preferencesEditor
=
this
.
getPreferencesEditor
(
accessor
);
if
(
preferencesEditor
instanceof
SettingsEditor2
)
{
preferencesEditor
.
focusSettings
();
}
}
}
const
focusSettingsListCommand
=
new
FocusSettingsListCommand
({
id
:
SETTINGS_EDITOR_COMMAND_FOCUS_SETTINGS_LIST
,
precondition
:
ContextKeyExpr
.
and
(
CONTEXT_SETTINGS_EDITOR
,
CONTEXT_TOC_ROW_FOCUS
),
kbOpts
:
{
primary
:
KeyCode
.
Enter
}
});
KeybindingsRegistry
.
registerCommandAndKeybindingRule
(
focusSettingsListCommand
.
toCommandAndKeybindingRule
(
KeybindingsRegistry
.
WEIGHT
.
workbenchContrib
()));
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录