From 6a755ed83a583d1f70a5fbcff2d4933b52628cfe Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Wed, 19 Dec 2018 12:48:34 +0300 Subject: remove more imports --- crates/ra_lsp_server/src/path_map.rs | 23 +---------------------- crates/ra_lsp_server/src/server_world.rs | 2 +- 2 files changed, 2 insertions(+), 23 deletions(-) (limited to 'crates') diff --git a/crates/ra_lsp_server/src/path_map.rs b/crates/ra_lsp_server/src/path_map.rs index 02e54629c..86cf29540 100644 --- a/crates/ra_lsp_server/src/path_map.rs +++ b/crates/ra_lsp_server/src/path_map.rs @@ -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 { - 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 { - 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() { diff --git a/crates/ra_lsp_server/src/server_world.rs b/crates/ra_lsp_server/src/server_world.rs index ab4c2c8aa..c0d1338a2 100644 --- a/crates/ra_lsp_server/src/server_world.rs +++ b/crates/ra_lsp_server/src/server_world.rs @@ -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}; -- cgit v1.2.3