From 7f92fd858ac41e441b814f0a94609b478301ab82 Mon Sep 17 00:00:00 2001 From: kjeremy Date: Mon, 4 Feb 2019 16:34:02 -0500 Subject: Move comment --- crates/ra_lsp_server/src/main_loop/handlers.rs | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'crates') diff --git a/crates/ra_lsp_server/src/main_loop/handlers.rs b/crates/ra_lsp_server/src/main_loop/handlers.rs index c25adb8b9..4720a8843 100644 --- a/crates/ra_lsp_server/src/main_loop/handlers.rs +++ b/crates/ra_lsp_server/src/main_loop/handlers.rs @@ -599,9 +599,6 @@ pub fn handle_code_action( let title = source_edit.label.clone(); let edit = source_edit.try_conv_with(&world)?; - // We cannot use the 'editor.action.showReferences' command directly - // because that command requires vscode types which we convert in the handler - // on the client side. let cmd = Command { title, command: "rust-analyzer.applySourceChange".to_string(), @@ -713,17 +710,21 @@ pub fn handle_code_lens_resolve(world: ServerWorld, code_lens: CodeLens) -> Resu format!("{} implementations", locations.len()) }; + // We cannot use the 'editor.action.showReferences' command directly + // because that command requires vscode types which we convert in the handler + // on the client side. + let cmd = Command { + title, + command: "rust-analyzer.showReferences".into(), + arguments: Some(vec![ + to_value(&Ser::new(&lens_params.text_document.uri)).unwrap(), + to_value(code_lens.range.start).unwrap(), + to_value(locations).unwrap(), + ]), + }; return Ok(CodeLens { range: code_lens.range, - command: Some(Command { - title, - command: "rust-analyzer.showReferences".into(), - arguments: Some(vec![ - to_value(&Ser::new(&lens_params.text_document.uri)).unwrap(), - to_value(code_lens.range.start).unwrap(), - to_value(locations).unwrap(), - ]), - }), + command: Some(cmd), data: None, }); } -- cgit v1.2.3