mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-11 20:58:54 +00:00
remove relpath from input
This commit is contained in:
parent
cb6205c09d
commit
dea1a69e1c
2 changed files with 2 additions and 11 deletions
|
@ -5,8 +5,6 @@ use relative_path::RelativePathBuf;
|
||||||
use ra_syntax::SmolStr;
|
use ra_syntax::SmolStr;
|
||||||
use salsa;
|
use salsa;
|
||||||
|
|
||||||
use crate::file_resolver::FileResolverImp;
|
|
||||||
|
|
||||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
||||||
pub struct FileId(pub u32);
|
pub struct FileId(pub u32);
|
||||||
|
|
||||||
|
@ -123,7 +121,6 @@ pub struct SourceRootId(pub u32);
|
||||||
|
|
||||||
#[derive(Default, Clone, Debug, PartialEq, Eq)]
|
#[derive(Default, Clone, Debug, PartialEq, Eq)]
|
||||||
pub struct SourceRoot {
|
pub struct SourceRoot {
|
||||||
pub file_resolver: FileResolverImp,
|
|
||||||
pub files: FxHashSet<FileId>,
|
pub files: FxHashSet<FileId>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,7 @@
|
||||||
use std::sync::Arc;
|
|
||||||
|
|
||||||
use rustc_hash::FxHashSet;
|
use rustc_hash::FxHashSet;
|
||||||
use relative_path::{RelativePath, RelativePathBuf};
|
use relative_path::{RelativePath, RelativePathBuf};
|
||||||
|
|
||||||
use crate::{FileId, FileResolver, SourceRoot, FileResolverImp};
|
use crate::{FileId, FileResolver, SourceRoot};
|
||||||
|
|
||||||
#[derive(Default, Debug, Clone)]
|
#[derive(Default, Debug, Clone)]
|
||||||
pub struct FileMap(Vec<(FileId, RelativePathBuf)>);
|
pub struct FileMap(Vec<(FileId, RelativePathBuf)>);
|
||||||
|
@ -17,11 +15,7 @@ impl FileMap {
|
||||||
|
|
||||||
pub fn into_source_root(self) -> SourceRoot {
|
pub fn into_source_root(self) -> SourceRoot {
|
||||||
let files = self.files();
|
let files = self.files();
|
||||||
let file_resolver = FileResolverImp::new(Arc::new(self));
|
SourceRoot { files }
|
||||||
SourceRoot {
|
|
||||||
file_resolver,
|
|
||||||
files,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn files(&self) -> FxHashSet<FileId> {
|
pub fn files(&self) -> FxHashSet<FileId> {
|
||||||
|
|
Loading…
Reference in a new issue