diff options
author | Aleksey Kladov <[email protected]> | 2019-01-02 13:53:40 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-01-02 13:53:40 +0000 |
commit | d25c89f7608cb15e8c5ae08a92b6a7a6d6f308b8 (patch) | |
tree | c0897017ca009f4b989ef70b27e3a0dc54ffe63c /crates/ra_lsp_server | |
parent | a4b4fd7dc50575d015b404532ec9dd13e0a01835 (diff) |
introduce navigation target
Diffstat (limited to 'crates/ra_lsp_server')
-rw-r--r-- | crates/ra_lsp_server/src/main_loop/handlers.rs | 10 |
1 files changed, 5 insertions, 5 deletions
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( | |||
213 | Some(it) => it, | 213 | Some(it) => it, |
214 | }; | 214 | }; |
215 | let mut res = Vec::new(); | 215 | let mut res = Vec::new(); |
216 | for (file_id, symbol) in rr.resolves_to { | 216 | for nav in rr.resolves_to { |
217 | let line_index = world.analysis().file_line_index(file_id); | 217 | let line_index = world.analysis().file_line_index(nav.file_id()); |
218 | let location = to_location(file_id, symbol.node_range, &world, &line_index)?; | 218 | let location = to_location(nav.file_id(), nav.range(), &world, &line_index)?; |
219 | res.push(location) | 219 | res.push(location) |
220 | } | 220 | } |
221 | Ok(Some(req::GotoDefinitionResponse::Array(res))) | 221 | Ok(Some(req::GotoDefinitionResponse::Array(res))) |
@@ -517,8 +517,8 @@ pub fn handle_hover( | |||
517 | Some(it) => it, | 517 | Some(it) => it, |
518 | }; | 518 | }; |
519 | let mut result = Vec::new(); | 519 | let mut result = Vec::new(); |
520 | for (file_id, symbol) in rr.resolves_to { | 520 | for nav in rr.resolves_to { |
521 | if let Some(docs) = world.analysis().doc_text_for(file_id, symbol)? { | 521 | if let Some(docs) = world.analysis().doc_text_for(nav)? { |
522 | result.push(docs); | 522 | result.push(docs); |
523 | } | 523 | } |
524 | } | 524 | } |