aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_lsp_server/src/main_loop
diff options
context:
space:
mode:
authorbors[bot] <bors[bot]@users.noreply.github.com>2018-11-05 11:12:04 +0000
committerbors[bot] <bors[bot]@users.noreply.github.com>2018-11-05 11:12:04 +0000
commitde9bb9cfefb6d19958363f7d064aef6adbca9107 (patch)
tree7b332c6db6e662ca31aafded143476d81a60453f /crates/ra_lsp_server/src/main_loop
parent6502bd2c966d57bdb8fbba7f43da9ddd004d87d3 (diff)
parent6bbcfca7aec6408cf27415ae6f965adc472d6f18 (diff)
Merge #193
193: Inline modules r=matklad a=matklad Co-authored-by: Aleksey Kladov <[email protected]>
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);