Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
a9892200
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,发现更多精彩内容 >>
提交
a9892200
编写于
2月 27, 2018
作者:
M
Matt Bierner
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add title to webviewCreate
Part of #44579
上级
724217df
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
14 addition
and
13 deletion
+14
-13
extensions/markdown/src/features/previewContentProvider.ts
extensions/markdown/src/features/previewContentProvider.ts
+1
-0
src/vs/vscode.proposed.d.ts
src/vs/vscode.proposed.d.ts
+2
-1
src/vs/workbench/api/electron-browser/mainThreadWebview.ts
src/vs/workbench/api/electron-browser/mainThreadWebview.ts
+4
-2
src/vs/workbench/api/node/extHost.api.impl.ts
src/vs/workbench/api/node/extHost.api.impl.ts
+2
-2
src/vs/workbench/api/node/extHost.protocol.ts
src/vs/workbench/api/node/extHost.protocol.ts
+1
-1
src/vs/workbench/api/node/extHostWebview.ts
src/vs/workbench/api/node/extHostWebview.ts
+4
-7
未找到文件。
extensions/markdown/src/features/previewContentProvider.ts
浏览文件 @
a9892200
...
...
@@ -300,6 +300,7 @@ class MarkdownPreview {
this
.
uri
=
vscode
.
Uri
.
parse
(
`
${
MarkdownPreview
.
previewScheme
}
:
${
MarkdownPreview
.
previewCount
++
}
`
);
this
.
webview
=
vscode
.
window
.
createWebview
(
this
.
uri
,
this
.
getPreviewTitle
(
this
.
_resource
),
previewColumn
,
{
enableScripts
:
true
,
localResourceRoots
:
this
.
getLocalResourceRoots
(
_resource
)
...
...
src/vs/vscode.proposed.d.ts
浏览文件 @
a9892200
...
...
@@ -555,10 +555,11 @@ declare module 'vscode' {
* Create and show a new webview.
*
* @param uri Unique identifier for the webview.
* @param title Title of the webview.
* @param column Editor column to show the new webview in.
* @param options Content settings for the webview.
*/
export
function
createWebview
(
uri
:
Uri
,
column
:
ViewColumn
,
options
:
WebviewOptions
):
Webview
;
export
function
createWebview
(
uri
:
Uri
,
title
:
string
,
column
:
ViewColumn
,
options
:
WebviewOptions
):
Webview
;
/**
* Event fired when the active editor changes.
...
...
src/vs/workbench/api/electron-browser/mainThreadWebview.ts
浏览文件 @
a9892200
...
...
@@ -429,8 +429,8 @@ export class MainThreadWebviews implements MainThreadWebviewsShape {
this
.
_toDispose
=
dispose
(
this
.
_toDispose
);
}
$createWebview
(
handle
:
WebviewHandle
,
uri
:
URI
,
options
:
vscode
.
WebviewOptions
):
void
{
const
webviewInput
=
WebviewInput
.
create
(
URI
.
revive
(
uri
),
''
,
options
,
''
,
{
$createWebview
(
handle
:
WebviewHandle
,
uri
:
URI
,
title
:
string
,
column
:
Position
,
options
:
vscode
.
WebviewOptions
):
void
{
const
webviewInput
=
WebviewInput
.
create
(
URI
.
revive
(
uri
),
title
,
options
,
''
,
{
onMessage
:
message
=>
this
.
_proxy
.
$onMessage
(
handle
,
message
),
onDidChangePosition
:
position
=>
this
.
_proxy
.
$onDidChangePosition
(
handle
,
position
),
onDispose
:
()
=>
this
.
_proxy
.
$onDidDisposeWeview
(
handle
),
...
...
@@ -438,6 +438,8 @@ export class MainThreadWebviews implements MainThreadWebviewsShape {
},
this
.
_partService
);
this
.
_webviews
.
set
(
handle
,
webviewInput
);
this
.
_editorService
.
openEditor
(
webviewInput
,
{
pinned
:
true
},
column
);
}
$disposeWebview
(
handle
:
WebviewHandle
):
void
{
...
...
src/vs/workbench/api/node/extHost.api.impl.ts
浏览文件 @
a9892200
...
...
@@ -405,8 +405,8 @@ export function createApiFactory(
registerDecorationProvider
:
proposedApiFunction
(
extension
,
(
provider
:
vscode
.
DecorationProvider
)
=>
{
return
extHostDecorations
.
registerDecorationProvider
(
provider
,
extension
.
id
);
}),
createWebview
:
proposedApiFunction
(
extension
,
(
uri
:
vscode
.
Uri
,
column
:
vscode
.
ViewColumn
,
options
:
vscode
.
WebviewOptions
)
=>
{
return
extHostWebviews
.
createWebview
(
uri
,
column
,
options
);
createWebview
:
proposedApiFunction
(
extension
,
(
uri
:
vscode
.
Uri
,
title
:
string
,
column
:
vscode
.
ViewColumn
,
options
:
vscode
.
WebviewOptions
)
=>
{
return
extHostWebviews
.
createWebview
(
uri
,
title
,
column
,
options
);
}),
onDidChangeActiveEditor
:
proposedApiFunction
(
extension
,
(
listener
,
thisArg
?,
disposables
?)
=>
{
return
extHostDocumentsAndEditors
.
onDidChangeActiveEditor
(
listener
,
thisArg
,
disposables
);
...
...
src/vs/workbench/api/node/extHost.protocol.ts
浏览文件 @
a9892200
...
...
@@ -345,7 +345,7 @@ export interface MainThreadTelemetryShape extends IDisposable {
export
type
WebviewHandle
=
number
;
export
interface
MainThreadWebviewsShape
extends
IDisposable
{
$createWebview
(
handle
:
WebviewHandle
,
uri
:
URI
,
options
:
vscode
.
WebviewOptions
):
void
;
$createWebview
(
handle
:
WebviewHandle
,
uri
:
URI
,
title
:
string
,
column
:
EditorPosition
,
options
:
vscode
.
WebviewOptions
):
void
;
$disposeWebview
(
handle
:
WebviewHandle
):
void
;
$show
(
handle
:
WebviewHandle
,
column
:
EditorPosition
):
void
;
$setTitle
(
handle
:
WebviewHandle
,
value
:
string
):
void
;
...
...
src/vs/workbench/api/node/extHostWebview.ts
浏览文件 @
a9892200
...
...
@@ -127,18 +127,15 @@ export class ExtHostWebviews implements ExtHostWebviewsShape {
createWebview
(
uri
:
vscode
.
Uri
,
title
:
string
,
viewColumn
:
vscode
.
ViewColumn
,
options
:
vscode
.
WebviewOptions
):
vscode
.
Webview
{
const
handle
=
ExtHostWebviews
.
handlePool
++
;
if
(
!
this
.
_webviews
.
has
(
handle
))
{
this
.
_proxy
.
$createWebview
(
handle
,
uri
,
options
);
this
.
_proxy
.
$createWebview
(
handle
,
uri
,
title
,
typeConverters
.
fromViewColumn
(
viewColumn
),
options
);
const
webview
=
new
ExtHostWebview
(
handle
,
this
.
_proxy
,
uri
,
viewColumn
,
options
);
this
.
_webviews
.
set
(
handle
,
webview
);
}
this
.
_proxy
.
$show
(
handle
,
typeConverters
.
fromViewColumn
(
viewColumn
));
const
webview
=
new
ExtHostWebview
(
handle
,
this
.
_proxy
,
uri
,
viewColumn
,
options
);
this
.
_webviews
.
set
(
handle
,
webview
);
return
this
.
_webviews
.
get
(
handle
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录