Skip to content

Commit

Permalink
Add task names into labels
Browse files Browse the repository at this point in the history
  • Loading branch information
anilsenay committed May 21, 2024
1 parent ffff7cd commit 2cc7d94
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions crates/languages/src/go.rs
Original file line number Diff line number Diff line change
Expand Up @@ -450,20 +450,24 @@ impl ContextProvider for GoContextProvider {
fn associated_tasks(&self) -> Option<TaskTemplates> {
Some(TaskTemplates(vec![
TaskTemplate {
label: "Go Run Test Function".into(),
label: format!("test {}", VariableName::Symbol.template_value()),
command: "go".into(),
args: vec![
"test".into(),
GO_TEST_DIRECTORY_TASK_VARIABLE.template_value(),
"-v".into(),
"-run".into(),
format!("^{}$", VariableName::Symbol.template_value(),),
format!("^{}$", VariableName::Symbol.template_value()),
],
tags: vec!["go-test".to_owned()],
..TaskTemplate::default()
},
TaskTemplate {
label: "Go Run Subtest Function".into(),
label: format!(
"test {}/{}",
VariableName::Symbol.template_value(),
GO_SUBTEST_NAME_TASK_VARIABLE.template_value(),
),
command: "go".into(),
args: vec![
"test".into(),
Expand All @@ -480,21 +484,21 @@ impl ContextProvider for GoContextProvider {
..TaskTemplate::default()
},
TaskTemplate {
label: "Go Run Benchmark Function".into(),
label: format!("bench {}", VariableName::Symbol.template_value()),
command: "go".into(),
args: vec![
"test".into(),
GO_TEST_DIRECTORY_TASK_VARIABLE.template_value(),
"-benchmem".into(),
"-run=^$".into(),
"-bench".into(),
format!("^{}$", VariableName::Symbol.template_value(),),
format!("^{}$", VariableName::Symbol.template_value()),
],
tags: vec!["go-benchmark".to_owned()],
..TaskTemplate::default()
},
TaskTemplate {
label: "Go Run Main Function".into(),
label: format!("run {}", VariableName::Symbol.template_value()),
command: "go".into(),
args: vec!["run".into(), VariableName::File.template_value()],
tags: vec!["go-run".to_owned()],
Expand Down

0 comments on commit 2cc7d94

Please sign in to comment.