mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-14 02:49:40 +00:00
save-analysis: don't include the crate name in fully qualified paths
This commit is contained in:
parent
265a23320d
commit
127c253d40
@ -44,7 +44,7 @@ use syntax::codemap::*;
|
||||
use syntax::parse::token::{self, get_ident, keywords};
|
||||
use syntax::owned_slice::OwnedSlice;
|
||||
use syntax::visit::{self, Visitor};
|
||||
use syntax::print::pprust::{path_to_string,ty_to_string};
|
||||
use syntax::print::pprust::{path_to_string, ty_to_string};
|
||||
use syntax::ptr::P;
|
||||
|
||||
use self::span_utils::SpanUtils;
|
||||
@ -123,7 +123,6 @@ impl <'l, 'tcx> DxrVisitor<'l, 'tcx> {
|
||||
|
||||
let mut result: Vec<(Span, String)> = vec!();
|
||||
|
||||
|
||||
let mut segs = vec!();
|
||||
for (seg, span) in path.segments.iter().zip(spans.iter()) {
|
||||
segs.push(seg.clone());
|
||||
@ -1568,8 +1567,7 @@ pub fn process_crate(sess: &Session,
|
||||
SpanUtils {
|
||||
sess: sess,
|
||||
err_count: Cell::new(0)
|
||||
},
|
||||
cratename.clone()),
|
||||
}),
|
||||
span: SpanUtils {
|
||||
sess: sess,
|
||||
err_count: Cell::new(0)
|
||||
|
@ -50,7 +50,6 @@ impl Recorder {
|
||||
pub struct FmtStrs<'a> {
|
||||
pub recorder: Box<Recorder>,
|
||||
span: SpanUtils<'a>,
|
||||
krate: String,
|
||||
}
|
||||
|
||||
macro_rules! s { ($e:expr) => { format!("{}", $e) }}
|
||||
@ -92,11 +91,10 @@ pub enum Row {
|
||||
}
|
||||
|
||||
impl<'a> FmtStrs<'a> {
|
||||
pub fn new(rec: Box<Recorder>, span: SpanUtils<'a>, krate: String) -> FmtStrs<'a> {
|
||||
pub fn new(rec: Box<Recorder>, span: SpanUtils<'a>) -> FmtStrs<'a> {
|
||||
FmtStrs {
|
||||
recorder: rec,
|
||||
span: span,
|
||||
krate: krate,
|
||||
}
|
||||
}
|
||||
|
||||
@ -177,16 +175,7 @@ impl<'a> FmtStrs<'a> {
|
||||
});
|
||||
|
||||
let pairs = fields.iter().zip(values);
|
||||
let strs = pairs.map(|(f, v)| format!(",{},\"{}\"", f, escape(
|
||||
if *f == "qualname" && v.len() > 0 {
|
||||
let mut n = self.krate.clone();
|
||||
n.push_str("::");
|
||||
n.push_str(v);
|
||||
n
|
||||
} else {
|
||||
String::from_str(v)
|
||||
}
|
||||
)));
|
||||
let strs = pairs.map(|(f, v)| format!(",{},\"{}\"", f, escape(String::from_str(v))));
|
||||
Some(strs.fold(String::new(), |mut s, ss| {
|
||||
s.push_str(&ss[]);
|
||||
s
|
||||
|
Loading…
Reference in New Issue
Block a user