Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
6fc8778f
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,发现更多精彩内容 >>
提交
6fc8778f
编写于
9月 12, 2019
作者:
J
jrieken
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
calls - add CallHierarchyItem to type converter
上级
debecefc
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
41 addition
and
36 deletion
+41
-36
src/vs/workbench/api/common/extHost.protocol.ts
src/vs/workbench/api/common/extHost.protocol.ts
+0
-1
src/vs/workbench/api/common/extHostLanguageFeatures.ts
src/vs/workbench/api/common/extHostLanguageFeatures.ts
+2
-22
src/vs/workbench/api/common/extHostTypeConverters.ts
src/vs/workbench/api/common/extHostTypeConverters.ts
+39
-12
src/vs/workbench/contrib/callHierarchy/common/callHierarchy.ts
...s/workbench/contrib/callHierarchy/common/callHierarchy.ts
+0
-1
未找到文件。
src/vs/workbench/api/common/extHost.protocol.ts
浏览文件 @
6fc8778f
...
...
@@ -1068,7 +1068,6 @@ export interface ICodeLensDto {
}
export
interface
ICallHierarchyItemDto
{
_id
:
number
;
kind
:
modes
.
SymbolKind
;
name
:
string
;
detail
?:
string
;
...
...
src/vs/workbench/api/common/extHostLanguageFeatures.ts
浏览文件 @
6fc8778f
...
...
@@ -24,8 +24,6 @@ import { ISelection, Selection } from 'vs/editor/common/core/selection';
import
{
ILogService
}
from
'
vs/platform/log/common/log
'
;
import
{
CancellationToken
}
from
'
vs/base/common/cancellation
'
;
import
{
ExtensionIdentifier
,
IExtensionDescription
}
from
'
vs/platform/extensions/common/extensions
'
;
import
*
as
callHierarchy
from
'
vs/workbench/contrib/callHierarchy/common/callHierarchy
'
;
import
{
LRUCache
}
from
'
vs/base/common/map
'
;
import
{
IURITransformer
}
from
'
vs/base/common/uriIpc
'
;
import
{
DisposableStore
,
dispose
}
from
'
vs/base/common/lifecycle
'
;
...
...
@@ -1011,10 +1009,6 @@ class SelectionRangeAdapter {
class
CallHierarchyAdapter
{
// todo@joh keep object (add managed lifecycle)
private
readonly
_cache
=
new
LRUCache
<
number
,
vscode
.
CallHierarchyItem
>
(
3000
,
0.8
);
private
_idPool
=
0
;
constructor
(
private
readonly
_documents
:
ExtHostDocuments
,
private
readonly
_provider
:
vscode
.
CallHierarchyItemProvider
...
...
@@ -1027,7 +1021,7 @@ class CallHierarchyAdapter {
if
(
!
calls
)
{
return
undefined
;
}
return
calls
.
map
(
call
=>
(
<
[
ICallHierarchyItemDto
,
IRange
[]]
>
[
t
his
.
_fromIte
m
(
call
.
source
),
call
.
sourceRanges
.
map
(
typeConvert
.
Range
.
from
)]));
return
calls
.
map
(
call
=>
(
<
[
ICallHierarchyItemDto
,
IRange
[]]
>
[
t
ypeConvert
.
CallHierarchyItem
.
fro
m
(
call
.
source
),
call
.
sourceRanges
.
map
(
typeConvert
.
Range
.
from
)]));
}
async
provideCallsFrom
(
uri
:
URI
,
position
:
IPosition
,
token
:
CancellationToken
):
Promise
<
[
ICallHierarchyItemDto
,
IRange
[]][]
|
undefined
>
{
...
...
@@ -1037,21 +1031,7 @@ class CallHierarchyAdapter {
if
(
!
calls
)
{
return
undefined
;
}
return
calls
.
map
(
call
=>
(
<
[
ICallHierarchyItemDto
,
IRange
[]]
>
[
this
.
_fromItem
(
call
.
target
),
call
.
sourceRanges
.
map
(
typeConvert
.
Range
.
from
)]));
}
private
_fromItem
(
item
:
vscode
.
CallHierarchyItem
,
_id
:
number
=
this
.
_idPool
++
):
callHierarchy
.
CallHierarchyItem
{
const
res
=
<
callHierarchy
.
CallHierarchyItem
>
{
_id
,
name
:
item
.
name
,
detail
:
item
.
detail
,
kind
:
typeConvert
.
SymbolKind
.
from
(
item
.
kind
),
uri
:
item
.
uri
,
range
:
typeConvert
.
Range
.
from
(
item
.
range
),
selectionRange
:
typeConvert
.
Range
.
from
(
item
.
selectionRange
),
};
this
.
_cache
.
set
(
_id
,
item
);
return
res
;
return
calls
.
map
(
call
=>
(
<
[
ICallHierarchyItemDto
,
IRange
[]]
>
[
typeConvert
.
CallHierarchyItem
.
from
(
call
.
target
),
call
.
sourceRanges
.
map
(
typeConvert
.
Range
.
from
)]));
}
}
...
...
src/vs/workbench/api/common/extHostTypeConverters.ts
浏览文件 @
6fc8778f
...
...
@@ -19,7 +19,7 @@ import { IRange } from 'vs/editor/common/core/range';
import
{
ISelection
}
from
'
vs/editor/common/core/selection
'
;
import
*
as
htmlContent
from
'
vs/base/common/htmlContent
'
;
import
*
as
languageSelector
from
'
vs/editor/common/modes/languageSelector
'
;
import
{
IWorkspaceEditDto
,
IResourceTextEditDto
,
IResourceFileEditDto
}
from
'
vs/workbench/api/common/extHost.protocol
'
;
import
*
as
extHostProtocol
from
'
vs/workbench/api/common/extHost.protocol
'
;
import
{
MarkerSeverity
,
IRelatedInformation
,
IMarkerData
,
MarkerTag
}
from
'
vs/platform/markers/common/markers
'
;
import
{
ACTIVE_GROUP
,
SIDE_GROUP
}
from
'
vs/workbench/services/editor/common/editorService
'
;
import
{
ExtHostDocumentsAndEditors
}
from
'
vs/workbench/api/common/extHostDocumentsAndEditors
'
;
...
...
@@ -31,6 +31,7 @@ import { LogLevel as _MainLogLevel } from 'vs/platform/log/common/log';
import
{
coalesce
,
isNonEmptyArray
}
from
'
vs/base/common/arrays
'
;
import
{
RenderLineNumbersType
}
from
'
vs/editor/common/config/editorOptions
'
;
export
interface
PositionLike
{
line
:
number
;
character
:
number
;
...
...
@@ -473,8 +474,8 @@ export namespace TextEdit {
}
export
namespace
WorkspaceEdit
{
export
function
from
(
value
:
vscode
.
WorkspaceEdit
,
documents
?:
ExtHostDocumentsAndEditors
):
IWorkspaceEditDto
{
const
result
:
IWorkspaceEditDto
=
{
export
function
from
(
value
:
vscode
.
WorkspaceEdit
,
documents
?:
ExtHostDocumentsAndEditors
):
extHostProtocol
.
IWorkspaceEditDto
{
const
result
:
extHostProtocol
.
IWorkspaceEditDto
=
{
edits
:
[]
};
for
(
const
entry
of
(
value
as
types
.
WorkspaceEdit
).
_allEntries
())
{
...
...
@@ -482,28 +483,28 @@ export namespace WorkspaceEdit {
if
(
Array
.
isArray
(
uriOrEdits
))
{
// text edits
const
doc
=
documents
&&
uri
?
documents
.
getDocument
(
uri
)
:
undefined
;
result
.
edits
.
push
(
<
IResourceTextEditDto
>
{
resource
:
uri
,
modelVersionId
:
doc
&&
doc
.
version
,
edits
:
uriOrEdits
.
map
(
TextEdit
.
from
)
});
result
.
edits
.
push
(
<
extHostProtocol
.
IResourceTextEditDto
>
{
resource
:
uri
,
modelVersionId
:
doc
&&
doc
.
version
,
edits
:
uriOrEdits
.
map
(
TextEdit
.
from
)
});
}
else
{
// resource edits
result
.
edits
.
push
(
<
IResourceFileEditDto
>
{
oldUri
:
uri
,
newUri
:
uriOrEdits
,
options
:
entry
[
2
]
});
result
.
edits
.
push
(
<
extHostProtocol
.
IResourceFileEditDto
>
{
oldUri
:
uri
,
newUri
:
uriOrEdits
,
options
:
entry
[
2
]
});
}
}
return
result
;
}
export
function
to
(
value
:
IWorkspaceEditDto
)
{
export
function
to
(
value
:
extHostProtocol
.
IWorkspaceEditDto
)
{
const
result
=
new
types
.
WorkspaceEdit
();
for
(
const
edit
of
value
.
edits
)
{
if
(
Array
.
isArray
((
<
IResourceTextEditDto
>
edit
).
edits
))
{
if
(
Array
.
isArray
((
<
extHostProtocol
.
IResourceTextEditDto
>
edit
).
edits
))
{
result
.
set
(
URI
.
revive
((
<
IResourceTextEditDto
>
edit
).
resource
),
<
types
.
TextEdit
[]
>
(
<
IResourceTextEditDto
>
edit
).
edits
.
map
(
TextEdit
.
to
)
URI
.
revive
((
<
extHostProtocol
.
IResourceTextEditDto
>
edit
).
resource
),
<
types
.
TextEdit
[]
>
(
<
extHostProtocol
.
IResourceTextEditDto
>
edit
).
edits
.
map
(
TextEdit
.
to
)
);
}
else
{
result
.
renameFile
(
URI
.
revive
((
<
IResourceFileEditDto
>
edit
).
oldUri
!
),
URI
.
revive
((
<
IResourceFileEditDto
>
edit
).
newUri
!
),
(
<
IResourceFileEditDto
>
edit
).
options
URI
.
revive
((
<
extHostProtocol
.
IResourceFileEditDto
>
edit
).
oldUri
!
),
URI
.
revive
((
<
extHostProtocol
.
IResourceFileEditDto
>
edit
).
newUri
!
),
(
<
extHostProtocol
.
IResourceFileEditDto
>
edit
).
options
);
}
}
...
...
@@ -626,6 +627,32 @@ export namespace DocumentSymbol {
}
}
export
namespace
CallHierarchyItem
{
export
function
from
(
item
:
vscode
.
CallHierarchyItem
):
extHostProtocol
.
ICallHierarchyItemDto
{
return
{
name
:
item
.
name
,
detail
:
item
.
detail
,
kind
:
SymbolKind
.
from
(
item
.
kind
),
uri
:
item
.
uri
,
range
:
Range
.
from
(
item
.
range
),
selectionRange
:
Range
.
from
(
item
.
selectionRange
),
};
}
export
function
to
(
item
:
extHostProtocol
.
ICallHierarchyItemDto
):
vscode
.
CallHierarchyItem
{
return
new
types
.
CallHierarchyItem
(
SymbolKind
.
to
(
item
.
kind
),
item
.
name
,
item
.
detail
||
''
,
URI
.
revive
(
item
.
uri
),
Range
.
to
(
item
.
range
),
Range
.
to
(
item
.
selectionRange
)
);
}
}
export
namespace
location
{
export
function
from
(
value
:
vscode
.
Location
):
modes
.
Location
{
return
{
...
...
src/vs/workbench/contrib/callHierarchy/common/callHierarchy.ts
浏览文件 @
6fc8778f
...
...
@@ -17,7 +17,6 @@ export const enum CallHierarchyDirection {
}
export
interface
CallHierarchyItem
{
_id
:
number
;
kind
:
SymbolKind
;
name
:
string
;
detail
?:
string
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录