diff options
author | Edwin Cheng <[email protected]> | 2019-11-19 14:56:48 +0000 |
---|---|---|
committer | Edwin Cheng <[email protected]> | 2019-11-19 14:56:48 +0000 |
commit | 4012da07fd22223660a21c65d54d10a9a632eda0 (patch) | |
tree | 1081edcfc24b16ba0d0433d40e499458039aa5f3 /crates/ra_lsp_server/src/main_loop | |
parent | 94c63d280246971983cad4fa6ce2d333e3ba9f02 (diff) |
Change return type of expand_macro
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 | ||