Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
e79e1cfb
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,发现更多精彩内容 >>
提交
e79e1cfb
编写于
9月 26, 2020
作者:
R
Rob Lourens
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Prefs actions clean up, add to command palette
上级
e96516c8
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
25 addition
and
52 deletion
+25
-52
src/vs/workbench/contrib/preferences/browser/preferences.contribution.ts
...h/contrib/preferences/browser/preferences.contribution.ts
+25
-52
未找到文件。
src/vs/workbench/contrib/preferences/browser/preferences.contribution.ts
浏览文件 @
e79e1cfb
...
...
@@ -51,7 +51,6 @@ const SETTINGS_EDITOR_COMMAND_EDIT_FOCUSED_SETTING = 'settings.action.editFocuse
const
SETTINGS_EDITOR_COMMAND_FOCUS_SETTINGS_FROM_SEARCH
=
'
settings.action.focusSettingsFromSearch
'
;
const
SETTINGS_EDITOR_COMMAND_FOCUS_SETTINGS_LIST
=
'
settings.action.focusSettingsList
'
;
const
SETTINGS_EDITOR_COMMAND_FOCUS_TOC
=
'
settings.action.focusTOC
'
;
const
SETTINGS_EDITOR_COMMAND_FOCUS_TOC2
=
'
settings.action.focusTOC2
'
;
const
SETTINGS_EDITOR_COMMAND_FOCUS_CONTROL
=
'
settings.action.focusSettingControl
'
;
const
SETTINGS_EDITOR_COMMAND_SWITCH_TO_JSON
=
'
settings.switchToJSON
'
;
...
...
@@ -168,6 +167,8 @@ Registry.as<IEditorInputFactoryRegistry>(EditorInputExtensions.EditorInputFactor
const
OPEN_SETTINGS2_ACTION_TITLE
=
{
value
:
nls
.
localize
(
'
openSettings2
'
,
"
Open Settings (UI)
"
),
original
:
'
Open Settings (UI)
'
};
const
category
=
{
value
:
nls
.
localize
(
'
preferences
'
,
"
Preferences
"
),
original
:
'
Preferences
'
};
class
PreferencesActionsContribution
extends
Disposable
implements
IWorkbenchContribution
{
constructor
(
...
...
@@ -189,7 +190,6 @@ class PreferencesActionsContribution extends Disposable implements IWorkbenchCon
private
registerSettingsActions
()
{
const
that
=
this
;
const
category
=
{
value
:
nls
.
localize
(
'
preferences
'
,
"
Preferences
"
),
original
:
'
Preferences
'
};
registerAction2
(
class
extends
Action2
{
constructor
()
{
super
({
...
...
@@ -226,7 +226,7 @@ class PreferencesActionsContribution extends Disposable implements IWorkbenchCon
id
:
'
workbench.action.openSettings2
'
,
title
:
{
value
:
nls
.
localize
(
'
openSettings2
'
,
"
Open Settings (UI)
"
),
original
:
'
Open Settings (UI)
'
},
category
,
menu
:
{
id
:
MenuId
.
CommandPalette
}
f1
:
true
,
});
}
run
(
accessor
:
ServicesAccessor
)
{
...
...
@@ -239,7 +239,7 @@ class PreferencesActionsContribution extends Disposable implements IWorkbenchCon
id
:
'
workbench.action.openSettingsJson
'
,
title
:
{
value
:
nls
.
localize
(
'
openSettingsJson
'
,
"
Open Settings (JSON)
"
),
original
:
'
Open Settings (JSON)
'
},
category
,
menu
:
{
id
:
MenuId
.
CommandPalette
}
f1
:
true
,
});
}
run
(
accessor
:
ServicesAccessor
)
{
...
...
@@ -252,7 +252,7 @@ class PreferencesActionsContribution extends Disposable implements IWorkbenchCon
id
:
'
workbench.action.openGlobalSettings
'
,
title
:
{
value
:
nls
.
localize
(
'
openGlobalSettings
'
,
"
Open User Settings
"
),
original
:
'
Open User Settings
'
},
category
,
menu
:
{
id
:
MenuId
.
CommandPalette
}
f1
:
true
,
});
}
run
(
accessor
:
ServicesAccessor
)
{
...
...
@@ -265,7 +265,7 @@ class PreferencesActionsContribution extends Disposable implements IWorkbenchCon
id
:
'
workbench.action.openRawDefaultSettings
'
,
title
:
{
value
:
nls
.
localize
(
'
openRawDefaultSettings
'
,
"
Open Default Settings (JSON)
"
),
original
:
'
Open Default Settings (JSON)
'
},
category
,
menu
:
{
id
:
MenuId
.
CommandPalette
}
f1
:
true
,
});
}
run
(
accessor
:
ServicesAccessor
)
{
...
...
@@ -318,7 +318,7 @@ class PreferencesActionsContribution extends Disposable implements IWorkbenchCon
id
:
ConfigureLanguageBasedSettingsAction
.
ID
,
title
:
ConfigureLanguageBasedSettingsAction
.
LABEL
,
category
,
menu
:
{
id
:
MenuId
.
CommandPalette
}
f1
:
true
,
});
}
run
(
accessor
:
ServicesAccessor
)
{
...
...
@@ -522,30 +522,15 @@ class PreferencesActionsContribution extends Disposable implements IWorkbenchCon
constructor
()
{
super
({
id
:
SETTINGS_EDITOR_COMMAND_SEARCH
,
precondition
:
C
ontextKeyExpr
.
and
(
CONTEXT_SETTINGS_EDITOR
)
,
precondition
:
C
ONTEXT_SETTINGS_EDITOR
,
keybinding
:
{
primary
:
KeyMod
.
CtrlCmd
|
KeyCode
.
KEY_F
,
weight
:
KeybindingWeight
.
EditorContrib
,
when
:
null
},
title
:
nls
.
localize
(
'
settings.focusSearch
'
,
"
Focus settings search
"
)
});
}
run
(
accessor
:
ServicesAccessor
)
{
settingsEditorFocusSearch
(
accessor
);
}
});
registerAction2
(
class
extends
Action2
{
constructor
()
{
super
({
id
:
SETTINGS_EDITOR_COMMAND_SEARCH
,
precondition
:
ContextKeyExpr
.
and
(
CONTEXT_SETTINGS_EDITOR
,
CONTEXT_TOC_ROW_FOCUS
),
keybinding
:
{
primary
:
KeyCode
.
Escape
,
weight
:
KeybindingWeight
.
WorkbenchContrib
,
when
:
null
},
title
:
nls
.
localize
(
'
settings.focusSearch
'
,
"
Focus settings search
"
)
category
,
f1
:
true
,
title
:
nls
.
localize
(
'
settings.focusSearch
'
,
"
Focus Settings Search
"
)
});
}
...
...
@@ -556,13 +541,15 @@ class PreferencesActionsContribution extends Disposable implements IWorkbenchCon
constructor
()
{
super
({
id
:
SETTINGS_EDITOR_COMMAND_CLEAR_SEARCH_RESULTS
,
precondition
:
CONTEXT_SETTINGS_
SEARCH_FOCUS
,
precondition
:
CONTEXT_SETTINGS_
EDITOR
,
keybinding
:
{
primary
:
KeyCode
.
Escape
,
weight
:
KeybindingWeight
.
EditorContrib
,
when
:
null
when
:
CONTEXT_SETTINGS_SEARCH_FOCUS
},
title
:
nls
.
localize
(
'
settings.clearResults
'
,
"
Clear settings search results
"
)
category
,
f1
:
true
,
title
:
nls
.
localize
(
'
settings.clearResults
'
,
"
Clear Settings Search Results
"
)
});
}
...
...
@@ -714,6 +701,8 @@ class PreferencesActionsContribution extends Disposable implements IWorkbenchCon
constructor
()
{
super
({
id
:
SETTINGS_EDITOR_COMMAND_FOCUS_TOC
,
precondition
:
CONTEXT_SETTINGS_EDITOR
,
f1
:
true
,
keybinding
:
[
{
primary
:
KeyCode
.
Escape
,
...
...
@@ -725,7 +714,8 @@ class PreferencesActionsContribution extends Disposable implements IWorkbenchCon
weight
:
KeybindingWeight
.
WorkbenchContrib
,
when
:
ContextKeyExpr
.
and
(
CONTEXT_SETTINGS_EDITOR
,
CONTEXT_TOC_ROW_FOCUS
.
negate
(),
InputFocusedContext
.
negate
())
}],
title
:
nls
.
localize
(
'
settings.focusSettingsTOC
'
,
"
Focus settings TOC tree
"
)
category
,
title
:
nls
.
localize
(
'
settings.focusSettingsTOC
'
,
"
Focus Settings Table of Contents
"
)
});
}
...
...
@@ -752,7 +742,7 @@ class PreferencesActionsContribution extends Disposable implements IWorkbenchCon
primary
:
KeyCode
.
Enter
,
weight
:
KeybindingWeight
.
WorkbenchContrib
,
},
title
:
nls
.
localize
(
'
settings.focusSettingControl
'
,
"
Focus
setting c
ontrol
"
)
title
:
nls
.
localize
(
'
settings.focusSettingControl
'
,
"
Focus
Setting C
ontrol
"
)
});
}
...
...
@@ -768,36 +758,19 @@ class PreferencesActionsContribution extends Disposable implements IWorkbenchCon
}
});
registerAction2
(
class
extends
Action2
{
constructor
()
{
super
({
id
:
SETTINGS_EDITOR_COMMAND_FOCUS_TOC2
,
title
:
nls
.
localize
(
'
settings.focusSettingsTOC
'
,
"
Focus settings TOC tree
"
)
});
}
run
(
accessor
:
ServicesAccessor
):
void
{
const
preferencesEditor
=
getPreferencesEditor
(
accessor
);
if
(
!
(
preferencesEditor
instanceof
SettingsEditor2
))
{
return
;
}
preferencesEditor
.
focusTOC
();
}
});
registerAction2
(
class
extends
Action2
{
constructor
()
{
super
({
id
:
SETTINGS_EDITOR_COMMAND_SHOW_CONTEXT_MENU
,
precondition
:
C
ontextKeyExpr
.
and
(
CONTEXT_SETTINGS_EDITOR
)
,
precondition
:
C
ONTEXT_SETTINGS_EDITOR
,
keybinding
:
{
primary
:
KeyMod
.
Shift
|
KeyCode
.
F9
,
weight
:
KeybindingWeight
.
WorkbenchContrib
,
when
:
null
},
title
:
nls
.
localize
(
'
settings.showContextMenu
'
,
"
Show context menu
"
)
f1
:
true
,
category
,
title
:
nls
.
localize
(
'
settings.showContextMenu
'
,
"
Show Setting Context Menu
"
)
});
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录