From 1cf92c3e286232be7e0d1370b88547ca0cb6f636 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 20 Nov 2018 21:17:14 +0300 Subject: remember spans with paths --- crates/ra_analysis/src/descriptors/module/nameres.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'crates/ra_analysis/src/descriptors') 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; use ra_syntax::{ SmolStr, SyntaxKind, - ast::{self, NameOwner} + ast::{self, NameOwner, AstNode} }; use crate::{ @@ -28,7 +28,7 @@ struct InputModuleItems { #[derive(Debug, Clone)] struct Path { kind: PathKind, - segments: Vec, + segments: Vec<(LocalSyntaxPtr, SmolStr)>, } #[derive(Debug, Clone, Copy)] @@ -150,7 +150,8 @@ fn convert_path(prefix: Option, path: ast::Path) -> Option { kind: PathKind::Abs, segments: Vec::with_capacity(1), }); - res.segments.push(name.text()); + let ptr = LocalSyntaxPtr::new(name.syntax()); + res.segments.push((ptr, name.text())); res } ast::PathSegmentKind::CrateKw => { -- cgit v1.2.3