mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-03 07:04:49 +00:00
remember spans with paths
This commit is contained in:
parent
c54b51fded
commit
1cf92c3e28
1 changed files with 4 additions and 3 deletions
|
@ -3,7 +3,7 @@ use rustc_hash::FxHashMap;
|
||||||
|
|
||||||
use ra_syntax::{
|
use ra_syntax::{
|
||||||
SmolStr, SyntaxKind,
|
SmolStr, SyntaxKind,
|
||||||
ast::{self, NameOwner}
|
ast::{self, NameOwner, AstNode}
|
||||||
};
|
};
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
|
@ -28,7 +28,7 @@ struct InputModuleItems {
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
struct Path {
|
struct Path {
|
||||||
kind: PathKind,
|
kind: PathKind,
|
||||||
segments: Vec<SmolStr>,
|
segments: Vec<(LocalSyntaxPtr, SmolStr)>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, Copy)]
|
#[derive(Debug, Clone, Copy)]
|
||||||
|
@ -150,7 +150,8 @@ fn convert_path(prefix: Option<Path>, path: ast::Path) -> Option<Path> {
|
||||||
kind: PathKind::Abs,
|
kind: PathKind::Abs,
|
||||||
segments: Vec::with_capacity(1),
|
segments: Vec::with_capacity(1),
|
||||||
});
|
});
|
||||||
res.segments.push(name.text());
|
let ptr = LocalSyntaxPtr::new(name.syntax());
|
||||||
|
res.segments.push((ptr, name.text()));
|
||||||
res
|
res
|
||||||
}
|
}
|
||||||
ast::PathSegmentKind::CrateKw => {
|
ast::PathSegmentKind::CrateKw => {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue