]> git.lizzy.rs Git - rust.git/commitdiff
remove more imports
authorAleksey Kladov <aleksey.kladov@gmail.com>
Wed, 19 Dec 2018 09:48:34 +0000 (12:48 +0300)
committerAleksey Kladov <aleksey.kladov@gmail.com>
Thu, 20 Dec 2018 09:15:38 +0000 (12:15 +0300)
crates/ra_lsp_server/src/path_map.rs
crates/ra_lsp_server/src/server_world.rs

index 02e54629c7d159f5e3d4fbc3c43a797d9e74a709..86cf29540e42f21d2588599c55181e2fbd6d0d0b 100644 (file)
@@ -4,7 +4,7 @@
 };
 
 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 @@ fn new_file_id(&mut self) -> FileId {
     }
 }
 
-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() {
index ab4c2c8aad639f2b44c7ef2801e8c472fd76cc73..c0d1338a25c0b30d8d5b6a6d8e0b20a911ea1bce 100644 (file)
@@ -6,7 +6,7 @@
 
 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};