diff options
Diffstat (limited to 'crates/ra_lsp_server/src/main_loop')
-rw-r--r-- | crates/ra_lsp_server/src/main_loop/handlers.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/crates/ra_lsp_server/src/main_loop/handlers.rs b/crates/ra_lsp_server/src/main_loop/handlers.rs index 783b0a827..0461bf385 100644 --- a/crates/ra_lsp_server/src/main_loop/handlers.rs +++ b/crates/ra_lsp_server/src/main_loop/handlers.rs | |||
@@ -50,7 +50,7 @@ pub fn handle_syntax_tree(world: WorldSnapshot, params: req::SyntaxTreeParams) - | |||
50 | pub fn handle_expand_macro( | 50 | pub fn handle_expand_macro( |
51 | world: WorldSnapshot, | 51 | world: WorldSnapshot, |
52 | params: req::ExpandMacroParams, | 52 | params: req::ExpandMacroParams, |
53 | ) -> Result<Option<(String, String)>> { | 53 | ) -> Result<Option<req::ExpandedMacro>> { |
54 | let _p = profile("handle_expand_macro"); | 54 | let _p = profile("handle_expand_macro"); |
55 | let file_id = params.text_document.try_conv_with(&world)?; | 55 | let file_id = params.text_document.try_conv_with(&world)?; |
56 | let line_index = world.analysis().file_line_index(file_id)?; | 56 | let line_index = world.analysis().file_line_index(file_id)?; |
@@ -58,7 +58,10 @@ pub fn handle_expand_macro( | |||
58 | 58 | ||
59 | match offset { | 59 | match offset { |
60 | None => Ok(None), | 60 | None => Ok(None), |
61 | Some(offset) => Ok(world.analysis().expand_macro(FilePosition { file_id, offset })?), | 61 | Some(offset) => { |
62 | let res = world.analysis().expand_macro(FilePosition { file_id, offset })?; | ||
63 | Ok(res.map(|it| req::ExpandedMacro { name: it.name, expansion: it.expansion })) | ||
64 | } | ||
62 | } | 65 | } |
63 | } | 66 | } |
64 | 67 | ||