Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
59fafc88
R
Rust
项目概览
int
/
Rust
大约 1 年 前同步成功
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
Rust
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
59fafc88
编写于
12月 04, 2017
作者:
A
Andy Russell
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
save-analysis: add parents to imports
上级
77efd680
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
21 addition
and
5 deletion
+21
-5
src/Cargo.lock
src/Cargo.lock
+11
-1
src/librustc_save_analysis/Cargo.toml
src/librustc_save_analysis/Cargo.toml
+1
-1
src/librustc_save_analysis/dump_visitor.rs
src/librustc_save_analysis/dump_visitor.rs
+9
-3
未找到文件。
src/Cargo.lock
浏览文件 @
59fafc88
...
...
@@ -1595,6 +1595,15 @@ dependencies = [
"serde_derive 1.0.23 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "rls-data"
version = "0.14.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"rls-span 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "rls-rustc"
version = "0.1.1"
...
...
@@ -1964,7 +1973,7 @@ name = "rustc_save_analysis"
version = "0.0.0"
dependencies = [
"log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
"rls-data 0.1
3
.0 (registry+https://github.com/rust-lang/crates.io-index)",
"rls-data 0.1
4
.0 (registry+https://github.com/rust-lang/crates.io-index)",
"rls-span 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc 0.0.0",
"rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)",
...
...
@@ -2839,6 +2848,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
"checksum regex-syntax 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ad890a5eef7953f55427c50575c680c42841653abd2b028b68cd223d157f62db"
"checksum rls-analysis 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)" = "171fcab0206870b8bec0d2c60dea66f820ce648a85abffc66f7e2df95c283e06"
"checksum rls-data 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ff85bb3a0daf9f64207a5530d90ae1c10f5515cef064c88b6821090678382b44"
"checksum rls-data 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8024f1feaca72d0aa4ae1e2a8d454a31b9a33ed02f8d0e9c8559bf53c267ec3c"
"checksum rls-rustc 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b21ea952e9bf1569929abf1bb920262cde04b7b1b26d8e0260286302807299d2"
"checksum rls-span 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5d7c7046dc6a92f2ae02ed302746db4382e75131b9ce20ce967259f6b5867a6a"
"checksum rls-vfs 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "ffd34691a510938bb67fe0444fb363103c73ffb31c121d1e16bc92d8945ea8ff"
...
...
src/librustc_save_analysis/Cargo.toml
浏览文件 @
59fafc88
...
...
@@ -15,7 +15,7 @@ rustc_data_structures = { path = "../librustc_data_structures" }
rustc_typeck
=
{
path
=
"../librustc_typeck"
}
syntax
=
{
path
=
"../libsyntax"
}
syntax_pos
=
{
path
=
"../libsyntax_pos"
}
rls-data
=
"0.1
3
"
rls-data
=
"0.1
4
"
rls-span
=
"0.4"
# FIXME(#40527) should move rustc serialize out of tree
rustc-serialize
=
"0.3"
src/librustc_save_analysis/dump_visitor.rs
浏览文件 @
59fafc88
...
...
@@ -1234,10 +1234,13 @@ fn process_impl_item(&mut self, impl_item: &'l ast::ImplItem, impl_id: DefId) {
fn
process_use_tree
(
&
mut
self
,
use_tree
:
&
'l
ast
::
UseTree
,
id
:
NodeId
,
paren
t_item
:
&
'l
ast
::
Item
,
roo
t_item
:
&
'l
ast
::
Item
,
prefix
:
&
ast
::
Path
)
{
let
path
=
&
use_tree
.prefix
;
let
access
=
access_from!
(
self
.save_ctxt
,
parent_item
);
let
access
=
access_from!
(
self
.save_ctxt
,
root_item
);
let
parent
=
self
.save_ctxt.tcx.hir
.opt_local_def_id
(
id
)
.and_then
(|
id
|
self
.save_ctxt.tcx
.parent_def_id
(
id
))
.map
(::
id_from_def_id
);
match
use_tree
.kind
{
ast
::
UseTreeKind
::
Simple
(
ident
)
=>
{
...
...
@@ -1276,6 +1279,7 @@ fn process_use_tree(&mut self,
span
,
name
:
ident
.to_string
(),
value
:
String
::
new
(),
parent
,
});
}
self
.write_sub_paths_truncated
(
&
path
);
...
...
@@ -1311,6 +1315,7 @@ fn process_use_tree(&mut self,
span
,
name
:
"*"
.to_owned
(),
value
:
names
.join
(
", "
),
parent
,
});
}
self
.write_sub_paths
(
&
path
);
...
...
@@ -1325,7 +1330,7 @@ fn process_use_tree(&mut self,
span
:
path
.span
,
};
for
&
(
ref
tree
,
id
)
in
nested_items
{
self
.process_use_tree
(
tree
,
id
,
paren
t_item
,
&
prefix
);
self
.process_use_tree
(
tree
,
id
,
roo
t_item
,
&
prefix
);
}
}
}
...
...
@@ -1400,6 +1405,7 @@ fn visit_item(&mut self, item: &'l ast::Item) {
span
,
name
:
item
.ident
.to_string
(),
value
:
String
::
new
(),
parent
:
None
,
},
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录