Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
62d81b97
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,发现更多精彩内容 >>
提交
62d81b97
编写于
4月 01, 2019
作者:
M
Matt Bierner
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Splitting contribution sections of webview
上级
8bc1d445
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
154 addition
and
143 deletion
+154
-143
src/vs/workbench/contrib/webview/browser/webview.contribution.ts
...workbench/contrib/webview/browser/webview.contribution.ts
+138
-0
src/vs/workbench/contrib/webview/browser/webviewEditor.ts
src/vs/workbench/contrib/webview/browser/webviewEditor.ts
+2
-5
src/vs/workbench/contrib/webview/browser/webviewEditorInput.ts
...s/workbench/contrib/webview/browser/webviewEditorInput.ts
+1
-1
src/vs/workbench/contrib/webview/browser/webviewFindWidget.ts
...vs/workbench/contrib/webview/browser/webviewFindWidget.ts
+1
-1
src/vs/workbench/contrib/webview/common/webview.ts
src/vs/workbench/contrib/webview/common/webview.ts
+8
-3
src/vs/workbench/contrib/webview/electron-browser/webview.contribution.ts
.../contrib/webview/electron-browser/webview.contribution.ts
+1
-131
src/vs/workbench/contrib/webview/electron-browser/webviewElement.ts
...kbench/contrib/webview/electron-browser/webviewElement.ts
+1
-1
src/vs/workbench/contrib/webview/electron-browser/webviewService.ts
...kbench/contrib/webview/electron-browser/webviewService.ts
+1
-1
src/vs/workbench/workbench.main.ts
src/vs/workbench/workbench.main.ts
+1
-0
未找到文件。
src/vs/workbench/contrib/webview/browser/webview.contribution.ts
0 → 100644
浏览文件 @
62d81b97
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import
{
KeyCode
,
KeyMod
}
from
'
vs/base/common/keyCodes
'
;
import
{
isMacintosh
}
from
'
vs/base/common/platform
'
;
import
{
localize
}
from
'
vs/nls
'
;
import
{
SyncActionDescriptor
}
from
'
vs/platform/actions/common/actions
'
;
import
{
ContextKeyExpr
}
from
'
vs/platform/contextkey/common/contextkey
'
;
import
{
InputFocusedContextKey
}
from
'
vs/platform/contextkey/common/contextkeys
'
;
import
{
SyncDescriptor
}
from
'
vs/platform/instantiation/common/descriptors
'
;
import
{
registerSingleton
}
from
'
vs/platform/instantiation/common/extensions
'
;
import
{
KeybindingWeight
}
from
'
vs/platform/keybinding/common/keybindingsRegistry
'
;
import
{
Registry
}
from
'
vs/platform/registry/common/platform
'
;
import
{
EditorDescriptor
,
Extensions
as
EditorExtensions
,
IEditorRegistry
}
from
'
vs/workbench/browser/editor
'
;
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
{
WebviewEditor
}
from
'
../browser/webviewEditor
'
;
import
{
WebviewEditorInput
}
from
'
../browser/webviewEditorInput
'
;
import
{
IWebviewEditorService
,
WebviewEditorService
}
from
'
../browser/webviewEditorService
'
;
(
Registry
.
as
<
IEditorRegistry
>
(
EditorExtensions
.
Editors
)).
registerEditor
(
new
EditorDescriptor
(
WebviewEditor
,
WebviewEditor
.
ID
,
localize
(
'
webview.editor.label
'
,
"
webview editor
"
)),
[
new
SyncDescriptor
(
WebviewEditorInput
)]);
Registry
.
as
<
IEditorInputFactoryRegistry
>
(
EditorInputExtensions
.
EditorInputFactories
).
registerEditorInputFactory
(
WebviewEditorInputFactory
.
ID
,
WebviewEditorInputFactory
);
registerSingleton
(
IWebviewEditorService
,
WebviewEditorService
,
true
);
const
webviewDeveloperCategory
=
localize
(
'
developer
'
,
"
Developer
"
);
const
actionRegistry
=
Registry
.
as
<
IWorkbenchActionRegistry
>
(
ActionExtensions
.
WorkbenchActions
);
export
function
registerWebViewCommands
(
editorId
:
string
):
void
{
const
contextKeyExpr
=
ContextKeyExpr
.
and
(
ContextKeyExpr
.
equals
(
'
activeEditor
'
,
editorId
),
ContextKeyExpr
.
not
(
'
editorFocus
'
)
/* https://github.com/Microsoft/vscode/issues/58668 */
);
const
showNextFindWidgetCommand
=
new
ShowWebViewEditorFindWidgetCommand
({
id
:
ShowWebViewEditorFindWidgetCommand
.
ID
,
precondition
:
contextKeyExpr
,
kbOpts
:
{
primary
:
KeyMod
.
CtrlCmd
|
KeyCode
.
KEY_F
,
weight
:
KeybindingWeight
.
EditorContrib
}
});
showNextFindWidgetCommand
.
register
();
(
new
HideWebViewEditorFindCommand
({
id
:
HideWebViewEditorFindCommand
.
ID
,
precondition
:
ContextKeyExpr
.
and
(
contextKeyExpr
,
KEYBINDING_CONTEXT_WEBVIEW_FIND_WIDGET_VISIBLE
),
kbOpts
:
{
primary
:
KeyCode
.
Escape
,
weight
:
KeybindingWeight
.
EditorContrib
}
})).
register
();
(
new
SelectAllWebviewEditorCommand
({
id
:
SelectAllWebviewEditorCommand
.
ID
,
precondition
:
ContextKeyExpr
.
and
(
contextKeyExpr
,
ContextKeyExpr
.
not
(
InputFocusedContextKey
)),
kbOpts
:
{
primary
:
KeyMod
.
CtrlCmd
|
KeyCode
.
KEY_A
,
weight
:
KeybindingWeight
.
EditorContrib
}
})).
register
();
// These commands are only needed on MacOS where we have to disable the menu bar commands
if
(
isMacintosh
)
{
(
new
CopyWebviewEditorCommand
({
id
:
CopyWebviewEditorCommand
.
ID
,
precondition
:
ContextKeyExpr
.
and
(
contextKeyExpr
,
ContextKeyExpr
.
not
(
InputFocusedContextKey
)),
kbOpts
:
{
primary
:
KeyMod
.
CtrlCmd
|
KeyCode
.
KEY_C
,
weight
:
KeybindingWeight
.
EditorContrib
}
})).
register
();
(
new
PasteWebviewEditorCommand
({
id
:
PasteWebviewEditorCommand
.
ID
,
precondition
:
ContextKeyExpr
.
and
(
contextKeyExpr
,
ContextKeyExpr
.
not
(
InputFocusedContextKey
)),
kbOpts
:
{
primary
:
KeyMod
.
CtrlCmd
|
KeyCode
.
KEY_V
,
weight
:
KeybindingWeight
.
EditorContrib
}
})).
register
();
(
new
CutWebviewEditorCommand
({
id
:
CutWebviewEditorCommand
.
ID
,
precondition
:
ContextKeyExpr
.
and
(
contextKeyExpr
,
ContextKeyExpr
.
not
(
InputFocusedContextKey
)),
kbOpts
:
{
primary
:
KeyMod
.
CtrlCmd
|
KeyCode
.
KEY_X
,
weight
:
KeybindingWeight
.
EditorContrib
}
})).
register
();
(
new
UndoWebviewEditorCommand
({
id
:
UndoWebviewEditorCommand
.
ID
,
precondition
:
ContextKeyExpr
.
and
(
contextKeyExpr
,
ContextKeyExpr
.
not
(
InputFocusedContextKey
)),
kbOpts
:
{
primary
:
KeyMod
.
CtrlCmd
|
KeyCode
.
KEY_Z
,
weight
:
KeybindingWeight
.
EditorContrib
}
})).
register
();
(
new
RedoWebviewEditorCommand
({
id
:
RedoWebviewEditorCommand
.
ID
,
precondition
:
ContextKeyExpr
.
and
(
contextKeyExpr
,
ContextKeyExpr
.
not
(
InputFocusedContextKey
)),
kbOpts
:
{
primary
:
KeyMod
.
CtrlCmd
|
KeyCode
.
KEY_Y
,
secondary
:
[
KeyMod
.
CtrlCmd
|
KeyMod
.
Shift
|
KeyCode
.
KEY_Z
],
mac
:
{
primary
:
KeyMod
.
CtrlCmd
|
KeyMod
.
Shift
|
KeyCode
.
KEY_Z
},
weight
:
KeybindingWeight
.
EditorContrib
}
})).
register
();
}
}
registerWebViewCommands
(
WebviewEditor
.
ID
);
actionRegistry
.
registerWorkbenchAction
(
new
SyncActionDescriptor
(
OpenWebviewDeveloperToolsAction
,
OpenWebviewDeveloperToolsAction
.
ID
,
OpenWebviewDeveloperToolsAction
.
LABEL
),
'
Webview Tools
'
,
webviewDeveloperCategory
);
actionRegistry
.
registerWorkbenchAction
(
new
SyncActionDescriptor
(
ReloadWebviewAction
,
ReloadWebviewAction
.
ID
,
ReloadWebviewAction
.
LABEL
),
'
Reload Webview
'
,
webviewDeveloperCategory
);
src/vs/workbench/contrib/webview/browser/webviewEditor.ts
浏览文件 @
62d81b97
...
...
@@ -8,7 +8,7 @@ import { CancellationToken } from 'vs/base/common/cancellation';
import
{
Emitter
,
Event
}
from
'
vs/base/common/event
'
;
import
{
dispose
,
IDisposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
URI
}
from
'
vs/base/common/uri
'
;
import
{
IContextKey
,
IContextKeyService
,
RawContextKey
}
from
'
vs/platform/contextkey/common/contextkey
'
;
import
{
IContextKey
,
IContextKeyService
}
from
'
vs/platform/contextkey/common/contextkey
'
;
import
{
IStorageService
}
from
'
vs/platform/storage/common/storage
'
;
import
{
ITelemetryService
}
from
'
vs/platform/telemetry/common/telemetry
'
;
import
{
IThemeService
}
from
'
vs/platform/theme/common/themeService
'
;
...
...
@@ -17,13 +17,10 @@ import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace
import
{
BaseEditor
}
from
'
vs/workbench/browser/parts/editor/baseEditor
'
;
import
{
EditorOptions
}
from
'
vs/workbench/common/editor
'
;
import
{
WebviewEditorInput
}
from
'
vs/workbench/contrib/webview/browser/webviewEditorInput
'
;
import
{
IWebviewService
,
Webview
}
from
'
vs/workbench/contrib/webview/browser/webviewService
'
;
import
{
IWebviewService
,
Webview
,
KEYBINDING_CONTEXT_WEBVIEW_FIND_WIDGET_VISIBLE
}
from
'
vs/workbench/contrib/webview/common/webview
'
;
import
{
IEditorGroup
}
from
'
vs/workbench/services/editor/common/editorGroupsService
'
;
import
{
IEditorService
}
from
'
vs/workbench/services/editor/common/editorService
'
;
/** A context key that is set when the find widget in a webview is visible. */
export
const
KEYBINDING_CONTEXT_WEBVIEW_FIND_WIDGET_VISIBLE
=
new
RawContextKey
<
boolean
>
(
'
webviewFindWidgetVisible
'
,
false
);
export
class
WebviewEditor
extends
BaseEditor
{
...
...
src/vs/workbench/contrib/webview/browser/webviewEditorInput.ts
浏览文件 @
62d81b97
...
...
@@ -11,7 +11,7 @@ import { ExtensionIdentifier } from 'vs/platform/extensions/common/extensions';
import
{
EditorInput
,
EditorModel
,
GroupIdentifier
,
IEditorInput
}
from
'
vs/workbench/common/editor
'
;
import
{
IWorkbenchLayoutService
,
Parts
}
from
'
vs/workbench/services/layout/browser/layoutService
'
;
import
{
WebviewEvents
,
WebviewInputOptions
}
from
'
./webviewEditorService
'
;
import
{
Webview
,
WebviewOptions
}
from
'
vs/workbench/contrib/webview/
browser/webviewService
'
;
import
{
Webview
,
WebviewOptions
}
from
'
vs/workbench/contrib/webview/
common/webview
'
;
export
class
WebviewEditorInput
extends
EditorInput
{
private
static
handlePool
=
0
;
...
...
src/vs/workbench/contrib/webview/browser/webviewFindWidget.ts
浏览文件 @
62d81b97
...
...
@@ -6,7 +6,7 @@
import
{
SimpleFindWidget
}
from
'
vs/editor/contrib/find/simpleFindWidget
'
;
import
{
IContextViewService
}
from
'
vs/platform/contextview/browser/contextView
'
;
import
{
IContextKeyService
}
from
'
vs/platform/contextkey/common/contextkey
'
;
import
{
Webview
}
from
'
vs/workbench/contrib/webview/
browser/webviewService
'
;
import
{
Webview
}
from
'
vs/workbench/contrib/webview/
common/webview
'
;
export
class
WebviewFindWidget
extends
SimpleFindWidget
{
...
...
src/vs/workbench/contrib/webview/
browser/webviewService
.ts
→
src/vs/workbench/contrib/webview/
common/webview
.ts
浏览文件 @
62d81b97
...
...
@@ -7,6 +7,12 @@ import { Event } from 'vs/base/common/event';
import
{
URI
}
from
'
vs/base/common/uri
'
;
import
{
ExtensionIdentifier
}
from
'
vs/platform/extensions/common/extensions
'
;
import
{
createDecorator
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
RawContextKey
}
from
'
vs/platform/contextkey/common/contextkey
'
;
/**
* Set when the find widget in a webview is visible.
*/
export
const
KEYBINDING_CONTEXT_WEBVIEW_FIND_WIDGET_VISIBLE
=
new
RawContextKey
<
boolean
>
(
'
webviewFindWidgetVisible
'
,
false
);
export
const
IWebviewService
=
createDecorator
<
IWebviewService
>
(
'
webviewService
'
);
...
...
@@ -19,7 +25,6 @@ export interface IWebviewService {
):
Webview
;
}
export
interface
WebviewPortMapping
{
readonly
port
:
number
;
readonly
resolvedPort
:
number
;
...
...
@@ -66,8 +71,6 @@ export interface Webview {
focus
():
void
;
dispose
():
void
;
showFind
():
void
;
hideFind
():
void
;
reload
():
void
;
selectAll
():
void
;
...
...
@@ -77,6 +80,8 @@ export interface Webview {
undo
():
void
;
redo
():
void
;
showFind
():
void
;
hideFind
():
void
;
find
(
value
:
string
,
previous
:
boolean
):
void
;
startFind
(
value
:
string
):
void
;
stopFind
(
keepSelection
?:
boolean
):
void
;
...
...
src/vs/workbench/contrib/webview/electron-browser/webview.contribution.ts
浏览文件 @
62d81b97
...
...
@@ -3,138 +3,8 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import
{
KeyCode
,
KeyMod
}
from
'
vs/base/common/keyCodes
'
;
import
{
localize
}
from
'
vs/nls
'
;
import
{
SyncActionDescriptor
}
from
'
vs/platform/actions/common/actions
'
;
import
{
ContextKeyExpr
}
from
'
vs/platform/contextkey/common/contextkey
'
;
import
{
SyncDescriptor
}
from
'
vs/platform/instantiation/common/descriptors
'
;
import
{
registerSingleton
}
from
'
vs/platform/instantiation/common/extensions
'
;
import
{
KeybindingWeight
}
from
'
vs/platform/keybinding/common/keybindingsRegistry
'
;
import
{
Registry
}
from
'
vs/platform/registry/common/platform
'
;
import
{
EditorDescriptor
,
Extensions
as
EditorExtensions
,
IEditorRegistry
}
from
'
vs/workbench/browser/editor
'
;
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
{
HideWebViewEditorFindCommand
,
OpenWebviewDeveloperToolsAction
,
ReloadWebviewAction
,
ShowWebViewEditorFindWidgetCommand
,
SelectAllWebviewEditorCommand
,
CopyWebviewEditorCommand
,
PasteWebviewEditorCommand
,
CutWebviewEditorCommand
,
UndoWebviewEditorCommand
,
RedoWebviewEditorCommand
}
from
'
../browser/webviewCommands
'
;
import
{
WebviewEditor
,
KEYBINDING_CONTEXT_WEBVIEW_FIND_WIDGET_VISIBLE
}
from
'
../browser/webviewEditor
'
;
import
{
WebviewEditorInput
}
from
'
../browser/webviewEditorInput
'
;
import
{
IWebviewEditorService
,
WebviewEditorService
}
from
'
../browser/webviewEditorService
'
;
import
{
InputFocusedContextKey
}
from
'
vs/platform/contextkey/common/contextkeys
'
;
import
{
isMacintosh
}
from
'
vs/base/common/platform
'
;
import
{
IWebviewService
}
from
'
vs/workbench/contrib/webview/browser/webviewService
'
;
import
{
IWebviewService
}
from
'
vs/workbench/contrib/webview/common/webview
'
;
import
{
WebviewService
}
from
'
vs/workbench/contrib/webview/electron-browser/webviewService
'
;
(
Registry
.
as
<
IEditorRegistry
>
(
EditorExtensions
.
Editors
)).
registerEditor
(
new
EditorDescriptor
(
WebviewEditor
,
WebviewEditor
.
ID
,
localize
(
'
webview.editor.label
'
,
"
webview editor
"
)),
[
new
SyncDescriptor
(
WebviewEditorInput
)]);
Registry
.
as
<
IEditorInputFactoryRegistry
>
(
EditorInputExtensions
.
EditorInputFactories
).
registerEditorInputFactory
(
WebviewEditorInputFactory
.
ID
,
WebviewEditorInputFactory
);
registerSingleton
(
IWebviewEditorService
,
WebviewEditorService
,
true
);
registerSingleton
(
IWebviewService
,
WebviewService
,
true
);
const
webviewDeveloperCategory
=
localize
(
'
developer
'
,
"
Developer
"
);
const
actionRegistry
=
Registry
.
as
<
IWorkbenchActionRegistry
>
(
ActionExtensions
.
WorkbenchActions
);
export
function
registerWebViewCommands
(
editorId
:
string
):
void
{
const
contextKeyExpr
=
ContextKeyExpr
.
and
(
ContextKeyExpr
.
equals
(
'
activeEditor
'
,
editorId
),
ContextKeyExpr
.
not
(
'
editorFocus
'
)
/* https://github.com/Microsoft/vscode/issues/58668 */
);
const
showNextFindWidgetCommand
=
new
ShowWebViewEditorFindWidgetCommand
({
id
:
ShowWebViewEditorFindWidgetCommand
.
ID
,
precondition
:
contextKeyExpr
,
kbOpts
:
{
primary
:
KeyMod
.
CtrlCmd
|
KeyCode
.
KEY_F
,
weight
:
KeybindingWeight
.
EditorContrib
}
});
showNextFindWidgetCommand
.
register
();
(
new
HideWebViewEditorFindCommand
({
id
:
HideWebViewEditorFindCommand
.
ID
,
precondition
:
ContextKeyExpr
.
and
(
contextKeyExpr
,
KEYBINDING_CONTEXT_WEBVIEW_FIND_WIDGET_VISIBLE
),
kbOpts
:
{
primary
:
KeyCode
.
Escape
,
weight
:
KeybindingWeight
.
EditorContrib
}
})).
register
();
(
new
SelectAllWebviewEditorCommand
({
id
:
SelectAllWebviewEditorCommand
.
ID
,
precondition
:
ContextKeyExpr
.
and
(
contextKeyExpr
,
ContextKeyExpr
.
not
(
InputFocusedContextKey
)),
kbOpts
:
{
primary
:
KeyMod
.
CtrlCmd
|
KeyCode
.
KEY_A
,
weight
:
KeybindingWeight
.
EditorContrib
}
})).
register
();
// These commands are only needed on MacOS where we have to disable the menu bar commands
if
(
isMacintosh
)
{
(
new
CopyWebviewEditorCommand
({
id
:
CopyWebviewEditorCommand
.
ID
,
precondition
:
ContextKeyExpr
.
and
(
contextKeyExpr
,
ContextKeyExpr
.
not
(
InputFocusedContextKey
)),
kbOpts
:
{
primary
:
KeyMod
.
CtrlCmd
|
KeyCode
.
KEY_C
,
weight
:
KeybindingWeight
.
EditorContrib
}
})).
register
();
(
new
PasteWebviewEditorCommand
({
id
:
PasteWebviewEditorCommand
.
ID
,
precondition
:
ContextKeyExpr
.
and
(
contextKeyExpr
,
ContextKeyExpr
.
not
(
InputFocusedContextKey
)),
kbOpts
:
{
primary
:
KeyMod
.
CtrlCmd
|
KeyCode
.
KEY_V
,
weight
:
KeybindingWeight
.
EditorContrib
}
})).
register
();
(
new
CutWebviewEditorCommand
({
id
:
CutWebviewEditorCommand
.
ID
,
precondition
:
ContextKeyExpr
.
and
(
contextKeyExpr
,
ContextKeyExpr
.
not
(
InputFocusedContextKey
)),
kbOpts
:
{
primary
:
KeyMod
.
CtrlCmd
|
KeyCode
.
KEY_X
,
weight
:
KeybindingWeight
.
EditorContrib
}
})).
register
();
(
new
UndoWebviewEditorCommand
({
id
:
UndoWebviewEditorCommand
.
ID
,
precondition
:
ContextKeyExpr
.
and
(
contextKeyExpr
,
ContextKeyExpr
.
not
(
InputFocusedContextKey
)),
kbOpts
:
{
primary
:
KeyMod
.
CtrlCmd
|
KeyCode
.
KEY_Z
,
weight
:
KeybindingWeight
.
EditorContrib
}
})).
register
();
(
new
RedoWebviewEditorCommand
({
id
:
RedoWebviewEditorCommand
.
ID
,
precondition
:
ContextKeyExpr
.
and
(
contextKeyExpr
,
ContextKeyExpr
.
not
(
InputFocusedContextKey
)),
kbOpts
:
{
primary
:
KeyMod
.
CtrlCmd
|
KeyCode
.
KEY_Y
,
secondary
:
[
KeyMod
.
CtrlCmd
|
KeyMod
.
Shift
|
KeyCode
.
KEY_Z
],
mac
:
{
primary
:
KeyMod
.
CtrlCmd
|
KeyMod
.
Shift
|
KeyCode
.
KEY_Z
},
weight
:
KeybindingWeight
.
EditorContrib
}
})).
register
();
}
}
registerWebViewCommands
(
WebviewEditor
.
ID
);
actionRegistry
.
registerWorkbenchAction
(
new
SyncActionDescriptor
(
OpenWebviewDeveloperToolsAction
,
OpenWebviewDeveloperToolsAction
.
ID
,
OpenWebviewDeveloperToolsAction
.
LABEL
),
'
Webview Tools
'
,
webviewDeveloperCategory
);
actionRegistry
.
registerWorkbenchAction
(
new
SyncActionDescriptor
(
ReloadWebviewAction
,
ReloadWebviewAction
.
ID
,
ReloadWebviewAction
.
LABEL
),
'
Reload Webview
'
,
webviewDeveloperCategory
);
src/vs/workbench/contrib/webview/electron-browser/webviewElement.ts
浏览文件 @
62d81b97
...
...
@@ -21,7 +21,7 @@ import { areWebviewInputOptionsEqual } from '../browser/webviewEditorService';
import
{
WebviewFindWidget
}
from
'
../browser/webviewFindWidget
'
;
import
{
ITelemetryService
}
from
'
vs/platform/telemetry/common/telemetry
'
;
import
{
ExtensionIdentifier
}
from
'
vs/platform/extensions/common/extensions
'
;
import
{
WebviewContentOptions
,
WebviewPortMapping
,
WebviewOptions
,
Webview
}
from
'
vs/workbench/contrib/webview/
browser/webviewService
'
;
import
{
WebviewContentOptions
,
WebviewPortMapping
,
WebviewOptions
,
Webview
}
from
'
vs/workbench/contrib/webview/
common/webview
'
;
interface
IKeydownEvent
{
...
...
src/vs/workbench/contrib/webview/electron-browser/webviewService.ts
浏览文件 @
62d81b97
...
...
@@ -6,7 +6,7 @@
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
WebviewElement
}
from
'
vs/workbench/contrib/webview/electron-browser/webviewElement
'
;
import
{
IWorkbenchLayoutService
,
Parts
}
from
'
vs/workbench/services/layout/browser/layoutService
'
;
import
{
IWebviewService
,
WebviewOptions
,
WebviewContentOptions
,
Webview
}
from
'
vs/workbench/contrib/webview/
browser/webviewService
'
;
import
{
IWebviewService
,
WebviewOptions
,
WebviewContentOptions
,
Webview
}
from
'
vs/workbench/contrib/webview/
common/webview
'
;
export
class
WebviewService
implements
IWebviewService
{
_serviceBrand
:
any
;
...
...
src/vs/workbench/workbench.main.ts
浏览文件 @
62d81b97
...
...
@@ -233,6 +233,7 @@ import 'vs/workbench/contrib/comments/browser/comments.contribution';
import
'
vs/workbench/contrib/url/common/url.contribution
'
;
// Webview
import
'
vs/workbench/contrib/webview/browser/webview.contribution
'
;
import
'
vs/workbench/contrib/webview/electron-browser/webview.contribution
'
;
// Extensions Management
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录