Skip to content

Commit

Permalink
tasks: list examples as runnable executables
Browse files Browse the repository at this point in the history
The list of runnable executables excludes not installed executables
to filter out tests, but this also filters out other executables like
examples. Instead, cross-chech with the tests array to remove only tests
  • Loading branch information
ylatuya authored and tristan957 committed Sep 28, 2023
1 parent 5ddca80 commit 6212905
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

- Add syntax highlight for `meson.options` files.
- Fix listing tests in the Test Explorer on activation
- Add support to run executables that are not installed (eg: examples)

## 1.10.0

Expand Down
10 changes: 6 additions & 4 deletions src/tasks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,12 @@ export async function getMesonTasks(buildDir: string) {
"$meson-gcc",
);
buildTask.group = vscode.TaskGroup.Build;
// FIXME: We should only include executable installed in bindir,
// but install_dir is missing from intro data.
if (t.type == "executable" && t.installed) {
return [buildTask, createRunTask(t, targetName)];
if (t.type == "executable") {
// Create run tasks for executables that are not tests,
// both installed and uninstalled (eg: examples)
if (!tests.some((test) => test.name === t.name)) {
return [buildTask, createRunTask(t, targetName)];
}
}
return buildTask;
}),
Expand Down

0 comments on commit 6212905

Please sign in to comment.