Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
b297efad
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,发现更多精彩内容 >>
提交
b297efad
编写于
7月 24, 2018
作者:
M
Matt Bierner
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Extract interface
上级
f8870d79
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
26 addition
and
20 deletion
+26
-20
src/vs/workbench/api/electron-browser/mainThreadWebview.ts
src/vs/workbench/api/electron-browser/mainThreadWebview.ts
+4
-4
src/vs/workbench/api/node/extHost.protocol.ts
src/vs/workbench/api/node/extHost.protocol.ts
+7
-2
src/vs/workbench/api/node/extHostWebview.ts
src/vs/workbench/api/node/extHostWebview.ts
+4
-3
src/vs/workbench/parts/webview/electron-browser/webviewFindWidget.ts
...bench/parts/webview/electron-browser/webviewFindWidget.ts
+11
-11
未找到文件。
src/vs/workbench/api/electron-browser/mainThreadWebview.ts
浏览文件 @
b297efad
...
...
@@ -10,7 +10,7 @@ import { TPromise } from 'vs/base/common/winjs.base';
import
{
localize
}
from
'
vs/nls
'
;
import
{
ILifecycleService
}
from
'
vs/platform/lifecycle/common/lifecycle
'
;
import
{
IOpenerService
}
from
'
vs/platform/opener/common/opener
'
;
import
{
ExtHostContext
,
ExtHostWebviewsShape
,
IExtHostContext
,
MainContext
,
MainThreadWebviewsShape
,
WebviewPanelHandle
}
from
'
vs/workbench/api/node/extHost.protocol
'
;
import
{
ExtHostContext
,
ExtHostWebviewsShape
,
IExtHostContext
,
MainContext
,
MainThreadWebviewsShape
,
WebviewPanelHandle
,
WebviewPanelShowOptions
}
from
'
vs/workbench/api/node/extHost.protocol
'
;
import
{
editorGroupToViewColumn
,
EditorViewColumn
,
viewColumnToEditorGroup
}
from
'
vs/workbench/api/shared/editor
'
;
import
{
WebviewEditor
}
from
'
vs/workbench/parts/webview/electron-browser/webviewEditor
'
;
import
{
WebviewEditorInput
}
from
'
vs/workbench/parts/webview/electron-browser/webviewEditorInput
'
;
...
...
@@ -145,15 +145,15 @@ export class MainThreadWebviews implements MainThreadWebviewsShape, WebviewReviv
webview
.
setOptions
(
reviveWebviewOptions
(
options
));
}
public
$reveal
(
handle
:
WebviewPanelHandle
,
viewColumn
:
EditorViewColumn
|
null
,
preserveFocus
:
boolean
):
void
{
public
$reveal
(
handle
:
WebviewPanelHandle
,
showOptions
:
WebviewPanelShowOptions
):
void
{
const
webview
=
this
.
getWebview
(
handle
);
if
(
webview
.
isDisposed
())
{
return
;
}
const
targetGroup
=
this
.
_editorGroupService
.
getGroup
(
viewColumnToEditorGroup
(
this
.
_editorGroupService
,
viewColumn
));
const
targetGroup
=
this
.
_editorGroupService
.
getGroup
(
viewColumnToEditorGroup
(
this
.
_editorGroupService
,
showOptions
.
viewColumn
));
this
.
_webviewService
.
revealWebview
(
webview
,
targetGroup
||
this
.
_editorGroupService
.
activeGroup
,
preserveFocus
);
this
.
_webviewService
.
revealWebview
(
webview
,
targetGroup
||
this
.
_editorGroupService
.
activeGroup
,
showOptions
.
preserveFocus
);
}
public
$postMessage
(
handle
:
WebviewPanelHandle
,
message
:
any
):
TPromise
<
boolean
>
{
...
...
src/vs/workbench/api/node/extHost.protocol.ts
浏览文件 @
b297efad
...
...
@@ -425,10 +425,15 @@ export interface MainThreadTelemetryShape extends IDisposable {
export
type
WebviewPanelHandle
=
string
;
export
interface
WebviewPanelShowOptions
{
readonly
viewColumn
?:
EditorViewColumn
;
readonly
preserveFocus
?:
boolean
;
}
export
interface
MainThreadWebviewsShape
extends
IDisposable
{
$createWebviewPanel
(
handle
:
WebviewPanelHandle
,
viewType
:
string
,
title
:
string
,
viewOptions
:
{
viewColumn
:
EditorViewColumn
,
preserveFocus
:
boolean
}
,
options
:
vscode
.
WebviewPanelOptions
&
vscode
.
WebviewOptions
,
extensionLocation
:
UriComponents
):
void
;
$createWebviewPanel
(
handle
:
WebviewPanelHandle
,
viewType
:
string
,
title
:
string
,
showOptions
:
WebviewPanelShowOptions
,
options
:
vscode
.
WebviewPanelOptions
&
vscode
.
WebviewOptions
,
extensionLocation
:
UriComponents
):
void
;
$disposeWebview
(
handle
:
WebviewPanelHandle
):
void
;
$reveal
(
handle
:
WebviewPanelHandle
,
viewColumn
:
EditorViewColumn
|
null
,
preserveFocus
:
boolean
):
void
;
$reveal
(
handle
:
WebviewPanelHandle
,
showOptions
:
WebviewPanelShowOptions
):
void
;
$setTitle
(
handle
:
WebviewPanelHandle
,
value
:
string
):
void
;
$setIconPath
(
handle
:
WebviewPanelHandle
,
value
:
{
light
:
UriComponents
,
dark
:
UriComponents
}
|
undefined
):
void
;
$setHtml
(
handle
:
WebviewPanelHandle
,
value
:
string
):
void
;
...
...
src/vs/workbench/api/node/extHostWebview.ts
浏览文件 @
b297efad
...
...
@@ -208,9 +208,10 @@ export class ExtHostWebviewPanel implements vscode.WebviewPanel {
public
reveal
(
viewColumn
?:
vscode
.
ViewColumn
,
preserveFocus
?:
boolean
):
void
{
this
.
assertNotDisposed
();
this
.
_proxy
.
$reveal
(
this
.
_handle
,
viewColumn
?
typeConverters
.
ViewColumn
.
from
(
viewColumn
)
:
undefined
,
!!
preserveFocus
);
this
.
_proxy
.
$reveal
(
this
.
_handle
,
{
viewColumn
:
viewColumn
?
typeConverters
.
ViewColumn
.
from
(
viewColumn
)
:
undefined
,
preserveFocus
:
!!
preserveFocus
});
}
private
assertNotDisposed
()
{
...
...
src/vs/workbench/parts/webview/electron-browser/webviewFindWidget.ts
浏览文件 @
b297efad
...
...
@@ -11,7 +11,7 @@ import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
export
class
WebviewFindWidget
extends
SimpleFindWidget
{
constructor
(
private
webview
:
WebviewElement
,
private
_
webview
:
WebviewElement
,
@
IContextViewService
contextViewService
:
IContextViewService
,
@
IContextKeyService
contextKeyService
:
IContextKeyService
)
{
...
...
@@ -19,45 +19,45 @@ export class WebviewFindWidget extends SimpleFindWidget {
}
dispose
()
{
this
.
webview
=
undefined
;
this
.
_
webview
=
undefined
;
super
.
dispose
();
}
public
find
(
previous
:
boolean
)
{
const
val
=
this
.
inputValue
;
if
(
val
)
{
this
.
webview
.
find
(
val
,
{
findNext
:
true
,
forward
:
!
previous
});
this
.
_
webview
.
find
(
val
,
{
findNext
:
true
,
forward
:
!
previous
});
}
}
public
hide
()
{
super
.
hide
();
this
.
webview
.
stopFind
(
true
);
this
.
webview
.
focus
();
this
.
_
webview
.
stopFind
(
true
);
this
.
_
webview
.
focus
();
}
public
onInputChanged
()
{
const
val
=
this
.
inputValue
;
if
(
val
)
{
this
.
webview
.
startFind
(
val
);
this
.
_
webview
.
startFind
(
val
);
}
else
{
this
.
webview
.
stopFind
(
false
);
this
.
_
webview
.
stopFind
(
false
);
}
}
protected
onFocusTrackerFocus
()
{
this
.
webview
.
notifyFindWidgetFocusChanged
(
true
);
this
.
_
webview
.
notifyFindWidgetFocusChanged
(
true
);
}
protected
onFocusTrackerBlur
()
{
this
.
webview
.
notifyFindWidgetFocusChanged
(
false
);
this
.
_
webview
.
notifyFindWidgetFocusChanged
(
false
);
}
protected
onFindInputFocusTrackerFocus
()
{
this
.
webview
.
notifyFindWidgetInputFocusChanged
(
true
);
this
.
_
webview
.
notifyFindWidgetInputFocusChanged
(
true
);
}
protected
onFindInputFocusTrackerBlur
()
{
this
.
webview
.
notifyFindWidgetInputFocusChanged
(
false
);
this
.
_
webview
.
notifyFindWidgetInputFocusChanged
(
false
);
}
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录