mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-07 17:18:32 +03:00
Also remap absolute source names in save-analysis
This commit is contained in:
@@ -37,11 +37,18 @@ pub fn new(sess: &'a Session) -> SpanUtils<'a> {
|
||||
|
||||
pub fn make_filename_string(&self, file: &SourceFile) -> String {
|
||||
match &file.name {
|
||||
FileName::Real(path) if !path.is_absolute() && !file.name_was_remapped => {
|
||||
self.sess.working_dir.0
|
||||
.join(&path)
|
||||
.display()
|
||||
.to_string()
|
||||
FileName::Real(path) if !file.name_was_remapped => {
|
||||
if path.is_absolute() {
|
||||
self.sess.source_map().path_mapping()
|
||||
.map_prefix(path.clone()).0
|
||||
.display()
|
||||
.to_string()
|
||||
} else {
|
||||
self.sess.working_dir.0
|
||||
.join(&path)
|
||||
.display()
|
||||
.to_string()
|
||||
}
|
||||
},
|
||||
// If the file name is already remapped, we assume the user
|
||||
// configured it the way they wanted to, so use that directly
|
||||
|
||||
Reference in New Issue
Block a user