This commit is contained in:
Aleksey Kladov 2020-02-18 12:15:12 +01:00
parent 93b969003d
commit b6740060f6
2 changed files with 3 additions and 4 deletions

View file

@ -6,11 +6,9 @@ use ra_project_model::{self, ProjectWorkspace, TargetKind};
use crate::{world::WorldSnapshot, Result};
pub(crate) fn runnable_args(
world: &WorldSnapshot,
file_id: FileId,
spec: Option<CargoTargetSpec>,
kind: &RunnableKind,
) -> Result<Vec<String>> {
let spec = CargoTargetSpec::for_file(world, file_id)?;
let mut res = Vec::new();
match kind {
RunnableKind::Test { test_id } => {

View file

@ -921,7 +921,8 @@ fn to_lsp_runnable(
file_id: FileId,
runnable: Runnable,
) -> Result<req::Runnable> {
let args = runnable_args(world, file_id, &runnable.kind)?;
let spec: Option<CargoTargetSpec> = CargoTargetSpec::for_file(world, file_id)?;
let args = runnable_args(spec, &runnable.kind)?;
let line_index = world.analysis().file_line_index(file_id)?;
let label = match &runnable.kind {
RunnableKind::Test { test_id } => format!("test {}", test_id),