Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
旅途_2012
vscode
提交
5c3bab92
V
vscode
项目概览
旅途_2012
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
5c3bab92
编写于
6月 20, 2019
作者:
J
Johannes Rieken
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
more code insets API tweaks, #66418
上级
db17c23a
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
17 addition
and
16 deletion
+17
-16
src/vs/vscode.proposed.d.ts
src/vs/vscode.proposed.d.ts
+3
-2
src/vs/workbench/api/browser/mainThreadCodeInsets.ts
src/vs/workbench/api/browser/mainThreadCodeInsets.ts
+7
-7
src/vs/workbench/api/common/extHost.protocol.ts
src/vs/workbench/api/common/extHost.protocol.ts
+1
-1
src/vs/workbench/api/common/extHostCodeInsets.ts
src/vs/workbench/api/common/extHostCodeInsets.ts
+4
-4
src/vs/workbench/api/node/extHost.api.impl.ts
src/vs/workbench/api/node/extHost.api.impl.ts
+2
-2
未找到文件。
src/vs/vscode.proposed.d.ts
浏览文件 @
5c3bab92
...
...
@@ -139,14 +139,15 @@ declare module 'vscode' {
export
interface
WebviewEditorInset
{
readonly
editor
:
TextEditor
;
readonly
range
:
Range
;
readonly
line
:
number
;
readonly
height
:
number
;
readonly
webview
:
Webview
;
readonly
onDidDispose
:
Event
<
void
>
;
dispose
():
void
;
}
export
namespace
window
{
export
function
createWebviewTextEditorInset
(
editor
:
TextEditor
,
range
:
Range
,
options
?:
WebviewOptions
):
WebviewEditorInset
;
export
function
createWebviewTextEditorInset
(
editor
:
TextEditor
,
line
:
number
,
height
:
number
,
options
?:
WebviewOptions
):
WebviewEditorInset
;
}
//#endregion
...
...
src/vs/workbench/api/browser/mainThreadCodeInsets.ts
浏览文件 @
5c3bab92
...
...
@@ -7,7 +7,6 @@ import { UriComponents, URI } from 'vs/base/common/uri';
import
*
as
modes
from
'
vs/editor/common/modes
'
;
import
{
MainContext
,
MainThreadEditorInsetsShape
,
IExtHostContext
,
ExtHostEditorInsetsShape
,
ExtHostContext
}
from
'
vs/workbench/api/common/extHost.protocol
'
;
import
{
extHostNamedCustomer
}
from
'
../common/extHostCustomers
'
;
import
{
IRange
}
from
'
vs/editor/common/core/range
'
;
import
{
ICodeEditorService
}
from
'
vs/editor/browser/services/codeEditorService
'
;
import
{
IWebviewService
,
Webview
}
from
'
vs/workbench/contrib/webview/common/webview
'
;
import
{
DisposableStore
}
from
'
vs/base/common/lifecycle
'
;
...
...
@@ -32,14 +31,15 @@ class EditorWebviewZone implements IViewZone {
constructor
(
readonly
editor
:
IActiveCodeEditor
,
readonly
range
:
IRange
,
readonly
line
:
number
,
readonly
height
:
number
,
readonly
webview
:
Webview
,
)
{
this
.
domNode
=
document
.
createElement
(
'
div
'
);
this
.
domNode
.
style
.
zIndex
=
'
10
'
;
// without this, the webview is not interactive
this
.
afterLineNumber
=
range
.
startLineNumber
;
this
.
afterColumn
=
range
.
startColumn
;
this
.
heightInLines
=
range
.
endLineNumber
-
range
.
startLineNumber
;
this
.
afterLineNumber
=
line
;
this
.
afterColumn
=
1
;
this
.
heightInLines
=
height
;
editor
.
changeViewZones
(
accessor
=>
this
.
_id
=
accessor
.
addZone
(
this
));
webview
.
mountTo
(
this
.
domNode
);
...
...
@@ -69,7 +69,7 @@ export class MainThreadEditorInsets implements MainThreadEditorInsetsShape {
this
.
_disposables
.
dispose
();
}
async
$createEditorInset
(
handle
:
number
,
id
:
string
,
uri
:
UriComponents
,
range
:
IRange
,
options
:
modes
.
IWebviewOptions
,
extensionId
:
ExtensionIdentifier
,
extensionLocation
:
UriComponents
):
Promise
<
void
>
{
async
$createEditorInset
(
handle
:
number
,
id
:
string
,
uri
:
UriComponents
,
line
:
number
,
height
:
number
,
options
:
modes
.
IWebviewOptions
,
extensionId
:
ExtensionIdentifier
,
extensionLocation
:
UriComponents
):
Promise
<
void
>
{
let
editor
:
IActiveCodeEditor
|
undefined
;
id
=
id
.
substr
(
0
,
id
.
indexOf
(
'
,
'
));
//todo@joh HACK
...
...
@@ -97,7 +97,7 @@ export class MainThreadEditorInsets implements MainThreadEditorInsetsShape {
localResourceRoots
:
options
.
localResourceRoots
?
options
.
localResourceRoots
.
map
(
uri
=>
URI
.
revive
(
uri
))
:
undefined
});
const
webviewZone
=
new
EditorWebviewZone
(
editor
,
range
,
webview
);
const
webviewZone
=
new
EditorWebviewZone
(
editor
,
line
,
height
,
webview
);
const
remove
=
()
=>
{
disposables
.
dispose
();
...
...
src/vs/workbench/api/common/extHost.protocol.ts
浏览文件 @
5c3bab92
...
...
@@ -511,7 +511,7 @@ export interface MainThreadTelemetryShape extends IDisposable {
}
export
interface
MainThreadEditorInsetsShape
extends
IDisposable
{
$createEditorInset
(
handle
:
number
,
id
:
string
,
uri
:
UriComponents
,
range
:
IRange
,
options
:
modes
.
IWebviewOptions
,
extensionId
:
ExtensionIdentifier
,
extensionLocation
:
UriComponents
):
Promise
<
void
>
;
$createEditorInset
(
handle
:
number
,
id
:
string
,
uri
:
UriComponents
,
line
:
number
,
height
:
number
,
options
:
modes
.
IWebviewOptions
,
extensionId
:
ExtensionIdentifier
,
extensionLocation
:
UriComponents
):
Promise
<
void
>
;
$disposeEditorInset
(
handle
:
number
):
void
;
$setHtml
(
handle
:
number
,
value
:
string
):
void
;
...
...
src/vs/workbench/api/common/extHostCodeInsets.ts
浏览文件 @
5c3bab92
...
...
@@ -4,7 +4,6 @@
*--------------------------------------------------------------------------------------------*/
import
{
Emitter
}
from
'
vs/base/common/event
'
;
import
*
as
typeConverters
from
'
vs/workbench/api/common/extHostTypeConverters
'
;
import
*
as
vscode
from
'
vscode
'
;
import
{
MainThreadEditorInsetsShape
}
from
'
./extHost.protocol
'
;
import
{
ExtHostEditors
}
from
'
vs/workbench/api/common/extHostTextEditors
'
;
...
...
@@ -39,7 +38,7 @@ export class ExtHostEditorInsets implements ExtHostEditorInsets {
this
.
_disposables
.
dispose
();
}
createWebviewEditorInset
(
editor
:
vscode
.
TextEditor
,
range
:
vscode
.
Range
,
options
:
vscode
.
WebviewOptions
|
undefined
,
extension
:
IExtensionDescription
):
vscode
.
WebviewEditorInset
{
createWebviewEditorInset
(
editor
:
vscode
.
TextEditor
,
line
:
number
,
height
:
number
,
options
:
vscode
.
WebviewOptions
|
undefined
,
extension
:
IExtensionDescription
):
vscode
.
WebviewEditorInset
{
let
apiEditor
:
ExtHostTextEditor
|
undefined
;
for
(
const
candidate
of
this
.
_editors
.
getVisibleTextEditors
())
{
...
...
@@ -92,7 +91,8 @@ export class ExtHostEditorInsets implements ExtHostEditorInsets {
const
inset
=
new
class
implements
vscode
.
WebviewEditorInset
{
readonly
editor
:
vscode
.
TextEditor
=
editor
;
readonly
range
:
vscode
.
Range
=
range
;
readonly
line
:
number
=
line
;
readonly
height
:
number
=
height
;
readonly
webview
:
vscode
.
Webview
=
webview
;
readonly
onDidDispose
:
vscode
.
Event
<
void
>
=
onDidDispose
.
event
;
...
...
@@ -109,7 +109,7 @@ export class ExtHostEditorInsets implements ExtHostEditorInsets {
}
};
this
.
_proxy
.
$createEditorInset
(
handle
,
apiEditor
.
id
,
apiEditor
.
document
.
uri
,
typeConverters
.
Range
.
from
(
range
)
,
options
||
{},
extension
.
identifier
,
extension
.
extensionLocation
);
this
.
_proxy
.
$createEditorInset
(
handle
,
apiEditor
.
id
,
apiEditor
.
document
.
uri
,
line
+
1
,
height
,
options
||
{},
extension
.
identifier
,
extension
.
extensionLocation
);
this
.
_insets
.
set
(
handle
,
{
editor
,
inset
,
onDidReceiveMessage
});
return
inset
;
...
...
src/vs/workbench/api/node/extHost.api.impl.ts
浏览文件 @
5c3bab92
...
...
@@ -505,9 +505,9 @@ export function createApiFactory(
createWebviewPanel
(
viewType
:
string
,
title
:
string
,
showOptions
:
vscode
.
ViewColumn
|
{
viewColumn
:
vscode
.
ViewColumn
,
preserveFocus
?:
boolean
},
options
:
vscode
.
WebviewPanelOptions
&
vscode
.
WebviewOptions
):
vscode
.
WebviewPanel
{
return
extHostWebviews
.
createWebviewPanel
(
extension
,
viewType
,
title
,
showOptions
,
options
);
},
createWebviewTextEditorInset
(
editor
:
vscode
.
TextEditor
,
range
:
vscode
.
Range
,
options
:
vscode
.
WebviewOptions
):
vscode
.
WebviewEditorInset
{
createWebviewTextEditorInset
(
editor
:
vscode
.
TextEditor
,
line
:
number
,
height
:
number
,
options
:
vscode
.
WebviewOptions
):
vscode
.
WebviewEditorInset
{
checkProposedApiEnabled
(
extension
);
return
extHostEditorInsets
.
createWebviewEditorInset
(
editor
,
range
,
options
,
extension
);
return
extHostEditorInsets
.
createWebviewEditorInset
(
editor
,
line
,
height
,
options
,
extension
);
},
createTerminal
(
nameOrOptions
?:
vscode
.
TerminalOptions
|
string
,
shellPath
?:
string
,
shellArgs
?:
string
[]
|
string
):
vscode
.
Terminal
{
if
(
typeof
nameOrOptions
===
'
object
'
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录