diff options
author | Aleksey Kladov <[email protected]> | 2018-12-19 09:48:34 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2018-12-20 09:15:38 +0000 |
commit | 6a755ed83a583d1f70a5fbcff2d4933b52628cfe (patch) | |
tree | 2880222c172a15739afc4a69764de4d233165ff4 /crates | |
parent | 79596abcaf50019810f7fa01a264100472359f8a (diff) |
remove more imports
Diffstat (limited to 'crates')
-rw-r--r-- | crates/ra_lsp_server/src/path_map.rs | 23 | ||||
-rw-r--r-- | crates/ra_lsp_server/src/server_world.rs | 2 |
2 files changed, 2 insertions, 23 deletions
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::{ | |||
4 | }; | 4 | }; |
5 | 5 | ||
6 | use im; | 6 | use im; |
7 | use ra_analysis::{FileId, FileResolver}; | 7 | use ra_analysis::{FileId}; |
8 | use relative_path::RelativePath; | 8 | use relative_path::RelativePath; |
9 | 9 | ||
10 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] | 10 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] |
@@ -64,27 +64,6 @@ impl PathMap { | |||
64 | } | 64 | } |
65 | } | 65 | } |
66 | 66 | ||
67 | impl FileResolver for PathMap { | ||
68 | fn file_stem(&self, file_id: FileId) -> String { | ||
69 | self.get_path(file_id) | ||
70 | .file_stem() | ||
71 | .unwrap() | ||
72 | .to_str() | ||
73 | .unwrap() | ||
74 | .to_string() | ||
75 | } | ||
76 | |||
77 | fn resolve(&self, file_id: FileId, path: &RelativePath) -> Option<FileId> { | ||
78 | let path = path.to_path(&self.get_path(file_id)); | ||
79 | let path = normalize(&path); | ||
80 | self.get_id(&path) | ||
81 | } | ||
82 | |||
83 | fn debug_path(&self, file_id: FileId) -> Option<PathBuf> { | ||
84 | Some(self.get_path(file_id).to_owned()) | ||
85 | } | ||
86 | } | ||
87 | |||
88 | fn normalize(path: &Path) -> PathBuf { | 67 | fn normalize(path: &Path) -> PathBuf { |
89 | let mut components = path.components().peekable(); | 68 | let mut components = path.components().peekable(); |
90 | let mut ret = if let Some(c @ Component::Prefix(..)) = components.peek().cloned() { | 69 | 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::{ | |||
6 | 6 | ||
7 | use languageserver_types::Url; | 7 | use languageserver_types::Url; |
8 | use ra_analysis::{ | 8 | use ra_analysis::{ |
9 | Analysis, AnalysisChange, AnalysisHost, CrateGraph, FileId, FileResolver, LibraryData, | 9 | Analysis, AnalysisChange, AnalysisHost, CrateGraph, FileId, LibraryData, |
10 | }; | 10 | }; |
11 | use rustc_hash::FxHashMap; | 11 | use rustc_hash::FxHashMap; |
12 | use failure::{bail, format_err}; | 12 | use failure::{bail, format_err}; |