diff options
Diffstat (limited to 'crates/ra_lsp_server/src/main_loop')
-rw-r--r-- | crates/ra_lsp_server/src/main_loop/handlers.rs | 8 |
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 | ||
219 | pub fn handle_parent_module( | 219 | pub 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); |