Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
c1274981
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,体验更适合开发者的 AI 搜索 >>
提交
c1274981
编写于
1月 05, 2021
作者:
S
Sandeep Somavarapu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix #101738
上级
ab1aeb6b
变更
13
隐藏空白更改
内联
并排
Showing
13 changed file
with
109 addition
and
93 deletion
+109
-93
src/vs/platform/keybinding/common/keybindingResolver.ts
src/vs/platform/keybinding/common/keybindingResolver.ts
+0
-41
src/vs/workbench/contrib/preferences/browser/keybindingsEditor.ts
...orkbench/contrib/preferences/browser/keybindingsEditor.ts
+3
-3
src/vs/workbench/contrib/preferences/browser/preferences.contribution.ts
...h/contrib/preferences/browser/preferences.contribution.ts
+1
-1
src/vs/workbench/contrib/preferences/browser/preferencesEditor.ts
...orkbench/contrib/preferences/browser/preferencesEditor.ts
+1
-1
src/vs/workbench/contrib/preferences/browser/settingsEditor2.ts
.../workbench/contrib/preferences/browser/settingsEditor2.ts
+1
-1
src/vs/workbench/contrib/userDataSync/browser/userDataSyncTrigger.ts
...bench/contrib/userDataSync/browser/userDataSyncTrigger.ts
+1
-1
src/vs/workbench/services/keybinding/browser/keybindingService.ts
...orkbench/services/keybinding/browser/keybindingService.ts
+2
-1
src/vs/workbench/services/keybinding/browser/unboundCommands.ts
.../workbench/services/keybinding/browser/unboundCommands.ts
+52
-0
src/vs/workbench/services/preferences/browser/keybindingsEditorModel.ts
...ch/services/preferences/browser/keybindingsEditorModel.ts
+3
-40
src/vs/workbench/services/preferences/browser/preferencesEditorInput.ts
...ch/services/preferences/browser/preferencesEditorInput.ts
+1
-1
src/vs/workbench/services/preferences/browser/preferencesService.ts
...kbench/services/preferences/browser/preferencesService.ts
+1
-1
src/vs/workbench/services/preferences/common/preferences.ts
src/vs/workbench/services/preferences/common/preferences.ts
+41
-1
src/vs/workbench/services/preferences/test/browser/keybindingsEditorModel.test.ts
...s/preferences/test/browser/keybindingsEditorModel.test.ts
+2
-1
未找到文件。
src/vs/platform/keybinding/common/keybindingResolver.ts
浏览文件 @
c1274981
...
...
@@ -3,9 +3,6 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import
{
isNonEmptyArray
}
from
'
vs/base/common/arrays
'
;
import
{
isIMenuItem
,
MenuId
,
MenuRegistry
}
from
'
vs/platform/actions/common/actions
'
;
import
{
CommandsRegistry
,
ICommandHandlerDescription
}
from
'
vs/platform/commands/common/commands
'
;
import
{
IContext
,
ContextKeyExpression
,
ContextKeyExprType
}
from
'
vs/platform/contextkey/common/contextkey
'
;
import
{
ResolvedKeybindingItem
}
from
'
vs/platform/keybinding/common/resolvedKeybindingItem
'
;
...
...
@@ -340,44 +337,6 @@ export class KeybindingResolver {
}
return
rules
.
evaluate
(
context
);
}
public
static
getAllUnboundCommands
(
boundCommands
:
Map
<
string
,
boolean
>
):
string
[]
{
const
unboundCommands
:
string
[]
=
[];
const
seenMap
:
Map
<
string
,
boolean
>
=
new
Map
<
string
,
boolean
>
();
const
addCommand
=
(
id
:
string
,
includeCommandWithArgs
:
boolean
)
=>
{
if
(
seenMap
.
has
(
id
))
{
return
;
}
seenMap
.
set
(
id
,
true
);
if
(
id
[
0
]
===
'
_
'
||
id
.
indexOf
(
'
vscode.
'
)
===
0
)
{
// private command
return
;
}
if
(
boundCommands
.
get
(
id
)
===
true
)
{
return
;
}
if
(
!
includeCommandWithArgs
)
{
const
command
=
CommandsRegistry
.
getCommand
(
id
);
if
(
command
&&
typeof
command
.
description
===
'
object
'
&&
isNonEmptyArray
((
<
ICommandHandlerDescription
>
command
.
description
).
args
))
{
// command with args
return
;
}
}
unboundCommands
.
push
(
id
);
};
// Add all commands from Command Palette
for
(
const
menuItem
of
MenuRegistry
.
getMenuItems
(
MenuId
.
CommandPalette
))
{
if
(
isIMenuItem
(
menuItem
))
{
addCommand
(
menuItem
.
command
.
id
,
true
);
}
}
for
(
const
id
of
CommandsRegistry
.
getCommands
().
keys
())
{
addCommand
(
id
,
false
);
}
return
unboundCommands
;
}
}
function
printWhenExplanation
(
when
:
ContextKeyExpression
|
undefined
):
string
{
...
...
src/vs/workbench/contrib/preferences/browser/keybindingsEditor.ts
浏览文件 @
c1274981
...
...
@@ -18,7 +18,7 @@ import { EditorPane } from 'vs/workbench/browser/parts/editor/editorPane';
import
{
EditorOptions
,
IEditorOpenContext
}
from
'
vs/workbench/common/editor
'
;
import
{
ITelemetryService
}
from
'
vs/platform/telemetry/common/telemetry
'
;
import
{
IClipboardService
}
from
'
vs/platform/clipboard/common/clipboardService
'
;
import
{
KeybindingsEditorModel
,
IKeybindingItemEntry
,
IListEntry
,
KEYBINDING_ENTRY_TEMPLATE_ID
}
from
'
vs/workbench/services/preferences/common
/keybindingsEditorModel
'
;
import
{
KeybindingsEditorModel
,
KEYBINDING_ENTRY_TEMPLATE_ID
}
from
'
vs/workbench/services/preferences/browser
/keybindingsEditorModel
'
;
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
IKeybindingService
,
IUserFriendlyKeybinding
}
from
'
vs/platform/keybinding/common/keybinding
'
;
import
{
DefineKeybindingWidget
,
KeybindingsSearchWidget
}
from
'
vs/workbench/contrib/preferences/browser/keybindingWidgets
'
;
...
...
@@ -35,7 +35,7 @@ import { IEditorService } from 'vs/workbench/services/editor/common/editorServic
import
{
EditorExtensionsRegistry
}
from
'
vs/editor/browser/editorExtensions
'
;
import
{
WorkbenchList
}
from
'
vs/platform/list/browser/listService
'
;
import
{
INotificationService
}
from
'
vs/platform/notification/common/notification
'
;
import
{
KeybindingsEditorInput
}
from
'
vs/workbench/services/preferences/
common
/preferencesEditorInput
'
;
import
{
KeybindingsEditorInput
}
from
'
vs/workbench/services/preferences/
browser
/preferencesEditorInput
'
;
import
{
CancellationToken
}
from
'
vs/base/common/cancellation
'
;
import
{
attachStylerCallback
,
attachInputBoxStyler
,
attachCheckboxStyler
}
from
'
vs/platform/theme/common/styler
'
;
import
{
IStorageService
,
StorageScope
,
StorageTarget
}
from
'
vs/platform/storage/common/storage
'
;
...
...
@@ -46,7 +46,7 @@ import { IListAccessibilityProvider } from 'vs/base/browser/ui/list/listWidget';
import
{
Color
,
RGBA
}
from
'
vs/base/common/color
'
;
import
{
WORKBENCH_BACKGROUND
}
from
'
vs/workbench/common/theme
'
;
import
{
IBaseActionViewItemOptions
}
from
'
vs/base/browser/ui/actionbar/actionViewItems
'
;
import
{
IKeybinding
sEditorPane
}
from
'
vs/workbench/services/preferences/common/preferences
'
;
import
{
IKeybinding
ItemEntry
,
IKeybindingsEditorPane
,
IListEntry
}
from
'
vs/workbench/services/preferences/common/preferences
'
;
import
{
keybindingsRecordKeysIcon
,
keybindingsSortIcon
,
keybindingsAddIcon
,
preferencesClearInputIcon
,
keybindingsEditIcon
}
from
'
vs/workbench/contrib/preferences/browser/preferencesIcons
'
;
const
$
=
DOM
.
$
;
...
...
src/vs/workbench/contrib/preferences/browser/preferences.contribution.ts
浏览文件 @
c1274981
...
...
@@ -39,7 +39,7 @@ import { IEditorService } from 'vs/workbench/services/editor/common/editorServic
import
{
IWorkbenchEnvironmentService
}
from
'
vs/workbench/services/environment/common/environmentService
'
;
import
{
IExtensionService
}
from
'
vs/workbench/services/extensions/common/extensions
'
;
import
{
IPreferencesService
}
from
'
vs/workbench/services/preferences/common/preferences
'
;
import
{
DefaultPreferencesEditorInput
,
KeybindingsEditorInput
,
PreferencesEditorInput
,
SettingsEditor2Input
}
from
'
vs/workbench/services/preferences/
common
/preferencesEditorInput
'
;
import
{
DefaultPreferencesEditorInput
,
KeybindingsEditorInput
,
PreferencesEditorInput
,
SettingsEditor2Input
}
from
'
vs/workbench/services/preferences/
browser
/preferencesEditorInput
'
;
import
{
preferencesOpenSettingsIcon
}
from
'
vs/workbench/contrib/preferences/browser/preferencesIcons
'
;
const
SETTINGS_EDITOR_COMMAND_SEARCH
=
'
settings.action.search
'
;
...
...
src/vs/workbench/contrib/preferences/browser/preferencesEditor.ts
浏览文件 @
c1274981
...
...
@@ -49,7 +49,7 @@ import { CONTEXT_SETTINGS_EDITOR, CONTEXT_SETTINGS_JSON_EDITOR, CONTEXT_SETTINGS
import
{
IEditorGroup
,
IEditorGroupsService
}
from
'
vs/workbench/services/editor/common/editorGroupsService
'
;
import
{
IEditorService
}
from
'
vs/workbench/services/editor/common/editorService
'
;
import
{
IFilterResult
,
IPreferencesService
,
ISetting
,
ISettingsEditorModel
,
ISettingsGroup
,
SettingsEditorOptions
}
from
'
vs/workbench/services/preferences/common/preferences
'
;
import
{
DefaultPreferencesEditorInput
,
PreferencesEditorInput
}
from
'
vs/workbench/services/preferences/
common
/preferencesEditorInput
'
;
import
{
DefaultPreferencesEditorInput
,
PreferencesEditorInput
}
from
'
vs/workbench/services/preferences/
browser
/preferencesEditorInput
'
;
import
{
DefaultSettingsEditorModel
,
SettingsEditorModel
}
from
'
vs/workbench/services/preferences/common/preferencesModels
'
;
export
class
PreferencesEditor
extends
EditorPane
{
...
...
src/vs/workbench/contrib/preferences/browser/settingsEditor2.ts
浏览文件 @
c1274981
...
...
@@ -49,7 +49,7 @@ import { createTOCIterator, TOCTree, TOCTreeModel } from 'vs/workbench/contrib/p
import
{
CONTEXT_SETTINGS_EDITOR
,
CONTEXT_SETTINGS_ROW_FOCUS
,
CONTEXT_SETTINGS_SEARCH_FOCUS
,
CONTEXT_TOC_ROW_FOCUS
,
EXTENSION_SETTING_TAG
,
FEATURE_SETTING_TAG
,
ID_SETTING_TAG
,
IPreferencesSearchService
,
ISearchProvider
,
MODIFIED_SETTING_TAG
,
SETTINGS_EDITOR_COMMAND_CLEAR_SEARCH_RESULTS
}
from
'
vs/workbench/contrib/preferences/common/preferences
'
;
import
{
IEditorGroup
,
IEditorGroupsService
}
from
'
vs/workbench/services/editor/common/editorGroupsService
'
;
import
{
IPreferencesService
,
ISearchResult
,
ISettingsEditorModel
,
ISettingsEditorOptions
,
SettingsEditorOptions
,
SettingValueType
}
from
'
vs/workbench/services/preferences/common/preferences
'
;
import
{
SettingsEditor2Input
}
from
'
vs/workbench/services/preferences/
common
/preferencesEditorInput
'
;
import
{
SettingsEditor2Input
}
from
'
vs/workbench/services/preferences/
browser
/preferencesEditorInput
'
;
import
{
Settings2EditorModel
}
from
'
vs/workbench/services/preferences/common/preferencesModels
'
;
import
{
IUserDataSyncWorkbenchService
}
from
'
vs/workbench/services/userDataSync/common/userDataSync
'
;
import
{
preferencesClearInputIcon
}
from
'
vs/workbench/contrib/preferences/browser/preferencesIcons
'
;
...
...
src/vs/workbench/contrib/userDataSync/browser/userDataSyncTrigger.ts
浏览文件 @
c1274981
...
...
@@ -6,7 +6,7 @@
import
{
Event
}
from
'
vs/base/common/event
'
;
import
{
Disposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
IEditorService
}
from
'
vs/workbench/services/editor/common/editorService
'
;
import
{
SettingsEditor2Input
,
KeybindingsEditorInput
,
PreferencesEditorInput
}
from
'
vs/workbench/services/preferences/
common
/preferencesEditorInput
'
;
import
{
SettingsEditor2Input
,
KeybindingsEditorInput
,
PreferencesEditorInput
}
from
'
vs/workbench/services/preferences/
browser
/preferencesEditorInput
'
;
import
{
isEqual
}
from
'
vs/base/common/resources
'
;
import
{
IWorkbenchEnvironmentService
}
from
'
vs/workbench/services/environment/common/environmentService
'
;
import
{
VIEWLET_ID
}
from
'
vs/workbench/contrib/extensions/common/extensions
'
;
...
...
src/vs/workbench/services/keybinding/browser/keybindingService.ts
浏览文件 @
c1274981
...
...
@@ -50,6 +50,7 @@ import { BrowserFeatures, KeyboardSupport } from 'vs/base/browser/canIUse';
import
{
ILogService
}
from
'
vs/platform/log/common/log
'
;
import
{
ExtensionIdentifier
}
from
'
vs/platform/extensions/common/extensions
'
;
import
{
dirname
}
from
'
vs/base/common/resources
'
;
import
{
getAllUnboundCommands
}
from
'
vs/workbench/services/keybinding/browser/unboundCommands
'
;
interface
ContributedKeyBinding
{
command
:
string
;
...
...
@@ -594,7 +595,7 @@ export class WorkbenchKeybindingService extends AbstractKeybindingService {
}
private
static
_getAllCommandsAsComment
(
boundCommands
:
Map
<
string
,
boolean
>
):
string
{
const
unboundCommands
=
KeybindingResolver
.
getAllUnboundCommands
(
boundCommands
);
const
unboundCommands
=
getAllUnboundCommands
(
boundCommands
);
let
pretty
=
unboundCommands
.
sort
().
join
(
'
\n
// -
'
);
return
'
//
'
+
nls
.
localize
(
'
unboundCommands
'
,
"
Here are other available commands:
"
)
+
'
\n
// -
'
+
pretty
;
}
...
...
src/vs/workbench/services/keybinding/browser/unboundCommands.ts
0 → 100644
浏览文件 @
c1274981
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import
{
CommandsRegistry
,
ICommandHandlerDescription
}
from
'
vs/platform/commands/common/commands
'
;
import
{
isNonEmptyArray
}
from
'
vs/base/common/arrays
'
;
import
{
EditorExtensionsRegistry
}
from
'
vs/editor/browser/editorExtensions
'
;
import
{
MenuRegistry
,
MenuId
,
isIMenuItem
}
from
'
vs/platform/actions/common/actions
'
;
export
function
getAllUnboundCommands
(
boundCommands
:
Map
<
string
,
boolean
>
):
string
[]
{
const
unboundCommands
:
string
[]
=
[];
const
seenMap
:
Map
<
string
,
boolean
>
=
new
Map
<
string
,
boolean
>
();
const
addCommand
=
(
id
:
string
,
includeCommandWithArgs
:
boolean
)
=>
{
if
(
seenMap
.
has
(
id
))
{
return
;
}
seenMap
.
set
(
id
,
true
);
if
(
id
[
0
]
===
'
_
'
||
id
.
indexOf
(
'
vscode.
'
)
===
0
)
{
// private command
return
;
}
if
(
boundCommands
.
get
(
id
)
===
true
)
{
return
;
}
if
(
!
includeCommandWithArgs
)
{
const
command
=
CommandsRegistry
.
getCommand
(
id
);
if
(
command
&&
typeof
command
.
description
===
'
object
'
&&
isNonEmptyArray
((
<
ICommandHandlerDescription
>
command
.
description
).
args
))
{
// command with args
return
;
}
}
unboundCommands
.
push
(
id
);
};
// Add all commands from Command Palette
for
(
const
menuItem
of
MenuRegistry
.
getMenuItems
(
MenuId
.
CommandPalette
))
{
if
(
isIMenuItem
(
menuItem
))
{
addCommand
(
menuItem
.
command
.
id
,
true
);
}
}
// Add all editor actions
for
(
const
editorAction
of
EditorExtensionsRegistry
.
getEditorActions
())
{
addCommand
(
editorAction
.
id
,
true
);
}
for
(
const
id
of
CommandsRegistry
.
getCommands
().
keys
())
{
addCommand
(
id
,
false
);
}
return
unboundCommands
;
}
src/vs/workbench/services/preferences/
common
/keybindingsEditorModel.ts
→
src/vs/workbench/services/preferences/
browser
/keybindingsEditorModel.ts
浏览文件 @
c1274981
...
...
@@ -16,7 +16,8 @@ import { IWorkbenchActionRegistry, Extensions as ActionExtensions } from 'vs/wor
import
{
EditorModel
}
from
'
vs/workbench/common/editor
'
;
import
{
IKeybindingService
}
from
'
vs/platform/keybinding/common/keybinding
'
;
import
{
ResolvedKeybindingItem
}
from
'
vs/platform/keybinding/common/resolvedKeybindingItem
'
;
import
{
KeybindingResolver
}
from
'
vs/platform/keybinding/common/keybindingResolver
'
;
import
{
getAllUnboundCommands
}
from
'
vs/workbench/services/keybinding/browser/unboundCommands
'
;
import
{
IKeybindingItemEntry
,
KeybindingMatches
,
KeybindingMatch
,
IKeybindingItem
}
from
'
vs/workbench/services/preferences/common/preferences
'
;
export
const
KEYBINDING_ENTRY_TEMPLATE_ID
=
'
keybinding.entry.template
'
;
...
...
@@ -24,44 +25,6 @@ const SOURCE_DEFAULT = localize('default', "Default");
const
SOURCE_EXTENSION
=
localize
(
'
extension
'
,
"
Extension
"
);
const
SOURCE_USER
=
localize
(
'
user
'
,
"
User
"
);
export
interface
KeybindingMatch
{
ctrlKey
?:
boolean
;
shiftKey
?:
boolean
;
altKey
?:
boolean
;
metaKey
?:
boolean
;
keyCode
?:
boolean
;
}
export
interface
KeybindingMatches
{
firstPart
:
KeybindingMatch
;
chordPart
:
KeybindingMatch
;
}
export
interface
IListEntry
{
id
:
string
;
templateId
:
string
;
}
export
interface
IKeybindingItemEntry
extends
IListEntry
{
keybindingItem
:
IKeybindingItem
;
commandIdMatches
?:
IMatch
[];
commandLabelMatches
?:
IMatch
[];
commandDefaultLabelMatches
?:
IMatch
[];
sourceMatches
?:
IMatch
[];
whenMatches
?:
IMatch
[];
keybindingMatches
?:
KeybindingMatches
;
}
export
interface
IKeybindingItem
{
keybinding
:
ResolvedKeybinding
;
keybindingItem
:
ResolvedKeybindingItem
;
commandLabel
:
string
;
commandDefaultLabel
:
string
;
command
:
string
;
source
:
string
;
when
:
string
;
}
interface
ModifierLabels
{
ui
:
ModLabels
;
aria
:
ModLabels
;
...
...
@@ -190,7 +153,7 @@ export class KeybindingsEditorModel extends EditorModel {
}
const
commandsWithDefaultKeybindings
=
this
.
keybindingsService
.
getDefaultKeybindings
().
map
(
keybinding
=>
keybinding
.
command
);
for
(
const
command
of
KeybindingResolver
.
getAllUnboundCommands
(
boundCommands
))
{
for
(
const
command
of
getAllUnboundCommands
(
boundCommands
))
{
const
keybindingItem
=
new
ResolvedKeybindingItem
(
undefined
,
command
,
null
,
undefined
,
commandsWithDefaultKeybindings
.
indexOf
(
command
)
===
-
1
,
null
,
false
);
this
.
_keybindingItemsSortedByPrecedence
.
push
(
KeybindingsEditorModel
.
toKeybindingEntry
(
command
,
keybindingItem
,
workbenchActionsRegistry
,
actionLabels
));
}
...
...
src/vs/workbench/services/preferences/
common
/preferencesEditorInput.ts
→
src/vs/workbench/services/preferences/
browser
/preferencesEditorInput.ts
浏览文件 @
c1274981
...
...
@@ -10,7 +10,7 @@ import * as nls from 'vs/nls';
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
EditorInput
,
SideBySideEditorInput
,
Verbosity
}
from
'
vs/workbench/common/editor
'
;
import
{
ResourceEditorInput
}
from
'
vs/workbench/common/editor/resourceEditorInput
'
;
import
{
KeybindingsEditorModel
}
from
'
vs/workbench/services/preferences/
common
/keybindingsEditorModel
'
;
import
{
KeybindingsEditorModel
}
from
'
vs/workbench/services/preferences/
browser
/keybindingsEditorModel
'
;
import
{
IPreferencesService
}
from
'
vs/workbench/services/preferences/common/preferences
'
;
import
{
Settings2EditorModel
}
from
'
vs/workbench/services/preferences/common/preferencesModels
'
;
import
{
ITextFileService
}
from
'
vs/workbench/services/textfile/common/textfiles
'
;
...
...
src/vs/workbench/services/preferences/browser/preferencesService.ts
浏览文件 @
c1274981
...
...
@@ -30,7 +30,7 @@ import { IJSONEditingService } from 'vs/workbench/services/configuration/common/
import
{
IEditorService
}
from
'
vs/workbench/services/editor/common/editorService
'
;
import
{
GroupDirection
,
IEditorGroup
,
IEditorGroupsService
}
from
'
vs/workbench/services/editor/common/editorGroupsService
'
;
import
{
DEFAULT_SETTINGS_EDITOR_SETTING
,
FOLDER_SETTINGS_PATH
,
getSettingsTargetName
,
IKeybindingsEditorOptions
,
IKeybindingsEditorPane
,
IPreferencesEditorModel
,
IPreferencesService
,
ISetting
,
ISettingsEditorOptions
,
SettingsEditorOptions
,
USE_SPLIT_JSON_SETTING
}
from
'
vs/workbench/services/preferences/common/preferences
'
;
import
{
DefaultPreferencesEditorInput
,
KeybindingsEditorInput
,
PreferencesEditorInput
,
SettingsEditor2Input
}
from
'
vs/workbench/services/preferences/
common
/preferencesEditorInput
'
;
import
{
DefaultPreferencesEditorInput
,
KeybindingsEditorInput
,
PreferencesEditorInput
,
SettingsEditor2Input
}
from
'
vs/workbench/services/preferences/
browser
/preferencesEditorInput
'
;
import
{
defaultKeybindingsContents
,
DefaultKeybindingsEditorModel
,
DefaultSettings
,
DefaultSettingsEditorModel
,
Settings2EditorModel
,
SettingsEditorModel
,
WorkspaceConfigurationEditorModel
,
DefaultRawSettingsEditorModel
}
from
'
vs/workbench/services/preferences/common/preferencesModels
'
;
import
{
registerSingleton
}
from
'
vs/platform/instantiation/common/extensions
'
;
import
{
IRemoteAgentService
}
from
'
vs/workbench/services/remote/common/remoteAgentService
'
;
...
...
src/vs/workbench/services/preferences/common/preferences.ts
浏览文件 @
c1274981
...
...
@@ -18,7 +18,9 @@ import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace
import
{
EditorOptions
,
IEditorPane
}
from
'
vs/workbench/common/editor
'
;
import
{
IEditorGroup
}
from
'
vs/workbench/services/editor/common/editorGroupsService
'
;
import
{
Settings2EditorModel
}
from
'
vs/workbench/services/preferences/common/preferencesModels
'
;
import
{
IKeybindingItemEntry
}
from
'
vs/workbench/services/preferences/common/keybindingsEditorModel
'
;
import
{
IMatch
}
from
'
vs/base/common/filters
'
;
import
{
ResolvedKeybinding
}
from
'
vs/base/common/keyCodes
'
;
import
{
ResolvedKeybindingItem
}
from
'
vs/platform/keybinding/common/resolvedKeybindingItem
'
;
export
enum
SettingValueType
{
Null
=
'
null
'
,
...
...
@@ -241,6 +243,44 @@ export function getSettingsTargetName(target: ConfigurationTarget, resource: URI
return
''
;
}
export
interface
KeybindingMatch
{
ctrlKey
?:
boolean
;
shiftKey
?:
boolean
;
altKey
?:
boolean
;
metaKey
?:
boolean
;
keyCode
?:
boolean
;
}
export
interface
KeybindingMatches
{
firstPart
:
KeybindingMatch
;
chordPart
:
KeybindingMatch
;
}
export
interface
IListEntry
{
id
:
string
;
templateId
:
string
;
}
export
interface
IKeybindingItemEntry
extends
IListEntry
{
keybindingItem
:
IKeybindingItem
;
commandIdMatches
?:
IMatch
[];
commandLabelMatches
?:
IMatch
[];
commandDefaultLabelMatches
?:
IMatch
[];
sourceMatches
?:
IMatch
[];
whenMatches
?:
IMatch
[];
keybindingMatches
?:
KeybindingMatches
;
}
export
interface
IKeybindingItem
{
keybinding
:
ResolvedKeybinding
;
keybindingItem
:
ResolvedKeybindingItem
;
commandLabel
:
string
;
commandDefaultLabel
:
string
;
command
:
string
;
source
:
string
;
when
:
string
;
}
export
interface
IKeybindingsEditorPane
extends
IEditorPane
{
readonly
activeKeybindingEntry
:
IKeybindingItemEntry
|
null
;
...
...
src/vs/workbench/services/preferences/test/
common
/keybindingsEditorModel.test.ts
→
src/vs/workbench/services/preferences/test/
browser
/keybindingsEditorModel.test.ts
浏览文件 @
c1274981
...
...
@@ -15,11 +15,12 @@ import { IWorkbenchActionRegistry, Extensions as ActionExtensions } from 'vs/wor
import
{
IKeybindingService
}
from
'
vs/platform/keybinding/common/keybinding
'
;
import
{
IExtensionService
}
from
'
vs/workbench/services/extensions/common/extensions
'
;
import
{
ContextKeyExpr
}
from
'
vs/platform/contextkey/common/contextkey
'
;
import
{
KeybindingsEditorModel
,
IKeybindingItemEntry
}
from
'
vs/workbench/services/preferences/common
/keybindingsEditorModel
'
;
import
{
KeybindingsEditorModel
}
from
'
vs/workbench/services/preferences/browser
/keybindingsEditorModel
'
;
import
{
ResolvedKeybindingItem
}
from
'
vs/platform/keybinding/common/resolvedKeybindingItem
'
;
import
{
USLayoutResolvedKeybinding
}
from
'
vs/platform/keybinding/common/usLayoutResolvedKeybinding
'
;
import
{
TestInstantiationService
}
from
'
vs/platform/instantiation/test/common/instantiationServiceMock
'
;
import
{
IKeybindingItemEntry
}
from
'
vs/workbench/services/preferences/common/preferences
'
;
interface
Modifiers
{
metaKey
?:
boolean
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录