diff options
Diffstat (limited to 'crates/ra_analysis/src/imp.rs')
-rw-r--r-- | crates/ra_analysis/src/imp.rs | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/crates/ra_analysis/src/imp.rs b/crates/ra_analysis/src/imp.rs index 0faf8b85d..ff13247de 100644 --- a/crates/ra_analysis/src/imp.rs +++ b/crates/ra_analysis/src/imp.rs | |||
@@ -100,27 +100,6 @@ impl db::RootDatabase { | |||
100 | } | 100 | } |
101 | 101 | ||
102 | impl db::RootDatabase { | 102 | impl db::RootDatabase { |
103 | pub(crate) fn module_path(&self, position: FilePosition) -> Cancelable<Option<String>> { | ||
104 | let descr = match source_binder::module_from_position(self, position)? { | ||
105 | None => return Ok(None), | ||
106 | Some(it) => it, | ||
107 | }; | ||
108 | let name = match descr.name() { | ||
109 | None => return Ok(None), | ||
110 | Some(it) => it.to_string(), | ||
111 | }; | ||
112 | |||
113 | let modules = descr.path_to_root(); | ||
114 | |||
115 | let path = modules | ||
116 | .iter() | ||
117 | .filter_map(|s| s.name()) | ||
118 | .skip(1) // name is already part of the string. | ||
119 | .fold(name, |path, it| format!("{}::{}", it, path)); | ||
120 | |||
121 | Ok(Some(path.to_string())) | ||
122 | } | ||
123 | |||
124 | /// This returns `Vec` because a module may be included from several places. We | 103 | /// This returns `Vec` because a module may be included from several places. We |
125 | /// don't handle this case yet though, so the Vec has length at most one. | 104 | /// don't handle this case yet though, so the Vec has length at most one. |
126 | pub(crate) fn parent_module( | 105 | pub(crate) fn parent_module( |