diff options
Diffstat (limited to 'crates/ra_analysis/src/lib.rs')
-rw-r--r-- | crates/ra_analysis/src/lib.rs | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/crates/ra_analysis/src/lib.rs b/crates/ra_analysis/src/lib.rs index 61af676b2..ab935954c 100644 --- a/crates/ra_analysis/src/lib.rs +++ b/crates/ra_analysis/src/lib.rs | |||
@@ -237,11 +237,11 @@ pub struct NavigationTarget { | |||
237 | } | 237 | } |
238 | 238 | ||
239 | impl NavigationTarget { | 239 | impl NavigationTarget { |
240 | fn from_symbol(file_id: FileId, symbol: FileSymbol) -> NavigationTarget { | 240 | fn from_symbol(symbol: FileSymbol) -> NavigationTarget { |
241 | NavigationTarget { | 241 | NavigationTarget { |
242 | file_id: symbol.file_id, | ||
242 | name: symbol.name.clone(), | 243 | name: symbol.name.clone(), |
243 | kind: symbol.ptr.kind(), | 244 | kind: symbol.ptr.kind(), |
244 | file_id, | ||
245 | range: symbol.ptr.range(), | 245 | range: symbol.ptr.range(), |
246 | ptr: Some(symbol.ptr.clone()), | 246 | ptr: Some(symbol.ptr.clone()), |
247 | } | 247 | } |
@@ -278,11 +278,6 @@ impl ReferenceResolution { | |||
278 | resolves_to: Vec::new(), | 278 | resolves_to: Vec::new(), |
279 | } | 279 | } |
280 | } | 280 | } |
281 | |||
282 | fn add_resolution(&mut self, file_id: FileId, symbol: FileSymbol) { | ||
283 | self.resolves_to | ||
284 | .push(NavigationTarget::from_symbol(file_id, symbol)) | ||
285 | } | ||
286 | } | 281 | } |
287 | 282 | ||
288 | /// `AnalysisHost` stores the current state of the world. | 283 | /// `AnalysisHost` stores the current state of the world. |
@@ -380,7 +375,7 @@ impl Analysis { | |||
380 | pub fn symbol_search(&self, query: Query) -> Cancelable<Vec<NavigationTarget>> { | 375 | pub fn symbol_search(&self, query: Query) -> Cancelable<Vec<NavigationTarget>> { |
381 | let res = symbol_index::world_symbols(&*self.db, query)? | 376 | let res = symbol_index::world_symbols(&*self.db, query)? |
382 | .into_iter() | 377 | .into_iter() |
383 | .map(|(file_id, symbol)| NavigationTarget::from_symbol(file_id, symbol)) | 378 | .map(NavigationTarget::from_symbol) |
384 | .collect(); | 379 | .collect(); |
385 | Ok(res) | 380 | Ok(res) |
386 | } | 381 | } |