aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_lsp_server/src/main_loop
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2018-11-05 11:10:20 +0000
committerAleksey Kladov <[email protected]>2018-11-05 11:10:20 +0000
commit6bbcfca7aec6408cf27415ae6f965adc472d6f18 (patch)
tree7b332c6db6e662ca31aafded143476d81a60453f /crates/ra_lsp_server/src/main_loop
parent44d891938493cc32efd2e44d81bc76cc3bc391c0 (diff)
Fully add inline modules to module tree
Diffstat (limited to 'crates/ra_lsp_server/src/main_loop')
-rw-r--r--crates/ra_lsp_server/src/main_loop/handlers.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/crates/ra_lsp_server/src/main_loop/handlers.rs b/crates/ra_lsp_server/src/main_loop/handlers.rs
index c853ff653..2219a0036 100644
--- a/crates/ra_lsp_server/src/main_loop/handlers.rs
+++ b/crates/ra_lsp_server/src/main_loop/handlers.rs
@@ -218,11 +218,13 @@ pub fn handle_goto_definition(
218 218
219pub fn handle_parent_module( 219pub fn handle_parent_module(
220 world: ServerWorld, 220 world: ServerWorld,
221 params: TextDocumentIdentifier, 221 params: req::TextDocumentPositionParams,
222) -> Result<Vec<Location>> { 222) -> Result<Vec<Location>> {
223 let file_id = params.try_conv_with(&world)?; 223 let file_id = params.text_document.try_conv_with(&world)?;
224 let line_index = world.analysis().file_line_index(file_id);
225 let offset = params.position.conv_with(&line_index);
224 let mut res = Vec::new(); 226 let mut res = Vec::new();
225 for (file_id, symbol) in world.analysis().parent_module(file_id)? { 227 for (file_id, symbol) in world.analysis().parent_module(file_id, offset)? {
226 let line_index = world.analysis().file_line_index(file_id); 228 let line_index = world.analysis().file_line_index(file_id);
227 let location = to_location(file_id, symbol.node_range, &world, &line_index)?; 229 let location = to_location(file_id, symbol.node_range, &world, &line_index)?;
228 res.push(location); 230 res.push(location);