From 4012da07fd22223660a21c65d54d10a9a632eda0 Mon Sep 17 00:00:00 2001 From: Edwin Cheng Date: Tue, 19 Nov 2019 22:56:48 +0800 Subject: Change return type of expand_macro --- crates/ra_lsp_server/src/main_loop/handlers.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'crates/ra_lsp_server/src/main_loop/handlers.rs') 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) - pub fn handle_expand_macro( world: WorldSnapshot, params: req::ExpandMacroParams, -) -> Result> { +) -> Result> { let _p = profile("handle_expand_macro"); let file_id = params.text_document.try_conv_with(&world)?; let line_index = world.analysis().file_line_index(file_id)?; @@ -58,7 +58,10 @@ pub fn handle_expand_macro( match offset { None => Ok(None), - Some(offset) => Ok(world.analysis().expand_macro(FilePosition { file_id, offset })?), + Some(offset) => { + let res = world.analysis().expand_macro(FilePosition { file_id, offset })?; + Ok(res.map(|it| req::ExpandedMacro { name: it.name, expansion: it.expansion })) + } } } -- cgit v1.2.3