mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-12 21:28:51 +00:00
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 <kjeremy@gmail.com>
This commit is contained in:
commit
94d5d0d7e8
1 changed files with 13 additions and 12 deletions
|
@ -599,9 +599,6 @@ pub fn handle_code_action(
|
||||||
let title = source_edit.label.clone();
|
let title = source_edit.label.clone();
|
||||||
let edit = source_edit.try_conv_with(&world)?;
|
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 {
|
let cmd = Command {
|
||||||
title,
|
title,
|
||||||
command: "rust-analyzer.applySourceChange".to_string(),
|
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())
|
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 {
|
return Ok(CodeLens {
|
||||||
range: code_lens.range,
|
range: code_lens.range,
|
||||||
command: Some(Command {
|
command: Some(cmd),
|
||||||
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(),
|
|
||||||
]),
|
|
||||||
}),
|
|
||||||
data: None,
|
data: None,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue