Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
6cfe053d
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,发现更多精彩内容 >>
提交
6cfe053d
编写于
6月 17, 2019
作者:
M
Matt Bierner
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Move `Open Webview Developer tools` to electron contribution point
I don't think we can programatically open dev tools on the web
上级
85e96fb4
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
44 addition
and
34 deletion
+44
-34
src/vs/workbench/contrib/webview/browser/webview.contribution.ts
...workbench/contrib/webview/browser/webview.contribution.ts
+2
-10
src/vs/workbench/contrib/webview/browser/webviewCommands.ts
src/vs/workbench/contrib/webview/browser/webviewCommands.ts
+0
-24
src/vs/workbench/contrib/webview/common/webview.ts
src/vs/workbench/contrib/webview/common/webview.ts
+3
-0
src/vs/workbench/contrib/webview/electron-browser/pre/webviewCommands.ts
...h/contrib/webview/electron-browser/pre/webviewCommands.ts
+39
-0
未找到文件。
src/vs/workbench/contrib/webview/browser/webview.contribution.ts
浏览文件 @
6cfe053d
...
...
@@ -17,8 +17,8 @@ import { EditorDescriptor, Extensions as EditorExtensions, IEditorRegistry } fro
import
{
Extensions
as
ActionExtensions
,
IWorkbenchActionRegistry
}
from
'
vs/workbench/common/actions
'
;
import
{
Extensions
as
EditorInputExtensions
,
IEditorInputFactoryRegistry
}
from
'
vs/workbench/common/editor
'
;
import
{
WebviewEditorInputFactory
}
from
'
vs/workbench/contrib/webview/browser/webviewEditorInputFactory
'
;
import
{
KEYBINDING_CONTEXT_WEBVIEW_FIND_WIDGET_VISIBLE
}
from
'
vs/workbench/contrib/webview/common/webview
'
;
import
{
CopyWebviewEditorCommand
,
CutWebviewEditorCommand
,
HideWebViewEditorFindCommand
,
OpenWebviewDeveloperToolsAction
,
PasteWebviewEditorCommand
,
RedoWebviewEditorCommand
,
ReloadWebviewAction
,
SelectAllWebviewEditorCommand
,
ShowWebViewEditorFindWidgetCommand
,
UndoWebviewEditorCommand
}
from
'
../browser/webviewCommands
'
;
import
{
KEYBINDING_CONTEXT_WEBVIEW_FIND_WIDGET_VISIBLE
,
webviewDeveloperCategory
}
from
'
vs/workbench/contrib/webview/common/webview
'
;
import
{
CopyWebviewEditorCommand
,
CutWebviewEditorCommand
,
HideWebViewEditorFindCommand
,
PasteWebviewEditorCommand
,
RedoWebviewEditorCommand
,
ReloadWebviewAction
,
SelectAllWebviewEditorCommand
,
ShowWebViewEditorFindWidgetCommand
,
UndoWebviewEditorCommand
}
from
'
../browser/webviewCommands
'
;
import
{
WebviewEditor
}
from
'
../browser/webviewEditor
'
;
import
{
WebviewEditorInput
}
from
'
../browser/webviewEditorInput
'
;
import
{
IWebviewEditorService
,
WebviewEditorService
}
from
'
../browser/webviewEditorService
'
;
...
...
@@ -35,9 +35,6 @@ Registry.as<IEditorInputFactoryRegistry>(EditorInputExtensions.EditorInputFactor
registerSingleton
(
IWebviewEditorService
,
WebviewEditorService
,
true
);
const
webviewDeveloperCategory
=
localize
(
'
developer
'
,
"
Developer
"
);
const
actionRegistry
=
Registry
.
as
<
IWorkbenchActionRegistry
>
(
ActionExtensions
.
WorkbenchActions
);
export
function
registerWebViewCommands
(
editorId
:
string
):
void
{
...
...
@@ -127,11 +124,6 @@ export function registerWebViewCommands(editorId: string): void {
registerWebViewCommands
(
WebviewEditor
.
ID
);
actionRegistry
.
registerWorkbenchAction
(
new
SyncActionDescriptor
(
OpenWebviewDeveloperToolsAction
,
OpenWebviewDeveloperToolsAction
.
ID
,
OpenWebviewDeveloperToolsAction
.
LABEL
),
'
Open Webview Developer Tools
'
,
webviewDeveloperCategory
);
actionRegistry
.
registerWorkbenchAction
(
new
SyncActionDescriptor
(
ReloadWebviewAction
,
ReloadWebviewAction
.
ID
,
ReloadWebviewAction
.
LABEL
),
'
Reload Webviews
'
,
...
...
src/vs/workbench/contrib/webview/browser/webviewCommands.ts
浏览文件 @
6cfe053d
...
...
@@ -98,30 +98,6 @@ export class RedoWebviewEditorCommand extends Command {
}
}
export
class
OpenWebviewDeveloperToolsAction
extends
Action
{
static
readonly
ID
=
'
workbench.action.webview.openDeveloperTools
'
;
static
readonly
LABEL
=
nls
.
localize
(
'
openToolsLabel
'
,
"
Open Webview Developer Tools
"
);
public
constructor
(
id
:
string
,
label
:
string
)
{
super
(
id
,
label
);
}
public
run
():
Promise
<
any
>
{
const
elements
=
document
.
querySelectorAll
(
'
webview.ready
'
);
for
(
let
i
=
0
;
i
<
elements
.
length
;
i
++
)
{
try
{
(
elements
.
item
(
i
)
as
Electron
.
WebviewTag
).
openDevTools
();
}
catch
(
e
)
{
console
.
error
(
e
);
}
}
return
Promise
.
resolve
(
true
);
}
}
export
class
ReloadWebviewAction
extends
Action
{
static
readonly
ID
=
'
workbench.action.webview.reloadWebviewAction
'
;
static
readonly
LABEL
=
nls
.
localize
(
'
refreshWebviewLabel
'
,
"
Reload Webviews
"
);
...
...
src/vs/workbench/contrib/webview/common/webview.ts
浏览文件 @
6cfe053d
...
...
@@ -10,6 +10,7 @@ import * as modes from 'vs/editor/common/modes';
import
{
RawContextKey
}
from
'
vs/platform/contextkey/common/contextkey
'
;
import
{
ExtensionIdentifier
}
from
'
vs/platform/extensions/common/extensions
'
;
import
{
createDecorator
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
*
as
nls
from
'
vs/nls
'
;
/**
* Set when the find widget in a webview is visible.
...
...
@@ -83,3 +84,5 @@ export interface Webview extends IDisposable {
showFind
():
void
;
hideFind
():
void
;
}
export
const
webviewDeveloperCategory
=
nls
.
localize
(
'
developer
'
,
"
Developer
"
);
src/vs/workbench/contrib/webview/electron-browser/pre/webviewCommands.ts
0 → 100644
浏览文件 @
6cfe053d
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import
{
Action
}
from
'
vs/base/common/actions
'
;
import
*
as
nls
from
'
vs/nls
'
;
import
{
SyncActionDescriptor
}
from
'
vs/platform/actions/common/actions
'
;
import
{
Registry
}
from
'
vs/platform/registry/common/platform
'
;
import
{
Extensions
as
ActionExtensions
,
IWorkbenchActionRegistry
}
from
'
vs/workbench/common/actions
'
;
import
{
webviewDeveloperCategory
}
from
'
vs/workbench/contrib/webview/common/webview
'
;
export
class
OpenWebviewDeveloperToolsAction
extends
Action
{
static
readonly
ID
=
'
workbench.action.webview.openDeveloperTools
'
;
static
readonly
LABEL
=
nls
.
localize
(
'
openToolsLabel
'
,
"
Open Webview Developer Tools
"
);
public
constructor
(
id
:
string
,
label
:
string
)
{
super
(
id
,
label
);
}
public
run
():
Promise
<
any
>
{
const
elements
=
document
.
querySelectorAll
(
'
webview.ready
'
);
for
(
let
i
=
0
;
i
<
elements
.
length
;
i
++
)
{
try
{
(
elements
.
item
(
i
)
as
Electron
.
WebviewTag
).
openDevTools
();
}
catch
(
e
)
{
console
.
error
(
e
);
}
}
return
Promise
.
resolve
(
true
);
}
}
const
actionRegistry
=
Registry
.
as
<
IWorkbenchActionRegistry
>
(
ActionExtensions
.
WorkbenchActions
);
actionRegistry
.
registerWorkbenchAction
(
new
SyncActionDescriptor
(
OpenWebviewDeveloperToolsAction
,
OpenWebviewDeveloperToolsAction
.
ID
,
OpenWebviewDeveloperToolsAction
.
LABEL
),
'
Open Webview Developer Tools
'
,
webviewDeveloperCategory
);
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录