Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
9370f422
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,发现更多精彩内容 >>
提交
9370f422
编写于
2月 06, 2020
作者:
S
Sandeep Somavarapu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
#89348 use registerAction2
上级
5dfac7fa
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
47 addition
and
38 deletion
+47
-38
src/vs/workbench/contrib/extensions/browser/extensionEditor.ts
...s/workbench/contrib/extensions/browser/extensionEditor.ts
+47
-38
未找到文件。
src/vs/workbench/contrib/extensions/browser/extensionEditor.ts
浏览文件 @
9370f422
...
...
@@ -34,7 +34,6 @@ import { IOpenerService, matchesScheme } from 'vs/platform/opener/common/opener'
import
{
IThemeService
}
from
'
vs/platform/theme/common/themeService
'
;
import
{
KeybindingLabel
}
from
'
vs/base/browser/ui/keybindingLabel/keybindingLabel
'
;
import
{
ContextKeyExpr
}
from
'
vs/platform/contextkey/common/contextkey
'
;
import
{
Command
}
from
'
vs/editor/browser/editorExtensions
'
;
import
{
IEditorService
}
from
'
vs/workbench/services/editor/common/editorService
'
;
import
{
KeybindingWeight
}
from
'
vs/platform/keybinding/common/keybindingsRegistry
'
;
import
{
Color
}
from
'
vs/base/common/color
'
;
...
...
@@ -60,6 +59,7 @@ import { IModeService } from 'vs/editor/common/services/modeService';
import
{
TokenizationRegistry
}
from
'
vs/editor/common/modes
'
;
import
{
generateTokensCSSForColorMap
}
from
'
vs/editor/common/modes/supports/tokenization
'
;
import
{
editorBackground
}
from
'
vs/platform/theme/common/colorRegistry
'
;
import
{
registerAction2
,
Action2
}
from
'
vs/platform/actions/common/actions
'
;
function
removeEmbeddedSVGs
(
documentContent
:
string
):
string
{
const
newDocument
=
new
DOMParser
().
parseFromString
(
documentContent
,
'
text/html
'
);
...
...
@@ -1397,60 +1397,69 @@ export class ExtensionEditor extends BaseEditor {
}
const
contextKeyExpr
=
ContextKeyExpr
.
and
(
ContextKeyExpr
.
equals
(
'
activeEditor
'
,
ExtensionEditor
.
ID
),
ContextKeyExpr
.
not
(
'
editorFocus
'
));
class
ShowExtensionEditorFindCommand
extends
Command
{
public
runCommand
(
accessor
:
ServicesAccessor
,
args
:
any
):
void
{
registerAction2
(
class
ShowExtensionEditorFindAction
extends
Action2
{
constructor
()
{
super
({
id
:
'
editor.action.extensioneditor.showfind
'
,
title
:
localize
(
'
find
'
,
"
Find
"
),
keybinding
:
{
when
:
contextKeyExpr
,
weight
:
KeybindingWeight
.
EditorContrib
,
primary
:
KeyMod
.
CtrlCmd
|
KeyCode
.
KEY_F
,
}
});
}
run
(
accessor
:
ServicesAccessor
):
any
{
const
extensionEditor
=
getExtensionEditor
(
accessor
);
if
(
extensionEditor
)
{
extensionEditor
.
showFind
();
}
}
}
(
new
ShowExtensionEditorFindCommand
({
id
:
'
editor.action.extensioneditor.showfind
'
,
precondition
:
contextKeyExpr
,
kbOpts
:
{
primary
:
KeyMod
.
CtrlCmd
|
KeyCode
.
KEY_F
,
weight
:
KeybindingWeight
.
EditorContrib
});
registerAction2
(
class
StartExtensionEditorFindNextAction
extends
Action2
{
constructor
()
{
super
({
id
:
'
editor.action.extensioneditor.findNext
'
,
title
:
localize
(
'
find next
'
,
"
Find Next
"
),
keybinding
:
{
when
:
ContextKeyExpr
.
and
(
contextKeyExpr
,
KEYBINDING_CONTEXT_WEBVIEW_FIND_WIDGET_FOCUSED
),
primary
:
KeyCode
.
Enter
,
weight
:
KeybindingWeight
.
EditorContrib
}
});
}
})).
register
();
class
StartExtensionEditorFindNextCommand
extends
Command
{
public
runCommand
(
accessor
:
ServicesAccessor
,
args
:
any
):
void
{
run
(
accessor
:
ServicesAccessor
):
any
{
const
extensionEditor
=
getExtensionEditor
(
accessor
);
if
(
extensionEditor
)
{
extensionEditor
.
runFindAction
(
false
);
}
}
}
(
new
StartExtensionEditorFindNextCommand
({
id
:
'
editor.action.extensioneditor.findNext
'
,
precondition
:
ContextKeyExpr
.
and
(
contextKeyExpr
,
KEYBINDING_CONTEXT_WEBVIEW_FIND_WIDGET_FOCUSED
),
kbOpts
:
{
primary
:
KeyCode
.
Enter
,
weight
:
KeybindingWeight
.
EditorContrib
});
registerAction2
(
class
StartExtensionEditorFindPreviousAction
extends
Action2
{
constructor
()
{
super
({
id
:
'
editor.action.extensioneditor.findPrevious
'
,
title
:
localize
(
'
find previous
'
,
"
Find Previous
"
),
keybinding
:
{
when
:
ContextKeyExpr
.
and
(
contextKeyExpr
,
KEYBINDING_CONTEXT_WEBVIEW_FIND_WIDGET_FOCUSED
),
primary
:
KeyMod
.
Shift
|
KeyCode
.
Enter
,
weight
:
KeybindingWeight
.
EditorContrib
}
});
}
})).
register
();
class
StartExtensionEditorFindPreviousCommand
extends
Command
{
public
runCommand
(
accessor
:
ServicesAccessor
,
args
:
any
):
void
{
run
(
accessor
:
ServicesAccessor
):
any
{
const
extensionEditor
=
getExtensionEditor
(
accessor
);
if
(
extensionEditor
)
{
extensionEditor
.
runFindAction
(
true
);
}
}
}
(
new
StartExtensionEditorFindPreviousCommand
({
id
:
'
editor.action.extensioneditor.findPrevious
'
,
precondition
:
ContextKeyExpr
.
and
(
contextKeyExpr
,
KEYBINDING_CONTEXT_WEBVIEW_FIND_WIDGET_FOCUSED
),
kbOpts
:
{
primary
:
KeyMod
.
Shift
|
KeyCode
.
Enter
,
weight
:
KeybindingWeight
.
EditorContrib
}
})).
register
();
});
function
getExtensionEditor
(
accessor
:
ServicesAccessor
):
ExtensionEditor
|
null
{
const
activeControl
=
accessor
.
get
(
IEditorService
).
activeControl
as
ExtensionEditor
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录