stevearc / overseer.nvim

A task runner and job management plugin for Neovim

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

bug: "run_after" in gui doesn't find task

alexdalat opened this issue · comments

commented

Neovim version (nvim -v)

0.9.5

Operating system/version

MacOS 13.3

Describe the bug

I'm working on a c++ project with make and I love the task setup where all the make targets are listed for me. However, I'd like to execute my test file after it is built by make. I could make a template specific for this but I have a few make targets to do this for (I know there are better testing frameworks to use but it's for school). To me, this seems like a perfect situation to make use of "after_run" but every time I try to use it, it states the task I input isn't found (as shown below).
I have tried almost every combination I can think of for "after_run", including putting the task as {cmd="..."}, putting it in a list, etc.
I am new to overseer so I apologize if I am misunderstanding something. Thank you for all the hard work put towards this plugin.
image
image
(the task disappeared automatically for the screenshot but it existed when I ran it)

What is the severity of this bug?

minor (annoyance)

Steps To Reproduce

  1. install overseer
  2. use minimal config:
require('overseer').setup({
    templates = { "builtin" },
    task_list = {
        width = 25,
        min_width = { 25 },
        max_width = { 50 },
        bindings = {
            ["<C-l>"] = false,
            ["<C-h>"] = false,
        }
    }
})
  1. run "make target" task
  2. create and run "executable" task
  3. set watch file for "make target" on source code
  4. add "executable" task under "run_after" task_names in "make target" task
  5. task not found

Expected Behavior

I expect the "executable" task to be found by name and run on successful completion of "make target" task.

Minimal example file

No response

Minimal init.lua

No response

Additional context

No response

If you're passing in the configuration for run_after via the API (e.g. overseer.run_template), then you would specify task_names as a table like {"Exec Stats"}. But if you're editing the components directly using the floating window task editor, the field is a comma-delimited list. Meaning you should enter it directly as task_names: Exec Stats.

commented

Ah okay, got it. Thank you for the swift response. However, I just tried it as "task_names: Exec stats" and it still doesn't find the task:
image
I tried it with quotation marks as well.

Oh, I think maybe there is a misunderstanding of how it's going to launch this task. When the current task completes, run_after will attempt to launch a new task with the name "Exec stats". It will do this via the overseer.run_template API, which is effectively the same as :OverseerRun. It will not look for existing tasks that have already been run and restart them. For this to work, you will need to create a new task template definition with the name "Exec stats" so that it shows up in :OverseerRun.

Alternatively, you could write your own component that will do what you want: link to an existing task that has finished running.

Did I understand the situation correctly this time?

commented

Got it, that makes sense. I appreciate the help. I'll probably make a "restart_after" component. Thanks again!