Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
9e867994
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 搜索 >>
提交
9e867994
编写于
8月 18, 2017
作者:
J
Johannes Rieken
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix #32788
上级
83ac7b4e
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
30 addition
and
14 deletion
+30
-14
src/vs/workbench/api/electron-browser/mainThreadLanguageFeatures.ts
...kbench/api/electron-browser/mainThreadLanguageFeatures.ts
+1
-1
src/vs/workbench/api/node/extHostLanguageFeatures.ts
src/vs/workbench/api/node/extHostLanguageFeatures.ts
+29
-13
未找到文件。
src/vs/workbench/api/electron-browser/mainThreadLanguageFeatures.ts
浏览文件 @
9e867994
...
...
@@ -265,7 +265,7 @@ export class MainThreadLanguageFeatures implements MainThreadLanguageFeaturesSha
$registerDocumentLinkProvider
(
handle
:
number
,
selector
:
vscode
.
DocumentSelector
):
TPromise
<
any
>
{
this
.
_registrations
[
handle
]
=
modes
.
LinkProviderRegistry
.
register
(
selector
,
<
modes
.
LinkProvider
>
{
provideLinks
:
(
model
,
token
)
=>
{
return
wireCancellationToken
(
token
,
this
.
_proxy
.
$provideDocumentLinks
(
handle
,
model
.
uri
));
return
this
.
_heapService
.
trackRecursive
(
wireCancellationToken
(
token
,
this
.
_proxy
.
$provideDocumentLinks
(
handle
,
model
.
uri
)
));
},
resolveLink
:
(
link
,
token
)
=>
{
return
wireCancellationToken
(
token
,
this
.
_proxy
.
$resolveDocumentLink
(
handle
,
link
));
...
...
src/vs/workbench/api/node/extHostLanguageFeatures.ts
浏览文件 @
9e867994
...
...
@@ -634,10 +634,12 @@ class SignatureHelpAdapter {
class
LinkProviderAdapter
{
private
_documents
:
ExtHostDocuments
;
private
_heapService
:
ExtHostHeapService
;
private
_provider
:
vscode
.
DocumentLinkProvider
;
constructor
(
documents
:
ExtHostDocuments
,
provider
:
vscode
.
DocumentLinkProvider
)
{
constructor
(
documents
:
ExtHostDocuments
,
heapService
:
ExtHostHeapService
,
provider
:
vscode
.
DocumentLinkProvider
)
{
this
.
_documents
=
documents
;
this
.
_heapService
=
heapService
;
this
.
_provider
=
provider
;
}
...
...
@@ -645,23 +647,37 @@ class LinkProviderAdapter {
const
doc
=
this
.
_documents
.
getDocumentData
(
resource
).
document
;
return
asWinJsPromise
(
token
=>
this
.
_provider
.
provideDocumentLinks
(
doc
,
token
)).
then
(
links
=>
{
if
(
Array
.
isArray
(
links
))
{
return
links
.
map
(
TypeConverters
.
DocumentLink
.
from
)
;
if
(
!
Array
.
isArray
(
links
))
{
return
undefined
;
}
return
undefined
;
const
result
:
modes
.
ILink
[]
=
[];
for
(
const
link
of
links
)
{
let
data
=
TypeConverters
.
DocumentLink
.
from
(
link
);
let
id
=
this
.
_heapService
.
keep
(
link
);
ObjectIdentifier
.
mixin
(
data
,
id
);
result
.
push
(
data
);
}
return
result
;
});
}
resolveLink
(
link
:
modes
.
ILink
):
TPromise
<
modes
.
ILink
>
{
if
(
typeof
this
.
_provider
.
resolveDocumentLink
===
'
function
'
)
{
return
asWinJsPromise
(
token
=>
this
.
_provider
.
resolveDocumentLink
(
TypeConverters
.
DocumentLink
.
to
(
link
),
token
)).
then
(
value
=>
{
if
(
value
)
{
return
TypeConverters
.
DocumentLink
.
from
(
value
);
}
return
undefined
;
});
if
(
typeof
this
.
_provider
.
resolveDocumentLink
!==
'
function
'
)
{
return
undefined
;
}
return
undefined
;
const
id
=
ObjectIdentifier
.
of
(
link
);
const
item
=
this
.
_heapService
.
get
<
vscode
.
DocumentLink
>
(
id
);
if
(
!
item
)
{
return
undefined
;
}
return
asWinJsPromise
(
token
=>
this
.
_provider
.
resolveDocumentLink
(
item
,
token
)).
then
(
value
=>
{
if
(
value
)
{
return
TypeConverters
.
DocumentLink
.
from
(
value
);
}
return
undefined
;
});
}
}
...
...
@@ -993,7 +1009,7 @@ export class ExtHostLanguageFeatures implements ExtHostLanguageFeaturesShape {
registerDocumentLinkProvider
(
selector
:
vscode
.
DocumentSelector
,
provider
:
vscode
.
DocumentLinkProvider
):
vscode
.
Disposable
{
const
handle
=
this
.
_nextHandle
();
this
.
_adapter
.
set
(
handle
,
new
LinkProviderAdapter
(
this
.
_documents
,
provider
));
this
.
_adapter
.
set
(
handle
,
new
LinkProviderAdapter
(
this
.
_documents
,
this
.
_heapService
,
provider
));
this
.
_proxy
.
$registerDocumentLinkProvider
(
handle
,
selector
);
return
this
.
_createDisposable
(
handle
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录