From d25c89f7608cb15e8c5ae08a92b6a7a6d6f308b8 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Wed, 2 Jan 2019 16:53:40 +0300 Subject: introduce navigation target --- crates/ra_lsp_server/src/main_loop/handlers.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'crates/ra_lsp_server') diff --git a/crates/ra_lsp_server/src/main_loop/handlers.rs b/crates/ra_lsp_server/src/main_loop/handlers.rs index 11825d74e..5ff6219f9 100644 --- a/crates/ra_lsp_server/src/main_loop/handlers.rs +++ b/crates/ra_lsp_server/src/main_loop/handlers.rs @@ -213,9 +213,9 @@ pub fn handle_goto_definition( Some(it) => it, }; let mut res = Vec::new(); - for (file_id, symbol) in rr.resolves_to { - let line_index = world.analysis().file_line_index(file_id); - let location = to_location(file_id, symbol.node_range, &world, &line_index)?; + for nav in rr.resolves_to { + let line_index = world.analysis().file_line_index(nav.file_id()); + let location = to_location(nav.file_id(), nav.range(), &world, &line_index)?; res.push(location) } Ok(Some(req::GotoDefinitionResponse::Array(res))) @@ -517,8 +517,8 @@ pub fn handle_hover( Some(it) => it, }; let mut result = Vec::new(); - for (file_id, symbol) in rr.resolves_to { - if let Some(docs) = world.analysis().doc_text_for(file_id, symbol)? { + for nav in rr.resolves_to { + if let Some(docs) = world.analysis().doc_text_for(nav)? { result.push(docs); } } -- cgit v1.2.3