mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-12 08:36:03 +00:00
remove more imports
This commit is contained in:
parent
79596abcaf
commit
6a755ed83a
@ -4,7 +4,7 @@ use std::{
|
||||
};
|
||||
|
||||
use im;
|
||||
use ra_analysis::{FileId, FileResolver};
|
||||
use ra_analysis::{FileId};
|
||||
use relative_path::RelativePath;
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||
@ -64,27 +64,6 @@ impl PathMap {
|
||||
}
|
||||
}
|
||||
|
||||
impl FileResolver for PathMap {
|
||||
fn file_stem(&self, file_id: FileId) -> String {
|
||||
self.get_path(file_id)
|
||||
.file_stem()
|
||||
.unwrap()
|
||||
.to_str()
|
||||
.unwrap()
|
||||
.to_string()
|
||||
}
|
||||
|
||||
fn resolve(&self, file_id: FileId, path: &RelativePath) -> Option<FileId> {
|
||||
let path = path.to_path(&self.get_path(file_id));
|
||||
let path = normalize(&path);
|
||||
self.get_id(&path)
|
||||
}
|
||||
|
||||
fn debug_path(&self, file_id: FileId) -> Option<PathBuf> {
|
||||
Some(self.get_path(file_id).to_owned())
|
||||
}
|
||||
}
|
||||
|
||||
fn normalize(path: &Path) -> PathBuf {
|
||||
let mut components = path.components().peekable();
|
||||
let mut ret = if let Some(c @ Component::Prefix(..)) = components.peek().cloned() {
|
||||
|
@ -6,7 +6,7 @@ use std::{
|
||||
|
||||
use languageserver_types::Url;
|
||||
use ra_analysis::{
|
||||
Analysis, AnalysisChange, AnalysisHost, CrateGraph, FileId, FileResolver, LibraryData,
|
||||
Analysis, AnalysisChange, AnalysisHost, CrateGraph, FileId, LibraryData,
|
||||
};
|
||||
use rustc_hash::FxHashMap;
|
||||
use failure::{bail, format_err};
|
||||
|
Loading…
Reference in New Issue
Block a user