Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
06dd68b4
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,体验更适合开发者的 AI 搜索 >>
提交
06dd68b4
编写于
4月 03, 2019
作者:
M
Matt Bierner
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix webviews in same view column not always getting correct state change fired for visibility
Fixes #70859
上级
4f03abce
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
7 addition
and
19 deletion
+7
-19
src/vs/workbench/api/electron-browser/mainThreadWebview.ts
src/vs/workbench/api/electron-browser/mainThreadWebview.ts
+0
-1
src/vs/workbench/contrib/webview/browser/webviewEditorInput.ts
...s/workbench/contrib/webview/browser/webviewEditorInput.ts
+3
-10
src/vs/workbench/contrib/webview/browser/webviewEditorInputFactory.ts
...ench/contrib/webview/browser/webviewEditorInputFactory.ts
+1
-3
src/vs/workbench/contrib/webview/browser/webviewEditorService.ts
...workbench/contrib/webview/browser/webviewEditorService.ts
+3
-5
未找到文件。
src/vs/workbench/api/electron-browser/mainThreadWebview.ts
浏览文件 @
06dd68b4
...
...
@@ -112,7 +112,6 @@ export class MainThreadWebviews extends Disposable implements MainThreadWebviews
};
this
.
_webviews
.
set
(
handle
,
webview
);
this
.
_activeWebview
=
handle
;
/* __GDPR__
"webviews:createWebviewPanel" : {
...
...
src/vs/workbench/contrib/webview/browser/webviewEditorInput.ts
浏览文件 @
06dd68b4
...
...
@@ -72,7 +72,6 @@ export class WebviewEditorInput extends EditorInput {
constructor
(
public
readonly
viewType
:
string
,
id
:
number
,
name
:
string
,
options
:
WebviewInputOptions
,
state
:
any
,
...
...
@@ -85,8 +84,7 @@ export class WebviewEditorInput extends EditorInput {
)
{
super
();
this
.
_id
=
id
;
WebviewEditorInput
.
handlePool
=
Math
.
max
(
id
,
WebviewEditorInput
.
handlePool
)
+
1
;
this
.
_id
=
WebviewEditorInput
.
handlePool
++
;
this
.
_name
=
name
;
this
.
_options
=
options
;
...
...
@@ -99,10 +97,6 @@ export class WebviewEditorInput extends EditorInput {
return
WebviewEditorInput
.
typeId
;
}
public
getId
():
number
{
return
this
.
_id
;
}
private
readonly
_onDidChangeIcon
=
this
.
_register
(
new
Emitter
<
void
>
());
public
readonly
onDidChangeIcon
=
this
.
_onDidChangeIcon
.
event
;
...
...
@@ -157,7 +151,7 @@ export class WebviewEditorInput extends EditorInput {
}
public
matches
(
other
:
IEditorInput
):
boolean
{
return
other
===
this
||
(
other
instanceof
WebviewEditorInput
&&
other
.
_id
===
this
.
_id
)
;
return
other
===
this
;
}
public
get
group
():
GroupIdentifier
|
undefined
{
...
...
@@ -312,7 +306,6 @@ export class RevivedWebviewEditorInput extends WebviewEditorInput {
constructor
(
viewType
:
string
,
id
:
number
,
name
:
string
,
options
:
WebviewInputOptions
,
state
:
any
,
...
...
@@ -324,7 +317,7 @@ export class RevivedWebviewEditorInput extends WebviewEditorInput {
private
readonly
reviver
:
(
input
:
WebviewEditorInput
)
=>
Promise
<
void
>
,
@
IWorkbenchLayoutService
partService
:
IWorkbenchLayoutService
,
)
{
super
(
viewType
,
id
,
name
,
options
,
state
,
events
,
extension
,
partService
);
super
(
viewType
,
name
,
options
,
state
,
events
,
extension
,
partService
);
}
public
async
resolve
():
Promise
<
IEditorModel
>
{
...
...
src/vs/workbench/contrib/webview/browser/webviewEditorInputFactory.ts
浏览文件 @
06dd68b4
...
...
@@ -17,7 +17,6 @@ interface SerializedIconPath {
interface
SerializedWebview
{
readonly
viewType
:
string
;
readonly
id
:
number
;
readonly
title
:
string
;
readonly
options
:
WebviewInputOptions
;
readonly
extensionLocation
:
string
|
UriComponents
|
undefined
;
...
...
@@ -44,7 +43,6 @@ export class WebviewEditorInputFactory implements IEditorInputFactory {
const
data
:
SerializedWebview
=
{
viewType
:
input
.
viewType
,
id
:
input
.
getId
(),
title
:
input
.
getName
(),
options
:
input
.
options
,
extensionLocation
:
input
.
extension
?
input
.
extension
.
location
:
undefined
,
...
...
@@ -69,7 +67,7 @@ export class WebviewEditorInputFactory implements IEditorInputFactory {
const
extensionLocation
=
reviveUri
(
data
.
extensionLocation
);
const
extensionId
=
data
.
extensionId
?
new
ExtensionIdentifier
(
data
.
extensionId
)
:
undefined
;
const
iconPath
=
reviveIconPath
(
data
.
iconPath
);
return
this
.
_webviewService
.
reviveWebview
(
data
.
viewType
,
data
.
id
,
data
.
title
,
iconPath
,
data
.
state
,
data
.
options
,
extensionLocation
?
{
return
this
.
_webviewService
.
reviveWebview
(
data
.
viewType
,
data
.
title
,
iconPath
,
data
.
state
,
data
.
options
,
extensionLocation
?
{
location
:
extensionLocation
,
id
:
extensionId
}
:
undefined
,
data
.
group
);
...
...
src/vs/workbench/contrib/webview/browser/webviewEditorService.ts
浏览文件 @
06dd68b4
...
...
@@ -39,7 +39,6 @@ export interface IWebviewEditorService {
reviveWebview
(
viewType
:
string
,
id
:
number
,
title
:
string
,
iconPath
:
{
light
:
URI
,
dark
:
URI
}
|
undefined
,
state
:
any
,
...
...
@@ -143,7 +142,7 @@ export class WebviewEditorService implements IWebviewEditorService {
},
events
:
WebviewEvents
):
WebviewEditorInput
{
const
webviewInput
=
this
.
_instantiationService
.
createInstance
(
WebviewEditorInput
,
viewType
,
undefined
,
title
,
options
,
{},
events
,
extension
);
const
webviewInput
=
this
.
_instantiationService
.
createInstance
(
WebviewEditorInput
,
viewType
,
title
,
options
,
{},
events
,
extension
);
this
.
_editorService
.
openEditor
(
webviewInput
,
{
pinned
:
true
,
preserveFocus
:
showOptions
.
preserveFocus
},
showOptions
.
group
);
return
webviewInput
;
}
...
...
@@ -165,7 +164,6 @@ export class WebviewEditorService implements IWebviewEditorService {
public
reviveWebview
(
viewType
:
string
,
id
:
number
,
title
:
string
,
iconPath
:
{
light
:
URI
,
dark
:
URI
}
|
undefined
,
state
:
any
,
...
...
@@ -176,7 +174,7 @@ export class WebviewEditorService implements IWebviewEditorService {
},
group
:
number
|
undefined
,
):
WebviewEditorInput
{
const
webviewInput
=
this
.
_instantiationService
.
createInstance
(
RevivedWebviewEditorInput
,
viewType
,
id
,
title
,
options
,
state
,
{},
extension
,
async
(
webview
:
WebviewEditorInput
):
Promise
<
void
>
=>
{
const
webviewInput
=
this
.
_instantiationService
.
createInstance
(
RevivedWebviewEditorInput
,
viewType
,
title
,
options
,
state
,
{},
extension
,
async
(
webview
:
WebviewEditorInput
):
Promise
<
void
>
=>
{
const
didRevive
=
await
this
.
tryRevive
(
webview
);
if
(
didRevive
)
{
return
Promise
.
resolve
(
undefined
);
...
...
@@ -220,7 +218,7 @@ export class WebviewEditorService implements IWebviewEditorService {
// Revived webviews may not have an actively registered reviver but we still want to presist them
// since a reviver should exist when it is actually needed.
return
!
(
webview
instanceof
RevivedWebviewEditorInput
)
;
return
webview
instanceof
RevivedWebviewEditorInput
;
}
private
async
tryRevive
(
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录