Skip to content

Commit 94d5d0d

Browse files
bors[bot]kjeremy
andcommitted
Merge #743
743: Move comment r=matklad a=kjeremy As pointed out in https://github.com/rust-analyzer/rust-analyzer/pull/738/files#r253651450 Co-authored-by: kjeremy <[email protected]>
2 parents d914ac0 + 7f92fd8 commit 94d5d0d

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

crates/ra_lsp_server/src/main_loop/handlers.rs

+13-12
Original file line numberDiff line numberDiff line change
@@ -599,9 +599,6 @@ pub fn handle_code_action(
599599
let title = source_edit.label.clone();
600600
let edit = source_edit.try_conv_with(&world)?;
601601

602-
// We cannot use the 'editor.action.showReferences' command directly
603-
// because that command requires vscode types which we convert in the handler
604-
// on the client side.
605602
let cmd = Command {
606603
title,
607604
command: "rust-analyzer.applySourceChange".to_string(),
@@ -713,17 +710,21 @@ pub fn handle_code_lens_resolve(world: ServerWorld, code_lens: CodeLens) -> Resu
713710
format!("{} implementations", locations.len())
714711
};
715712

713+
// We cannot use the 'editor.action.showReferences' command directly
714+
// because that command requires vscode types which we convert in the handler
715+
// on the client side.
716+
let cmd = Command {
717+
title,
718+
command: "rust-analyzer.showReferences".into(),
719+
arguments: Some(vec![
720+
to_value(&Ser::new(&lens_params.text_document.uri)).unwrap(),
721+
to_value(code_lens.range.start).unwrap(),
722+
to_value(locations).unwrap(),
723+
]),
724+
};
716725
return Ok(CodeLens {
717726
range: code_lens.range,
718-
command: Some(Command {
719-
title,
720-
command: "rust-analyzer.showReferences".into(),
721-
arguments: Some(vec![
722-
to_value(&Ser::new(&lens_params.text_document.uri)).unwrap(),
723-
to_value(code_lens.range.start).unwrap(),
724-
to_value(locations).unwrap(),
725-
]),
726-
}),
727+
command: Some(cmd),
727728
data: None,
728729
});
729730
}

0 commit comments

Comments
 (0)