diff options
author | Aleksey Kladov <[email protected]> | 2018-11-05 11:10:20 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2018-11-05 11:10:20 +0000 |
commit | 6bbcfca7aec6408cf27415ae6f965adc472d6f18 (patch) | |
tree | 7b332c6db6e662ca31aafded143476d81a60453f /crates/ra_lsp_server | |
parent | 44d891938493cc32efd2e44d81bc76cc3bc391c0 (diff) |
Fully add inline modules to module tree
Diffstat (limited to 'crates/ra_lsp_server')
-rw-r--r-- | crates/ra_lsp_server/src/main_loop/handlers.rs | 8 | ||||
-rw-r--r-- | crates/ra_lsp_server/src/req.rs | 2 |
2 files changed, 6 insertions, 4 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); |
diff --git a/crates/ra_lsp_server/src/req.rs b/crates/ra_lsp_server/src/req.rs index 9d911912d..fcb7e94e1 100644 --- a/crates/ra_lsp_server/src/req.rs +++ b/crates/ra_lsp_server/src/req.rs | |||
@@ -93,7 +93,7 @@ pub struct Decoration { | |||
93 | pub enum ParentModule {} | 93 | pub enum ParentModule {} |
94 | 94 | ||
95 | impl Request for ParentModule { | 95 | impl Request for ParentModule { |
96 | type Params = TextDocumentIdentifier; | 96 | type Params = TextDocumentPositionParams; |
97 | type Result = Vec<Location>; | 97 | type Result = Vec<Location>; |
98 | const METHOD: &'static str = "m/parentModule"; | 98 | const METHOD: &'static str = "m/parentModule"; |
99 | } | 99 | } |