Refactor
This commit is contained in:
parent
93b969003d
commit
b6740060f6
2 changed files with 3 additions and 4 deletions
|
@ -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 } => {
|
||||
|
|
|
@ -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),
|
||||
|
|
Loading…
Reference in a new issue