Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
7b521edf
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,发现更多精彩内容 >>
提交
7b521edf
编写于
10月 01, 2018
作者:
S
Sandeep Somavarapu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix #59731
上级
c8ce044f
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
53 addition
and
40 deletion
+53
-40
src/vs/workbench/parts/preferences/browser/keybindingsEditor.ts
.../workbench/parts/preferences/browser/keybindingsEditor.ts
+7
-26
src/vs/workbench/parts/preferences/browser/media/clear-inverse.svg
...rkbench/parts/preferences/browser/media/clear-inverse.svg
+1
-0
src/vs/workbench/parts/preferences/browser/media/clear.svg
src/vs/workbench/parts/preferences/browser/media/clear.svg
+1
-0
src/vs/workbench/parts/preferences/common/preferences.ts
src/vs/workbench/parts/preferences/common/preferences.ts
+2
-0
src/vs/workbench/parts/preferences/electron-browser/preferences.contribution.ts
.../preferences/electron-browser/preferences.contribution.ts
+42
-14
未找到文件。
src/vs/workbench/parts/preferences/browser/keybindingsEditor.ts
浏览文件 @
7b521edf
...
@@ -26,7 +26,7 @@ import { DefineKeybindingWidget, KeybindingsSearchWidget, KeybindingsSearchOptio
...
@@ -26,7 +26,7 @@ import { DefineKeybindingWidget, KeybindingsSearchWidget, KeybindingsSearchOptio
import
{
import
{
IKeybindingsEditor
,
CONTEXT_KEYBINDING_FOCUS
,
CONTEXT_KEYBINDINGS_EDITOR
,
CONTEXT_KEYBINDINGS_SEARCH_FOCUS
,
KEYBINDINGS_EDITOR_COMMAND_REMOVE
,
KEYBINDINGS_EDITOR_COMMAND_COPY
,
IKeybindingsEditor
,
CONTEXT_KEYBINDING_FOCUS
,
CONTEXT_KEYBINDINGS_EDITOR
,
CONTEXT_KEYBINDINGS_SEARCH_FOCUS
,
KEYBINDINGS_EDITOR_COMMAND_REMOVE
,
KEYBINDINGS_EDITOR_COMMAND_COPY
,
KEYBINDINGS_EDITOR_COMMAND_RESET
,
KEYBINDINGS_EDITOR_COMMAND_COPY_COMMAND
,
KEYBINDINGS_EDITOR_COMMAND_DEFINE
,
KEYBINDINGS_EDITOR_COMMAND_SHOW_SIMILAR
,
KEYBINDINGS_EDITOR_COMMAND_RESET
,
KEYBINDINGS_EDITOR_COMMAND_COPY_COMMAND
,
KEYBINDINGS_EDITOR_COMMAND_DEFINE
,
KEYBINDINGS_EDITOR_COMMAND_SHOW_SIMILAR
,
KEYBINDINGS_EDITOR_COMMAND_RECORD_SEARCH_KEYS
,
KEYBINDINGS_EDITOR_COMMAND_SORTBY_PRECEDENCE
KEYBINDINGS_EDITOR_COMMAND_RECORD_SEARCH_KEYS
,
KEYBINDINGS_EDITOR_COMMAND_SORTBY_PRECEDENCE
,
CONTEXT_KEYBINDINGS_SEARCH_VALUE
}
from
'
vs/workbench/parts/preferences/common/preferences
'
;
}
from
'
vs/workbench/parts/preferences/common/preferences
'
;
import
{
IContextMenuService
}
from
'
vs/platform/contextview/browser/contextView
'
;
import
{
IContextMenuService
}
from
'
vs/platform/contextview/browser/contextView
'
;
import
{
IKeybindingEditingService
}
from
'
vs/workbench/services/keybinding/common/keybindingEditing
'
;
import
{
IKeybindingEditingService
}
from
'
vs/workbench/services/keybinding/common/keybindingEditing
'
;
...
@@ -41,7 +41,6 @@ import { IEditorService } from 'vs/workbench/services/editor/common/editorServic
...
@@ -41,7 +41,6 @@ import { IEditorService } from 'vs/workbench/services/editor/common/editorServic
import
{
EditorExtensionsRegistry
}
from
'
vs/editor/browser/editorExtensions
'
;
import
{
EditorExtensionsRegistry
}
from
'
vs/editor/browser/editorExtensions
'
;
import
{
WorkbenchList
}
from
'
vs/platform/list/browser/listService
'
;
import
{
WorkbenchList
}
from
'
vs/platform/list/browser/listService
'
;
import
{
INotificationService
}
from
'
vs/platform/notification/common/notification
'
;
import
{
INotificationService
}
from
'
vs/platform/notification/common/notification
'
;
import
{
IPreferencesService
}
from
'
vs/workbench/services/preferences/common/preferences
'
;
import
{
KeybindingsEditorInput
}
from
'
vs/workbench/services/preferences/common/preferencesEditorInput
'
;
import
{
KeybindingsEditorInput
}
from
'
vs/workbench/services/preferences/common/preferencesEditorInput
'
;
import
{
CancellationToken
}
from
'
vs/base/common/cancellation
'
;
import
{
CancellationToken
}
from
'
vs/base/common/cancellation
'
;
import
{
attachStylerCallback
}
from
'
vs/platform/theme/common/styler
'
;
import
{
attachStylerCallback
}
from
'
vs/platform/theme/common/styler
'
;
...
@@ -72,6 +71,7 @@ export class KeybindingsEditor extends BaseEditor implements IKeybindingsEditor
...
@@ -72,6 +71,7 @@ export class KeybindingsEditor extends BaseEditor implements IKeybindingsEditor
private
keybindingsEditorContextKey
:
IContextKey
<
boolean
>
;
private
keybindingsEditorContextKey
:
IContextKey
<
boolean
>
;
private
keybindingFocusContextKey
:
IContextKey
<
boolean
>
;
private
keybindingFocusContextKey
:
IContextKey
<
boolean
>
;
private
searchFocusContextKey
:
IContextKey
<
boolean
>
;
private
searchFocusContextKey
:
IContextKey
<
boolean
>
;
private
searchValueContextKey
:
IContextKey
<
boolean
>
;
private
actionBar
:
ActionBar
;
private
actionBar
:
ActionBar
;
private
sortByPrecedenceAction
:
Action
;
private
sortByPrecedenceAction
:
Action
;
...
@@ -84,7 +84,6 @@ export class KeybindingsEditor extends BaseEditor implements IKeybindingsEditor
...
@@ -84,7 +84,6 @@ export class KeybindingsEditor extends BaseEditor implements IKeybindingsEditor
@
IThemeService
themeService
:
IThemeService
,
@
IThemeService
themeService
:
IThemeService
,
@
IKeybindingService
private
keybindingsService
:
IKeybindingService
,
@
IKeybindingService
private
keybindingsService
:
IKeybindingService
,
@
IContextMenuService
private
contextMenuService
:
IContextMenuService
,
@
IContextMenuService
private
contextMenuService
:
IContextMenuService
,
@
IPreferencesService
private
preferencesService
:
IPreferencesService
,
@
IKeybindingEditingService
private
keybindingEditingService
:
IKeybindingEditingService
,
@
IKeybindingEditingService
private
keybindingEditingService
:
IKeybindingEditingService
,
@
IContextKeyService
private
contextKeyService
:
IContextKeyService
,
@
IContextKeyService
private
contextKeyService
:
IContextKeyService
,
@
INotificationService
private
notificationService
:
INotificationService
,
@
INotificationService
private
notificationService
:
INotificationService
,
...
@@ -98,6 +97,7 @@ export class KeybindingsEditor extends BaseEditor implements IKeybindingsEditor
...
@@ -98,6 +97,7 @@ export class KeybindingsEditor extends BaseEditor implements IKeybindingsEditor
this
.
keybindingsEditorContextKey
=
CONTEXT_KEYBINDINGS_EDITOR
.
bindTo
(
this
.
contextKeyService
);
this
.
keybindingsEditorContextKey
=
CONTEXT_KEYBINDINGS_EDITOR
.
bindTo
(
this
.
contextKeyService
);
this
.
searchFocusContextKey
=
CONTEXT_KEYBINDINGS_SEARCH_FOCUS
.
bindTo
(
this
.
contextKeyService
);
this
.
searchFocusContextKey
=
CONTEXT_KEYBINDINGS_SEARCH_FOCUS
.
bindTo
(
this
.
contextKeyService
);
this
.
searchValueContextKey
=
CONTEXT_KEYBINDINGS_SEARCH_VALUE
.
bindTo
(
this
.
contextKeyService
);
this
.
keybindingFocusContextKey
=
CONTEXT_KEYBINDING_FOCUS
.
bindTo
(
this
.
contextKeyService
);
this
.
keybindingFocusContextKey
=
CONTEXT_KEYBINDING_FOCUS
.
bindTo
(
this
.
contextKeyService
);
this
.
delayedFilterLogging
=
new
Delayer
<
void
>
(
1000
);
this
.
delayedFilterLogging
=
new
Delayer
<
void
>
(
1000
);
}
}
...
@@ -288,7 +288,10 @@ export class KeybindingsEditor extends BaseEditor implements IKeybindingsEditor
...
@@ -288,7 +288,10 @@ export class KeybindingsEditor extends BaseEditor implements IKeybindingsEditor
ariaLabelledBy
:
'
keybindings-editor-aria-label-element
'
,
ariaLabelledBy
:
'
keybindings-editor-aria-label-element
'
,
recordEnter
:
true
recordEnter
:
true
}));
}));
this
.
_register
(
this
.
searchWidget
.
onDidChange
(
searchValue
=>
this
.
delayedFiltering
.
trigger
(()
=>
this
.
filterKeybindings
())));
this
.
_register
(
this
.
searchWidget
.
onDidChange
(
searchValue
=>
{
this
.
searchValueContextKey
.
set
(
!!
searchValue
);
this
.
delayedFiltering
.
trigger
(()
=>
this
.
filterKeybindings
());
}));
this
.
_register
(
this
.
searchWidget
.
onEscape
(()
=>
this
.
recordKeysAction
.
checked
=
false
));
this
.
_register
(
this
.
searchWidget
.
onEscape
(()
=>
this
.
recordKeysAction
.
checked
=
false
));
const
actionsContainer
=
DOM
.
append
(
searchContainer
,
DOM
.
$
(
'
.keybindings-search-actions-container
'
));
const
actionsContainer
=
DOM
.
append
(
searchContainer
,
DOM
.
$
(
'
.keybindings-search-actions-container
'
));
...
@@ -338,9 +341,6 @@ export class KeybindingsEditor extends BaseEditor implements IKeybindingsEditor
...
@@ -338,9 +341,6 @@ export class KeybindingsEditor extends BaseEditor implements IKeybindingsEditor
}
}
}));
}));
this
.
actionBar
.
push
([
this
.
recordKeysAction
,
this
.
sortByPrecedenceAction
]);
this
.
actionBar
.
push
([
this
.
recordKeysAction
,
this
.
sortByPrecedenceAction
]);
this
.
createOpenKeybindingsElement
(
this
.
headerContainer
);
}
}
private
createRecordingBadge
(
container
:
HTMLElement
):
HTMLElement
{
private
createRecordingBadge
(
container
:
HTMLElement
):
HTMLElement
{
...
@@ -369,25 +369,6 @@ export class KeybindingsEditor extends BaseEditor implements IKeybindingsEditor
...
@@ -369,25 +369,6 @@ export class KeybindingsEditor extends BaseEditor implements IKeybindingsEditor
}
}
}
}
private
createOpenKeybindingsElement
(
parent
:
HTMLElement
):
void
{
const
openKeybindingsContainer
=
DOM
.
append
(
parent
,
$
(
'
.open-keybindings-container
'
));
DOM
.
append
(
openKeybindingsContainer
,
$
(
''
,
null
,
localize
(
'
header-message
'
,
"
For advanced customizations open and edit
"
)));
const
fileElement
=
DOM
.
append
(
openKeybindingsContainer
,
$
(
'
.file-name
'
,
null
,
localize
(
'
keybindings-file-name
'
,
"
keybindings.json
"
)));
fileElement
.
tabIndex
=
0
;
this
.
_register
(
DOM
.
addDisposableListener
(
fileElement
,
DOM
.
EventType
.
CLICK
,
()
=>
this
.
preferencesService
.
openGlobalKeybindingSettings
(
true
)));
this
.
_register
(
DOM
.
addDisposableListener
(
fileElement
,
DOM
.
EventType
.
KEY_UP
,
e
=>
{
let
keyboardEvent
=
new
StandardKeyboardEvent
(
e
);
switch
(
keyboardEvent
.
keyCode
)
{
case
KeyCode
.
Enter
:
this
.
preferencesService
.
openGlobalKeybindingSettings
(
true
);
keyboardEvent
.
preventDefault
();
keyboardEvent
.
stopPropagation
();
return
;
}
}));
}
private
createBody
(
parent
:
HTMLElement
):
void
{
private
createBody
(
parent
:
HTMLElement
):
void
{
const
bodyContainer
=
DOM
.
append
(
parent
,
$
(
'
.keybindings-body
'
));
const
bodyContainer
=
DOM
.
append
(
parent
,
$
(
'
.keybindings-body
'
));
this
.
createList
(
bodyContainer
);
this
.
createList
(
bodyContainer
);
...
...
src/vs/workbench/parts/preferences/browser/media/clear-inverse.svg
0 → 100644
浏览文件 @
7b521edf
<svg
width=
"16"
height=
"16"
viewBox=
"0 0 16 16"
fill=
"none"
xmlns=
"http://www.w3.org/2000/svg"
><path
d=
"M7.065 13H15v2H2.056v-2h5.009zm3.661-12H7.385L8.44 2.061 7.505 3H15V1h-4.274zM3.237 9H2.056v2H15V9H3.237zm4.208-4l.995 1-.995 1H15V5H7.445z"
fill=
"#C5C5C5"
/><path
d=
"M5.072 4.03L7.032 6 5.978 7.061l-1.96-1.97-1.961 1.97L1 6l1.96-1.97L1 2.061 2.056 1l1.96 1.97L5.977 1l1.057 1.061L5.072 4.03z"
fill=
"#F48771"
/></svg>
\ No newline at end of file
src/vs/workbench/parts/preferences/browser/media/clear.svg
0 → 100644
浏览文件 @
7b521edf
<svg
width=
"16"
height=
"16"
viewBox=
"0 0 16 16"
fill=
"none"
xmlns=
"http://www.w3.org/2000/svg"
><path
d=
"M7.065 13H15v2H2.056v-2h5.009zm3.661-12H7.385L8.44 2.061 7.505 3H15V1h-4.274zM3.237 9H2.056v2H15V9H3.237zm4.208-4l.995 1-.995 1H15V5H7.445z"
fill=
"#424242"
/><path
d=
"M5.072 4.03L7.032 6 5.978 7.061l-1.96-1.97-1.961 1.97L1 6l1.96-1.97L1 2.061 2.056 1l1.96 1.97L5.977 1l1.057 1.061L5.072 4.03z"
fill=
"#A1260D"
/></svg>
\ No newline at end of file
src/vs/workbench/parts/preferences/common/preferences.ts
浏览文件 @
7b521edf
...
@@ -67,6 +67,7 @@ export const CONTEXT_SETTINGS_SEARCH_FOCUS = new RawContextKey<boolean>('inSetti
...
@@ -67,6 +67,7 @@ export const CONTEXT_SETTINGS_SEARCH_FOCUS = new RawContextKey<boolean>('inSetti
export
const
CONTEXT_TOC_ROW_FOCUS
=
new
RawContextKey
<
boolean
>
(
'
settingsTocRowFocus
'
,
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_KEYBINDINGS_SEARCH_VALUE
=
new
RawContextKey
<
boolean
>
(
'
hasKeybindingsSearchValue
'
,
false
);
export
const
CONTEXT_KEYBINDING_FOCUS
=
new
RawContextKey
<
boolean
>
(
'
keybindingFocus
'
,
false
);
export
const
CONTEXT_KEYBINDING_FOCUS
=
new
RawContextKey
<
boolean
>
(
'
keybindingFocus
'
,
false
);
export
const
SETTINGS_EDITOR_COMMAND_SEARCH
=
'
settings.action.search
'
;
export
const
SETTINGS_EDITOR_COMMAND_SEARCH
=
'
settings.action.search
'
;
...
@@ -90,6 +91,7 @@ export const KEYBINDINGS_EDITOR_COMMAND_COPY = 'keybindings.editor.copyKeybindin
...
@@ -90,6 +91,7 @@ export const KEYBINDINGS_EDITOR_COMMAND_COPY = 'keybindings.editor.copyKeybindin
export
const
KEYBINDINGS_EDITOR_COMMAND_COPY_COMMAND
=
'
keybindings.editor.copyCommandKeybindingEntry
'
;
export
const
KEYBINDINGS_EDITOR_COMMAND_COPY_COMMAND
=
'
keybindings.editor.copyCommandKeybindingEntry
'
;
export
const
KEYBINDINGS_EDITOR_COMMAND_SHOW_SIMILAR
=
'
keybindings.editor.showConflicts
'
;
export
const
KEYBINDINGS_EDITOR_COMMAND_SHOW_SIMILAR
=
'
keybindings.editor.showConflicts
'
;
export
const
KEYBINDINGS_EDITOR_COMMAND_FOCUS_KEYBINDINGS
=
'
keybindings.editor.focusKeybindings
'
;
export
const
KEYBINDINGS_EDITOR_COMMAND_FOCUS_KEYBINDINGS
=
'
keybindings.editor.focusKeybindings
'
;
export
const
KEYBINDINGS_EDITOR_CLEAR_INPUT
=
'
keybindings.editor.showDefaultKeybindings
'
;
export
const
KEYBINDINGS_EDITOR_SHOW_DEFAULT_KEYBINDINGS
=
'
keybindings.editor.showDefaultKeybindings
'
;
export
const
KEYBINDINGS_EDITOR_SHOW_DEFAULT_KEYBINDINGS
=
'
keybindings.editor.showDefaultKeybindings
'
;
export
const
KEYBINDINGS_EDITOR_SHOW_USER_KEYBINDINGS
=
'
keybindings.editor.showUserKeybindings
'
;
export
const
KEYBINDINGS_EDITOR_SHOW_USER_KEYBINDINGS
=
'
keybindings.editor.showUserKeybindings
'
;
...
...
src/vs/workbench/parts/preferences/electron-browser/preferences.contribution.ts
浏览文件 @
7b521edf
...
@@ -22,7 +22,9 @@ import { KeybindingsEditor } from 'vs/workbench/parts/preferences/browser/keybin
...
@@ -22,7 +22,9 @@ import { KeybindingsEditor } from 'vs/workbench/parts/preferences/browser/keybin
import
{
OpenDefaultKeybindingsFileAction
,
OpenRawDefaultSettingsAction
,
OpenSettingsAction
,
OpenGlobalSettingsAction
,
OpenGlobalKeybindingsFileAction
,
OpenWorkspaceSettingsAction
,
OpenFolderSettingsAction
,
ConfigureLanguageBasedSettingsAction
,
OPEN_FOLDER_SETTINGS_COMMAND
,
OpenGlobalKeybindingsAction
,
OpenSettings2Action
,
OpenSettingsJsonAction
}
from
'
vs/workbench/parts/preferences/browser/preferencesActions
'
;
import
{
OpenDefaultKeybindingsFileAction
,
OpenRawDefaultSettingsAction
,
OpenSettingsAction
,
OpenGlobalSettingsAction
,
OpenGlobalKeybindingsFileAction
,
OpenWorkspaceSettingsAction
,
OpenFolderSettingsAction
,
ConfigureLanguageBasedSettingsAction
,
OPEN_FOLDER_SETTINGS_COMMAND
,
OpenGlobalKeybindingsAction
,
OpenSettings2Action
,
OpenSettingsJsonAction
}
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
,
KEYBINDINGS_EDITOR_COMMAND_RECORD_SEARCH_KEYS
,
KEYBINDINGS_EDITOR_COMMAND_SORTBY_PRECEDENCE
,
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_RECORD_SEARCH_KEYS
,
KEYBINDINGS_EDITOR_COMMAND_SORTBY_PRECEDENCE
,
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_SETTINGS_FROM_SEARCH
,
CONTEXT_TOC_ROW_FOCUS
,
SETTINGS_EDITOR_COMMAND_FOCUS_SETTINGS_LIST
,
SETTINGS_EDITOR_COMMAND_SHOW_CONTEXT_MENU
,
KEYBINDINGS_EDITOR_SHOW_DEFAULT_KEYBINDINGS
,
KEYBINDINGS_EDITOR_SHOW_USER_KEYBINDINGS
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_SETTINGS_FROM_SEARCH
,
CONTEXT_TOC_ROW_FOCUS
,
SETTINGS_EDITOR_COMMAND_FOCUS_SETTINGS_LIST
,
SETTINGS_EDITOR_COMMAND_SHOW_CONTEXT_MENU
,
KEYBINDINGS_EDITOR_SHOW_DEFAULT_KEYBINDINGS
,
KEYBINDINGS_EDITOR_SHOW_USER_KEYBINDINGS
,
CONTEXT_KEYBINDINGS_SEARCH_VALUE
}
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
'
;
...
@@ -343,19 +345,6 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
...
@@ -343,19 +345,6 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
}
}
});
});
KeybindingsRegistry
.
registerCommandAndKeybindingRule
({
id
:
KEYBINDINGS_EDITOR_COMMAND_CLEAR_SEARCH_RESULTS
,
weight
:
KeybindingWeight
.
WorkbenchContrib
,
when
:
ContextKeyExpr
.
and
(
CONTEXT_KEYBINDINGS_EDITOR
,
CONTEXT_KEYBINDINGS_SEARCH_FOCUS
),
primary
:
KeyCode
.
Escape
,
handler
:
(
accessor
,
args
:
any
)
=>
{
const
control
=
accessor
.
get
(
IEditorService
).
activeControl
as
IKeybindingsEditor
;
if
(
control
)
{
control
.
clearSearchResults
();
}
}
});
Registry
.
as
<
IWorkbenchContributionsRegistry
>
(
WorkbenchExtensions
.
Workbench
).
registerWorkbenchContribution
(
PreferencesContribution
,
LifecyclePhase
.
Starting
);
Registry
.
as
<
IWorkbenchContributionsRegistry
>
(
WorkbenchExtensions
.
Workbench
).
registerWorkbenchContribution
(
PreferencesContribution
,
LifecyclePhase
.
Starting
);
CommandsRegistry
.
registerCommand
(
OPEN_FOLDER_SETTINGS_COMMAND
,
function
(
accessor
:
ServicesAccessor
,
resource
:
URI
)
{
CommandsRegistry
.
registerCommand
(
OPEN_FOLDER_SETTINGS_COMMAND
,
function
(
accessor
:
ServicesAccessor
,
resource
:
URI
)
{
...
@@ -400,6 +389,33 @@ MenuRegistry.appendMenuItem(MenuId.EditorTitle, {
...
@@ -400,6 +389,33 @@ MenuRegistry.appendMenuItem(MenuId.EditorTitle, {
group
:
'
1_keyboard_preferences_actions
'
group
:
'
1_keyboard_preferences_actions
'
});
});
KeybindingsRegistry
.
registerCommandAndKeybindingRule
({
id
:
KEYBINDINGS_EDITOR_COMMAND_CLEAR_SEARCH_RESULTS
,
weight
:
KeybindingWeight
.
WorkbenchContrib
,
when
:
ContextKeyExpr
.
and
(
CONTEXT_KEYBINDINGS_EDITOR
,
CONTEXT_KEYBINDINGS_SEARCH_FOCUS
),
primary
:
KeyCode
.
Escape
,
handler
:
(
accessor
,
args
:
any
)
=>
{
const
control
=
accessor
.
get
(
IEditorService
).
activeControl
as
IKeybindingsEditor
;
if
(
control
)
{
control
.
clearSearchResults
();
}
}
});
MenuRegistry
.
appendMenuItem
(
MenuId
.
EditorTitle
,
{
command
:
{
id
:
KEYBINDINGS_EDITOR_COMMAND_CLEAR_SEARCH_RESULTS
,
title
:
nls
.
localize
(
'
clearInput
'
,
"
Clear Keybindings Search Input
"
),
iconLocation
:
{
light
:
URI
.
parse
(
require
.
toUrl
(
`vs/workbench/parts/preferences/browser/media/clear.svg`
)),
dark
:
URI
.
parse
(
require
.
toUrl
(
`vs/workbench/parts/preferences/browser/media/clear-inverse.svg`
))
},
precondition
:
ContextKeyExpr
.
and
(
CONTEXT_KEYBINDINGS_SEARCH_VALUE
)
},
when
:
ContextKeyExpr
.
and
(
CONTEXT_KEYBINDINGS_EDITOR
),
group
:
'
navigation
'
,
});
CommandsRegistry
.
registerCommand
(
KEYBINDINGS_EDITOR_SHOW_USER_KEYBINDINGS
,
serviceAccessor
=>
{
CommandsRegistry
.
registerCommand
(
KEYBINDINGS_EDITOR_SHOW_USER_KEYBINDINGS
,
serviceAccessor
=>
{
const
control
=
serviceAccessor
.
get
(
IEditorService
).
activeControl
as
IKeybindingsEditor
;
const
control
=
serviceAccessor
.
get
(
IEditorService
).
activeControl
as
IKeybindingsEditor
;
if
(
control
)
{
if
(
control
)
{
...
@@ -415,6 +431,18 @@ MenuRegistry.appendMenuItem(MenuId.EditorTitle, {
...
@@ -415,6 +431,18 @@ MenuRegistry.appendMenuItem(MenuId.EditorTitle, {
group
:
'
1_keyboard_preferences_actions
'
group
:
'
1_keyboard_preferences_actions
'
});
});
CommandsRegistry
.
registerCommand
(
OpenGlobalKeybindingsFileAction
.
ID
,
serviceAccessor
=>
{
serviceAccessor
.
get
(
IInstantiationService
).
createInstance
(
OpenGlobalKeybindingsFileAction
,
OpenGlobalKeybindingsFileAction
.
ID
,
OpenGlobalKeybindingsFileAction
.
LABEL
).
run
();
});
MenuRegistry
.
appendMenuItem
(
MenuId
.
EditorTitle
,
{
command
:
{
id
:
OpenGlobalKeybindingsFileAction
.
ID
,
title
:
OpenGlobalKeybindingsFileAction
.
LABEL
,
},
when
:
ContextKeyExpr
.
and
(
CONTEXT_KEYBINDINGS_EDITOR
),
group
:
'
2_keyboard_preferences_actions
'
});
abstract
class
SettingsCommand
extends
Command
{
abstract
class
SettingsCommand
extends
Command
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录