aboutsummaryrefslogtreecommitdiff
path: root/crates/rust-analyzer/src/to_proto.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-03-13 13:50:35 +0000
committerGitHub <[email protected]>2021-03-13 13:50:35 +0000
commit7accf6bc37c059a83a58c82f463f02a02ed2226f (patch)
tree979c8ebe39bde9c989cb1a09f06cea4cf7cb04ac /crates/rust-analyzer/src/to_proto.rs
parent9674490b45a931399a9a05cd3a4c7e8fae9ec2a8 (diff)
parent49cdb2452a225dec3834e69fb011c3d7e68084f7 (diff)
Merge #7799
7799: Related tests r=matklad a=vsrs ![tests](https://user-images.githubusercontent.com/62505555/109397453-a9013680-7947-11eb-8b11-ac03079f7645.gif) This adds an ability to look for tests for the item under the cursor: function, constant, data type, etc The LSP part is bound to change. But the feature itself already works and I'm looking for a feedback :) Co-authored-by: vsrs <[email protected]>
Diffstat (limited to 'crates/rust-analyzer/src/to_proto.rs')
-rw-r--r--crates/rust-analyzer/src/to_proto.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/crates/rust-analyzer/src/to_proto.rs b/crates/rust-analyzer/src/to_proto.rs
index 1a8cdadad..9ca0915b9 100644
--- a/crates/rust-analyzer/src/to_proto.rs
+++ b/crates/rust-analyzer/src/to_proto.rs
@@ -838,11 +838,10 @@ pub(crate) fn resolved_code_action(
838 838
839pub(crate) fn runnable( 839pub(crate) fn runnable(
840 snap: &GlobalStateSnapshot, 840 snap: &GlobalStateSnapshot,
841 file_id: FileId,
842 runnable: Runnable, 841 runnable: Runnable,
843) -> Result<lsp_ext::Runnable> { 842) -> Result<lsp_ext::Runnable> {
844 let config = snap.config.runnables(); 843 let config = snap.config.runnables();
845 let spec = CargoTargetSpec::for_file(snap, file_id)?; 844 let spec = CargoTargetSpec::for_file(snap, runnable.nav.file_id)?;
846 let workspace_root = spec.as_ref().map(|it| it.workspace_root.clone()); 845 let workspace_root = spec.as_ref().map(|it| it.workspace_root.clone());
847 let target = spec.as_ref().map(|s| s.target.clone()); 846 let target = spec.as_ref().map(|s| s.target.clone());
848 let (cargo_args, executable_args) = 847 let (cargo_args, executable_args) =
@@ -875,7 +874,7 @@ pub(crate) fn code_lens(
875 let annotation_range = range(&line_index, annotation.range); 874 let annotation_range = range(&line_index, annotation.range);
876 875
877 let action = run.action(); 876 let action = run.action();
878 let r = runnable(&snap, run.nav.file_id, run)?; 877 let r = runnable(&snap, run)?;
879 878
880 let command = if debug { 879 let command = if debug {
881 command::debug_single(&r) 880 command::debug_single(&r)