Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
8fcfcb50
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,发现更多精彩内容 >>
提交
8fcfcb50
编写于
7月 23, 2018
作者:
A
Arjun Attam
提交者:
Matt Bierner
7月 23, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Adds webview select-all command (#54851)
上级
b28ea40d
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
30 addition
and
1 deletion
+30
-1
src/vs/workbench/parts/webview/electron-browser/baseWebviewEditor.ts
...bench/parts/webview/electron-browser/baseWebviewEditor.ts
+6
-0
src/vs/workbench/parts/webview/electron-browser/webview.contribution.ts
...ch/parts/webview/electron-browser/webview.contribution.ts
+9
-1
src/vs/workbench/parts/webview/electron-browser/webviewCommands.ts
...rkbench/parts/webview/electron-browser/webviewCommands.ts
+11
-0
src/vs/workbench/parts/webview/electron-browser/webviewElement.ts
...orkbench/parts/webview/electron-browser/webviewElement.ts
+4
-0
未找到文件。
src/vs/workbench/parts/webview/electron-browser/baseWebviewEditor.ts
浏览文件 @
8fcfcb50
...
...
@@ -77,4 +77,10 @@ export abstract class BaseWebviewEditor extends BaseEditor {
this
.
_webview
.
focus
();
}
}
public
selectAll
():
void
{
if
(
this
.
_webview
)
{
this
.
_webview
.
selectAll
();
}
}
}
src/vs/workbench/parts/webview/electron-browser/webview.contribution.ts
浏览文件 @
8fcfcb50
...
...
@@ -16,7 +16,7 @@ import { Extensions as ActionExtensions, IWorkbenchActionRegistry } from 'vs/wor
import
{
Extensions
as
EditorInputExtensions
,
IEditorInputFactoryRegistry
}
from
'
vs/workbench/common/editor
'
;
import
{
WebviewEditorInputFactory
}
from
'
vs/workbench/parts/webview/electron-browser/webviewEditorInputFactory
'
;
import
{
KEYBINDING_CONTEXT_WEBVIEWEDITOR_FOCUS
,
KEYBINDING_CONTEXT_WEBVIEW_FIND_WIDGET_VISIBLE
}
from
'
./baseWebviewEditor
'
;
import
{
HideWebViewEditorFindCommand
,
OpenWebviewDeveloperToolsAction
,
ReloadWebviewAction
,
ShowWebViewEditorFindWidgetCommand
}
from
'
./webviewCommands
'
;
import
{
HideWebViewEditorFindCommand
,
OpenWebviewDeveloperToolsAction
,
ReloadWebviewAction
,
ShowWebViewEditorFindWidgetCommand
,
SelectAllWebviewEditorCommand
}
from
'
./webviewCommands
'
;
import
{
WebviewEditor
}
from
'
./webviewEditor
'
;
import
{
WebviewEditorInput
}
from
'
./webviewEditorInput
'
;
import
{
IWebviewEditorService
,
WebviewEditorService
}
from
'
./webviewEditorService
'
;
...
...
@@ -58,6 +58,14 @@ const hideCommand = new HideWebViewEditorFindCommand({
});
KeybindingsRegistry
.
registerCommandAndKeybindingRule
(
hideCommand
.
toCommandAndKeybindingRule
(
KeybindingsRegistry
.
WEIGHT
.
editorContrib
()));
const
selectAllCommand
=
new
SelectAllWebviewEditorCommand
({
id
:
SelectAllWebviewEditorCommand
.
ID
,
precondition
:
KEYBINDING_CONTEXT_WEBVIEWEDITOR_FOCUS
,
kbOpts
:
{
primary
:
KeyMod
.
CtrlCmd
|
KeyCode
.
KEY_A
}
});
KeybindingsRegistry
.
registerCommandAndKeybindingRule
(
selectAllCommand
.
toCommandAndKeybindingRule
(
KeybindingsRegistry
.
WEIGHT
.
editorContrib
()));
actionRegistry
.
registerWorkbenchAction
(
new
SyncActionDescriptor
(
OpenWebviewDeveloperToolsAction
,
OpenWebviewDeveloperToolsAction
.
ID
,
OpenWebviewDeveloperToolsAction
.
LABEL
),
...
...
src/vs/workbench/parts/webview/electron-browser/webviewCommands.ts
浏览文件 @
8fcfcb50
...
...
@@ -33,6 +33,17 @@ export class HideWebViewEditorFindCommand extends Command {
}
}
export
class
SelectAllWebviewEditorCommand
extends
Command
{
public
static
readonly
ID
=
'
editor.action.webvieweditor.selectAll
'
;
public
runCommand
(
accessor
:
ServicesAccessor
,
args
:
any
):
void
{
const
webViewEditor
=
getActiveWebviewEditor
(
accessor
);
if
(
webViewEditor
)
{
webViewEditor
.
selectAll
();
}
}
}
export
class
OpenWebviewDeveloperToolsAction
extends
Action
{
static
readonly
ID
=
'
workbench.action.webview.openDeveloperTools
'
;
static
readonly
LABEL
=
nls
.
localize
(
'
openToolsLabel
'
,
"
Open Webview Developer Tools
"
);
...
...
src/vs/workbench/parts/webview/electron-browser/webviewElement.ts
浏览文件 @
8fcfcb50
...
...
@@ -443,6 +443,10 @@ export class WebviewElement extends Disposable {
public
reload
()
{
this
.
contents
=
this
.
_contents
;
}
public
selectAll
()
{
this
.
_webview
.
selectAll
();
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录