aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_analysis/src/descriptors
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2018-11-20 18:17:14 +0000
committerAleksey Kladov <[email protected]>2018-11-20 18:17:14 +0000
commit1cf92c3e286232be7e0d1370b88547ca0cb6f636 (patch)
tree8400f21e8e1eb1ef58705e4fa342e56de58765fb /crates/ra_analysis/src/descriptors
parentc54b51fdedd21b0367af7cb3fac3bc16d21b8cc1 (diff)
remember spans with paths
Diffstat (limited to 'crates/ra_analysis/src/descriptors')
-rw-r--r--crates/ra_analysis/src/descriptors/module/nameres.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/crates/ra_analysis/src/descriptors/module/nameres.rs b/crates/ra_analysis/src/descriptors/module/nameres.rs
index 8002656d6..18e8342b3 100644
--- a/crates/ra_analysis/src/descriptors/module/nameres.rs
+++ b/crates/ra_analysis/src/descriptors/module/nameres.rs
@@ -3,7 +3,7 @@ use rustc_hash::FxHashMap;
3 3
4use ra_syntax::{ 4use ra_syntax::{
5 SmolStr, SyntaxKind, 5 SmolStr, SyntaxKind,
6 ast::{self, NameOwner} 6 ast::{self, NameOwner, AstNode}
7}; 7};
8 8
9use crate::{ 9use crate::{
@@ -28,7 +28,7 @@ struct InputModuleItems {
28#[derive(Debug, Clone)] 28#[derive(Debug, Clone)]
29struct Path { 29struct Path {
30 kind: PathKind, 30 kind: PathKind,
31 segments: Vec<SmolStr>, 31 segments: Vec<(LocalSyntaxPtr, SmolStr)>,
32} 32}
33 33
34#[derive(Debug, Clone, Copy)] 34#[derive(Debug, Clone, Copy)]
@@ -150,7 +150,8 @@ fn convert_path(prefix: Option<Path>, path: ast::Path) -> Option<Path> {
150 kind: PathKind::Abs, 150 kind: PathKind::Abs,
151 segments: Vec::with_capacity(1), 151 segments: Vec::with_capacity(1),
152 }); 152 });
153 res.segments.push(name.text()); 153 let ptr = LocalSyntaxPtr::new(name.syntax());
154 res.segments.push((ptr, name.text()));
154 res 155 res
155 } 156 }
156 ast::PathSegmentKind::CrateKw => { 157 ast::PathSegmentKind::CrateKw => {