Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
e2b07d79
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,发现更多精彩内容 >>
提交
e2b07d79
编写于
4月 21, 2018
作者:
J
Joao Moreno
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ProtocolHandler
上级
f4e9ff47
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
14 addition
and
16 deletion
+14
-16
src/vs/platform/url/electron-browser/inactiveExtensionUrlHandler.ts
...tform/url/electron-browser/inactiveExtensionUrlHandler.ts
+0
-2
src/vs/vscode.proposed.d.ts
src/vs/vscode.proposed.d.ts
+3
-3
src/vs/workbench/api/electron-browser/mainThreadUrls.ts
src/vs/workbench/api/electron-browser/mainThreadUrls.ts
+2
-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
+2
-2
src/vs/workbench/api/node/extHostUrls.ts
src/vs/workbench/api/node/extHostUrls.ts
+5
-5
未找到文件。
src/vs/platform/url/electron-browser/inactiveExtensionUrlHandler.ts
浏览文件 @
e2b07d79
...
...
@@ -98,8 +98,6 @@ export class InactiveExtensionUrlHandler implements IInactiveExtensionUrlHandler
// forget about all uris buffered more than 5 minutes ago
private
garbageCollect
():
void
{
console
.
log
(
'
garbage collect
'
);
const
now
=
new
Date
().
getTime
();
const
uriBuffer
=
new
Map
<
string
,
{
timestamp
:
number
,
uri
:
URI
}[]
>
();
...
...
src/vs/vscode.proposed.d.ts
浏览文件 @
e2b07d79
...
...
@@ -660,8 +660,8 @@ declare module 'vscode' {
//#region URLs
export
interface
ExternalUri
Handler
{
handle
External
Uri
(
uri
:
Uri
):
void
;
export
interface
Protocol
Handler
{
handleUri
(
uri
:
Uri
):
void
;
}
export
namespace
window
{
...
...
@@ -669,7 +669,7 @@ declare module 'vscode' {
/**
* Registers a protocol handler capable of handling system-wide URIs.
*/
export
function
register
ExternalUriHandler
(
handler
:
ExternalUri
Handler
):
Disposable
;
export
function
register
ProtocolHandler
(
handler
:
Protocol
Handler
):
Disposable
;
}
//#endregion
...
...
src/vs/workbench/api/electron-browser/mainThreadUrls.ts
浏览文件 @
e2b07d79
...
...
@@ -42,7 +42,7 @@ export class MainThreadUrls implements MainThreadUrlsShape {
this
.
proxy
=
context
.
getProxy
(
ExtHostContext
.
ExtHostUrls
);
}
$register
ExternalUri
Handler
(
handle
:
number
,
extensionId
:
string
):
TPromise
<
void
>
{
$register
Protocol
Handler
(
handle
:
number
,
extensionId
:
string
):
TPromise
<
void
>
{
const
handler
=
new
ExtensionUrlHandler
(
this
.
proxy
,
handle
,
extensionId
);
const
disposable
=
this
.
urlService
.
registerHandler
(
handler
);
...
...
@@ -52,7 +52,7 @@ export class MainThreadUrls implements MainThreadUrlsShape {
return
TPromise
.
as
(
null
);
}
$unregister
ExternalUri
Handler
(
handle
:
number
):
TPromise
<
void
>
{
$unregister
Protocol
Handler
(
handle
:
number
):
TPromise
<
void
>
{
const
tuple
=
this
.
handlers
.
get
(
handle
);
if
(
!
tuple
)
{
...
...
src/vs/workbench/api/node/extHost.api.impl.ts
浏览文件 @
e2b07d79
...
...
@@ -434,8 +434,8 @@ export function createApiFactory(
registerWebviewPanelSerializer
:
proposedApiFunction
(
extension
,
(
viewType
:
string
,
serializer
:
vscode
.
WebviewPanelSerializer
)
=>
{
return
extHostWebviews
.
registerWebviewPanelSerializer
(
viewType
,
serializer
);
}),
register
ExternalUriHandler
:
proposedApiFunction
(
extension
,
(
handler
:
vscode
.
ExternalUri
Handler
)
=>
{
return
extHostUrls
.
register
ExternalUri
Handler
(
extension
.
id
,
handler
);
register
ProtocolHandler
:
proposedApiFunction
(
extension
,
(
handler
:
vscode
.
Protocol
Handler
)
=>
{
return
extHostUrls
.
register
Protocol
Handler
(
extension
.
id
,
handler
);
})
};
...
...
src/vs/workbench/api/node/extHost.protocol.ts
浏览文件 @
e2b07d79
...
...
@@ -374,8 +374,8 @@ export interface ExtHostWebviewsShape {
}
export
interface
MainThreadUrlsShape
extends
IDisposable
{
$register
ExternalUri
Handler
(
handle
:
number
,
extensionId
:
string
):
TPromise
<
void
>
;
$unregister
ExternalUri
Handler
(
handle
:
number
):
TPromise
<
void
>
;
$register
Protocol
Handler
(
handle
:
number
,
extensionId
:
string
):
TPromise
<
void
>
;
$unregister
Protocol
Handler
(
handle
:
number
):
TPromise
<
void
>
;
}
export
interface
ExtHostUrlsShape
{
...
...
src/vs/workbench/api/node/extHostUrls.ts
浏览文件 @
e2b07d79
...
...
@@ -14,7 +14,7 @@ export class ExtHostUrls implements ExtHostUrlsShape {
private
static
HandlePool
=
0
;
private
readonly
_proxy
:
MainThreadUrlsShape
;
private
handlers
=
new
Map
<
number
,
vscode
.
ExternalUri
Handler
>
();
private
handlers
=
new
Map
<
number
,
vscode
.
Protocol
Handler
>
();
constructor
(
mainContext
:
IMainContext
...
...
@@ -22,14 +22,14 @@ export class ExtHostUrls implements ExtHostUrlsShape {
this
.
_proxy
=
mainContext
.
getProxy
(
MainContext
.
MainThreadUrls
);
}
register
ExternalUriHandler
(
extensionId
:
string
,
handler
:
vscode
.
ExternalUri
Handler
):
vscode
.
Disposable
{
register
ProtocolHandler
(
extensionId
:
string
,
handler
:
vscode
.
Protocol
Handler
):
vscode
.
Disposable
{
const
handle
=
ExtHostUrls
.
HandlePool
++
;
this
.
handlers
.
set
(
handle
,
handler
);
this
.
_proxy
.
$register
ExternalUri
Handler
(
handle
,
extensionId
);
this
.
_proxy
.
$register
Protocol
Handler
(
handle
,
extensionId
);
return
toDisposable
(()
=>
{
this
.
handlers
.
delete
(
handle
);
this
.
_proxy
.
$unregister
ExternalUri
Handler
(
handle
);
this
.
_proxy
.
$unregister
Protocol
Handler
(
handle
);
});
}
...
...
@@ -40,7 +40,7 @@ export class ExtHostUrls implements ExtHostUrlsShape {
return
TPromise
.
as
(
null
);
}
handler
.
handle
External
Uri
(
URI
.
revive
(
uri
));
handler
.
handleUri
(
URI
.
revive
(
uri
));
return
TPromise
.
as
(
null
);
}
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录