Git Product home page Git Product logo

overseer.nvim's Introduction

overseer.nvim

A task runner and job management plugin for Neovim

Features

  • Built-in support for many task frameworks (make, npm, cargo, .vscode/tasks.json, etc)
  • Simple integration with vim.diagnostics and quickfix
  • UI for viewing and managing tasks
  • Quick controls for common actions (restart task, rerun on save, or user-defined functions)
  • Extreme customizability. Very easy to attach custom logic to tasks
  • Define and run complex multi-stage workflows
  • Support for preLaunchTask when used with nvim-dap

Requirements

Installation

overseer supports all the usual plugin managers

lazy.nvim
{
  'stevearc/overseer.nvim',
  opts = {},
}
Packer
require('packer').startup(function()
    use {
      'stevearc/overseer.nvim',
      config = function() require('overseer').setup() end
    }
end)
Paq
require "paq" {
    {'stevearc/overseer.nvim'};
}
vim-plug
Plug 'stevearc/overseer.nvim'
dein
call dein#add('stevearc/overseer.nvim')
Pathogen
git clone --depth=1 https://github.com/stevearc/overseer.nvim.git ~/.vim/bundle/
Neovim native package
git clone --depth=1 https://github.com/stevearc/overseer.nvim.git \
  "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/pack/overseer/start/overseer.nvim

Quick start

Add the following to your init.lua

require('overseer').setup()

To get started, all you need to know is :OverseerRun to select and start a task, and :OverseerToggle to open the task list.

demo.mp4

If you don't see any tasks from :OverseerRun, it might mean that your task runner is not yet supported. There is currently support for VS Code tasks, make, npm, cargo, and some others. If yours is not supported, (request support here).

If you want to define custom tasks for your project, I'd recommend starting with the tutorials.

Tutorials

Guides

Explanation

Third-party integrations

Recipes

Reference

Screenshots

2022-07-23.12-42-37.mp4

overseer.nvim's People

Contributors

agorgl avatar baahrens avatar chrisvander avatar dzfrias avatar eaglesemanation avatar emmanueltouzery avatar github-actions[bot] avatar hori-ryota avatar jedrzejboczar avatar jpetrie avatar kaiuri avatar laxtiz avatar laytan avatar leeziao avatar lnc3l0t avatar loqusion avatar luan avatar luceurre avatar mariasolos avatar melmass avatar musjj avatar nazo6 avatar nyngwang avatar ollbx avatar pianocomposer321 avatar riddlew avatar stevearc avatar tissieres avatar willem-j-an avatar willothy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

overseer.nvim's Issues

Disable parsing specific files

Hello,

I see that overseer by default parses Makefile, .vscode file etc..

Is there a way I can disable parsing of any of these files?
I am working on a massive codebase whose makefile is 55MB, and trying to do anything with overseer just freezes the editor. (dont know for how long, I start froce-exiting after a 5+ minutes). removing that Makefile works just fine.

Also, thank you for this incredible plugin. It has transformed my workflow in the last few months

tasks.json input does not prompt when default is set

I have a task in .vscode/tasks.json that uses an input variable. When the input variable does not have a default value set, it works as expected and prompts for a value. However, if I add a default value to the input variable, it does not prompt at all but instead runs the task using the default value.

I would expect that it should prompt you to override the default input before running the task instead of immediately executing with the default value.

{
  "version": "0.0.1",
  "tasks": [
    {
      "label": "Task",
      "type": "shell",
      "command": "echo \"${myVariable}\""
    }
  ],
  "inputs": [
    {
      "id": "myVariable",
      "type": "promptString",
      "description": "A value to echo",
      // Without this, it prompts. With this, it skips the prompt and immediately uses "default_value"
      "default": "default_value",
    }
  ]
}

Recipes for creating basic tasks for compiling and testing.

First of all, I think this is a great project. Thank you!

The documentation is missing recipes on how to create basic tasks for compile and tests. For instance, I would like to create a task to compile the cpp file in the current buffer. Does the function passed to the builder param of the template table is run in the current buffer? Can I get the name of the file in the current buffer using expand("%")? How can I get the variables that are available in vscode tasks?

A few recipes would be nice. I see that I could use vscode tasks for this, but I would like to do it in Lua.

i get no default tasks

i installed the plugin with packer, set it up in my init.lua as it says, but still there are no default tasks (VSCode tasks)

Better conditional callback for cargo builtins

Currently, the template generator checks for a Cargo.toml in the current directory. This doesn't allow the user to dispatch cargo commands when editing files in directories like src/. This could be pretty easily implemented with a vim.fn.findfile(), or it could have a more robust implementation. I'd be happy to work on a PR for this!

No way to do per-project configuration of templates

Is this expected behavior?
In session-managers section you mention loading bundle on session load. But the plugin runs a task once I open a session.
I was thinking of using this functionality to save the changes that I made to the tasks (for example, added additional arguments). Am I misusing this feature? If yes, what can I do to provide a project-specific flags?
Or should I use something like https://github.com/windwp/nvim-projectconfig? It's not very convenient since I have to edit my config to adjust tasks.

customizable timeout for template initialization?

Hello, following the elixir mix PR, I noticed that the elixir tasks are not always displayed. I tracked it down to the one overseer setting which is not configurable :D that is, the template init timeout:
https://github.com/stevearc/overseer.nvim/blob/master/lua/overseer/template/init.lua#L395

Sadly, mix help takes most of the time for me 0.7s, but it does go over 1s quite often... If we changed the code to take an override timeout through opts, I could call the overseer functions manually, passing a custom timeout, instead of calling the provided vim command. I could send a PR to that effect, but would you accept it? Or can you think of a better approach...

In the PR you mentioned possible future caching for these settings, but cache invalidation would not be trivial, because in elixir you can add tasks outside of the main exs file, and the timestamp of that file would not be updated. So I guess in my case increasing the timeout is probably the best I can do, bar manual cache invalidation (which actually would be ok in my case, i guess).

What do you think about that?

Custom errorformat for cargo template

Sending output from Cargo to quickfix results in wrongly matched errors.
Here is how is how errorformat should look for it.
Could we have a custom errorformat for templates or actions from them? If yes, could we override it for cargo template?

[Bug] Error running config at `PackerSync` and at first `overseer.nvim` command execution

nvim version:

NVIM v0.8.0-1210-gd367ed9b2
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
Compilato da runneradmin@fv-az177-603

overseer.nvim setup:

{
  "stevearc/overseer.nvim",
  config = function()
    require("overseer").setup()
  end,
},

When running PackerSync command with the config above, thus during the generation of packer_compiled.lua file, Neovim returns:

packer.nvim: Error running config for overseer.nvim: ...acker\start\overseer.nvim/lua\overseer\template\init.lua:170: name: expected string, got nil

During a subsequent Neovim startup no error is reported, though. But If I try to run any of the overseer.nvim commands, the same error is reported:

Error executing Lua callback: ...acker\start\overseer.nvim/lua\overseer\template\init.lua:170: name: expected string, got nil
stack traceback:
	[C]: in function 'error'
	vim/shared.lua:699: in function 'validate'
	...acker\start\overseer.nvim/lua\overseer\template\init.lua:170: in function 'validate_template_provider'
	...acker\start\overseer.nvim/lua\overseer\template\init.lua:290: in function <...acker\start\overseer.nvim/lua\overseer\template\init.lua:288>
	...te\pack\packer\start\overseer.nvim/lua\overseer\init.lua:104: in function 'cb'
	...te\pack\packer\start\overseer.nvim/lua\overseer\init.lua:79: in function 'do_setup'
	...te\pack\packer\start\overseer.nvim/lua\overseer\init.lua:88: in function <...te\pack\packer\start\overseer.nvim/lua\overseer\init.lua:87>

But when I try to run any of the overseer.nvim commands again, no error is reported.

Tested with latest overseer.nvim commit:

83d5bc0

Tested on Windows 10 Pro.

Open Overseer when a task is started

It's more a question about API. I would like to create a shortcut to run a template. And I would like to open Overseer after selecting a task to see the task progress. I currently use the following:

vim.keymap.set('n', '<A-t>', function()
  overseer.open({ enter = false })
  overseer.run_template()
end, { noremap = true })

But is it possible to open Overseer only after selection?

Incorrect paths in quickfix using on_output_quickfix

    I'm doing a follow-up here because it's related with the above (I can open a new issue if you want). 

So things mostly work great after your pointers but I'm having an issue such that if my current working directory (/home/pedro/Desktop) is not that of the file I'm currently editing (/home/pedro/Desktop/test-latex) then when the quickfix opens and I jump to an error I'm taken to a new empty file (see GIF below). If I make the current file directory the working directory then jumping works as expected (since now the quickfix correctly parses the .tex file location). So my question is: how can I set the "quickfix working directory" to that of the current file?

overseer_pwd

Originally posted by @petobens in #45 (comment)

Possible bug: Action not performed if task has dependency component added via run_template()

Suppose the following setup: two tasks templates (task1 & task2) and two run_template functions, where in one task2 is added as dependency from task1 and the second just runs task1.

My intuition would be that both run1 and run2 will open the task terminal for task1 in a split, but in actuality only run2 does.

Is this a bug or for some reason intended?

local _, overseer = pcall(require, "overseer")

overseer.register_template({
  name = "task1",
  builder = function(params)
    return {
      cmd = {
        "echo",
        "task1",
      },
    }
  end,
})

overseer.register_template({
  name = "task2",
  builder = function(params)
    return {
      cmd = {
        "echo",
        "task2",
      },
    }
  end,
})

local run1 = function()
  overseer.run_template({ name = "task1", autostart = false }, function(task)
    if task then
      task:add_component({
        "dependencies",
        task_names = {
          "task2",
        },
        sequential = true,
      })
      task:start()
      overseer.run_action(task, "open hsplit")
    end
  end)
end

local run2 = function()
  overseer.run_template({ name = "task1", autostart = false }, function(task)
    if task then
      task:start()
      overseer.run_action(task, "open hsplit")
    end
  end)
end

Possible to get failure notifications for watch tasks that don't exit?

First: Thanks for this great plugin!

I'd like to know if it is possible to trigger error notifications for watch tasks like tsc --watch that won't exit if there is an error case (as reflected in the logs/output).

For scripts that return with an error/success status, everything works as expected.
Unfortunately, I could not find anything regarding this in the documentation.

For the tsc-case, just running tsc without --watch would not be an option as it has worse performance characteristics.

Thank you.

Error executing vim.schedule lua callback: ...seer.nvim/lua/overseer/component/on_output_summarize.lua:8

Hi, like in the title, I get this error message after a task is finished:

Error executing vim.schedule lua callback: ...seer.nvim/lua/overseer/component/on_output_summarize.lua:8: Invalid buffer id: 245
stack traceback:
        [C]: in function 'nvim_buf_line_count'
        ...seer.nvim/lua/overseer/component/on_output_summarize.lua:8: in function 'get_last_lines'
        ...seer.nvim/lua/overseer/component/on_output_summarize.lua:42: in function ''
        vim/_editor.lua: in function <vim/_editor.lua:0>

It happens when a task is finished, and I have a float (but also vertical and horizontal) terminal is open. The same happens if I do Ctrl+C to stop the task. I'm using NvChad.

Not related: when a task is completed I cannot see vim.notify popup. I have the plugin nvim-notify,

Automatic task startup with session management

I currently use the rmagatti/auto-session plugin for managing sessions in vim. Basically it just autosaves and restores sessions based on PWD. It's really useful to be able to quickly get back to where I left off in a project.

It would be super nice to have something like this in overseer, but for currently running tasks. For example:

  1. Open nvim in a project dir
  2. Start a long running project task (e.g. npm start)
  3. Reopen nvim
  4. Tasks starts again because it was running when nvim closed
  5. Stop task
  6. Reopen nvim
  7. Task is not running

Add support for just

Just is a nice general-purpose task runner. Since Overseer supports makefiles it would be great to support just too.

mix and task parameters

I noticed now that although overseer now correctly detects elixir mix tasks, i doesn't know which of these may require parameters.
Sadly it seems that's just metadata that mix doesn't advertise...

For instance:
https://github.com/elixir-ecto/ecto_sql/blob/v3.9.1/lib/mix/tasks/ecto.gen.migration.ex#L91

There is some metadata (not all of which may be accessible through the command-line), but the fact that a command-line parameter is required is not advertised anywhere, instead we get a failure with a human-readable, not computer-readable error message.

There are multiple solutions here I guess:

  1. not register the mix tasks automatically but manually, where the user has complete control
  2. allow the user to "patch" tasks -- with some configuration for overseer maybe, eg mix task name->parameter list for that task
  3. ugly workaround

Thinking about 2, I was looking at the overseer.wrap_template() call in mix.lua in the overseer repo. If there we added some params=... where we would for instance call some optional function that the user could provide, this could work, possibly.
But for now I don't really understand overseer params..
I tried to edit the mix.lua like that:

            overseer.wrap_template(
              tmpl,
              {
                name = string.format("mix %s", task_name),
                params = {
                  my_var = {
                    type = "string",
                    name = "More readable name",
                    desc = "A detailed description",
                    optional = false,
                  },
                  myvar2 = {
                    type = "string",
                    name = "More readable name",
                    desc = "A detailed description",
                    optional = false,
                  } }
                },
              { args = { task_name } }
            )

But nothing changed in the behavior, OverseerRun doesn't ask me to enter the parameters, so I'm obviously doing something wrong.

Another option is a horrible hack :) which is what I have now :)

    -- add other tasks here
    mix_params = {{"ecto.gen.migration", "Enter migration name: "}}

    require('overseer').add_template_hook({name="mix"}, function(task_defn, util)
      for idx, km in ipairs(mix_params) do
        if task_defn.cmd[2] == km[1] then
          task_defn.args = {vim.fn.input(km[2])}
        end
      end
    end)

actually i would be happy if i could using vim.ui.input in there, which looks nicer than vim.fn.input, but due to the async, I couldn't make it work. But it's clear to me that this approach is a non-starter for you.

Do you think something could be done for this use case in overseer? and it's very clear to me that the flaw is in mix, not in overseer. And approach 1 may just be the correct one.

Clarification on template parameters

Hey, want to lead off by saying this is a very impressive plugin!

And I apologize, this is less of an issue and more of a question, as im having difficulties understanding how to manage parameters.

What i am trying to do is make a go run template, and that template can optionally accept arguments, ie go run main.go -f my-flag, or just go run main.go.

However, if i mark the parameter as optional, the input box doesnt show up. If I mark the parameter as required, i cant run the program with no argmuents (go run main.go), the input box flashed red when i attempt to leave it empty.

I also noticed that the shell command has optional params as well, but they dont show up when running the shell template. Overall I am confused by how to utilize these optional params.

Thanks for any input, and the extensive and well designed plugin!

How do max_width and min_width of a window work ?

I wanted to set width with a default value so I won't have to press '[' to adjust the width of task_list every time.
Then I try to set max_width and min_width of task_list, I found if I set min_width to some value small enough like {10, 0,1}, I open the task_list, its width is the value of max_width.
This confuses me a lit bit, because in the beginning I thought min_width and max_width were used to limit the width when pressing '[' or ']'.
So may I ask which value would be adopted when I just 'OverseerOpen'? Or what is the best way to define a default width for the window like task_list?

sugg: watch off

The watch feature is very useful, but sometimes, we want to stop it from menu

image

could you add watch off in the menu

TO BE

image

[Bug] `cwd` doesn't accept a function as value

When configuring the builder such as:

local util = require("lspconfig.util")

oversee.register_template({
  builder = function()
    cwd = util.root_pattern "hdl-prj.json" or util.root_pattern ".git" or util.path.dirname,
  end,
})

then overseer returns an error when trying to run the associated task:

Error executing vim.schedule lua callback: ...te\pack\packer\start\overseer.nvim/lua\overseer\task.lua:61: cwd: expected string, got function
stack traceback:
	[C]: in function 'error'
	vim/shared.lua:699: in function 'validate'
	...te\pack\packer\start\overseer.nvim/lua\overseer\task.lua:61: in function 'new_uninitialized'
	...te\pack\packer\start\overseer.nvim/lua\overseer\task.lua:124: in function 'new'
	...acker\start\overseer.nvim/lua\overseer\template\init.lua:251: in function 'build_task'
	...acker\start\overseer.nvim/lua\overseer\template\init.lua:365: in function 'build'
	...ack\packer\start\overseer.nvim/lua\overseer\commands.lua:269: in function 'handle_tmpl'
	...ack\packer\start\overseer.nvim/lua\overseer\commands.lua:302: in function 'on_choice'
	...ck\packer\opt\dressing.nvim/lua\dressing\select\init.lua:71: in function 'cb'
	vim/_editor.lua:262: in function <vim/_editor.lua:261>

Remove extra empty quickfix output

Hi! I have a run_script.lua template file with:

return {
    name = 'Run Script',
    builder = function()
        local file = vim.fn.expand('%:p')
        return {
            cmd = { vim.bo.filetype },
            args = { file },
            -- default_component_params = {
            --     errorformat = set_efm(vim.bo.filetype),
            -- },
            components = {
                'default',
                { 'on_output_quickfix', open = true },
            },
        }
    end,
    condition = {
        filetype = { 'python', 'bash', 'lua' },
    },
}

and an overseer config file with:

local overseer = require('overseer')
local u = require('utils')

overseer.setup({
    templates = { 'builtin', 'user.run_script' },
})

-- Mappings
u.keymap('n', '<F7>', function()
    vim.cmd('silent noautocmd update')
    overseer.run_template({ name = 'Run Script' }, function()
        vim.cmd('cclose')
    end)
end)
u.keymap('n', '<Leader>lt', '<Cmd>OverseerQuickAction open hsplit<CR>')

Now if, as in the GIF, I do:

  1. PressF7 on a python file with print(2) in it then the 2 is printed to the quickfix but there are also 4/5 empty lines with ||
  2. If I remove/comment out the print(2) and press F7 again then the quickfix opens but is empty

My questions therefore are:
a. Is it possible to trim empty quickfix lines such that for case 1. above only 2 is printed/shown in the quickfix
b. Is it possible to add a setting such that when the quickfix is empty (i.e all text fields qf entries are empty) then the quickfix doesn't open?
c. (Bonus) Can I use overseer to run over a visual selection of code? (rather than the whole file)?
d. (Bonus II) Is it possible to simply run a command and then parse a resulting logfile and load the results into the quickfix? i.e I want to simply run a script and once that script finishes parse a log fie

Thanks in advance (neat plugin!)

overseer

[Feature] Start an action according to command output patterns

Actually, command output is parsed, and used for example in the errorformat string to populate the quick fix.

It would be very cool for a task to specify a list of regex patterns, scanned in the command line output during its execution so that another action (or task) is started when an associated pattern is found. For example, consider this output:

C:\command.bat
PATTERN1
PATTERN2
PATTERN3
PATTERN4
PATTERN5

It would be good to add a config like follows to task templates:

{
  "name": "Execute command",
  "cmd": "command.bat",
  "onOutput": [
    {
      /* Start another task when this pattern is found */
      "pattern": "PATTERN1",
      "NextTask": "Phase 1"
    },
    {
      /* Kill the currently running task and set its status to FAILED when this pattern is found */
      "pattern": "PATTERN2",
      "CurrentTask":
      {
        "Action": "Kill Task",
        "ExitCode": "FAILED"
      }
    },
    {
      /* Run a cmd when this pattern is found */
      "pattern": "PATTERN3",
      "cmd": "echo FAILED>log.txt"
    },
    {
      /* Run a LUA function when this pattern is found */
      "pattern": "PATTERN4",
      "lua": function() print("FAILED") end
    }
  ]
}

The structure above is only an example of what I mean. Possible actions could be:

  • Start another task
  • Do something with the current task (pause, kill & set status, etc.)
  • Run a cmd command
  • Run a LUA function

This file %

How can I use % or %:p... in cmd to expand current file.

Like:

%
# or
./script.sh %
# or 
./script "a:%:b"

image

[Bug] Very long command output lines are split in two

error.log content:

ERROR: [Synth 8-690] width mismatch in assignment; target has 64 bits, source has 32 bits [C:/Projects/HDL/FPGA/Models/Model_2.0/FPGA/Latest/ZU7_COMPONENT_PLUS/COMPONENT_PLUS_V004_000/COMPONENT/COMPONENT.srcs/sources_1/new/ACQ_COMPONENT.vhd:4085]
ERROR: [Synth 8-285] failed synthesizing module 'ACQ_COMPONENT' [C:/Projects/HDL/FPGA/Models/Model_2.0/FPGA/Latest/ZU7_COMPONENT_PLUS/COMPONENT_PLUS_V004_000/COMPONENT/COMPONENT.srcs/sources_1/new/ACQ_COMPONENT.vhd:226]
ERROR: [Synth 8-285] failed synthesizing module 'Top_COMPONENT' [C:/Projects/HDL/FPGA/Models/Model_2.0/FPGA/Latest/ZU7_COMPONENT_PLUS/COMPONENT_PLUS_V004_000/COMPONENT/COMPONENT.srcs/sources_1/new/Top_COMPONENT.vhd:167]

When executing this command:

type error.log

then the log lines are split in two in output:

ERROR: [Synth 8-690] width mismatch in assignment; target has 64 bits, source has 32 bits [C:/Projects/HDL/FPGA/Models/Model_2.0/FPGA/Latest/ZU7_COMPONENT_PLUS/COMPONENT_PLUS_V004_000/COMPONE
NT/COMPONENT.srcs/sources_1/new/ACQ_COMPONENT.vhd:4085]
ERROR: [Synth 8-285] failed synthesizing module 'ACQ_COMPONENT' [C:/Projects/HDL/FPGA/Models/Model_2.0/FPGA/Latest/ZU7_COMPONENT_PLUS/COMPONENT_PLUS_V004_000/COMPONENT/COMPONENT.srcs/sources_
1/new/ACQ_COMPONENT.vhd:226]
ERROR: [Synth 8-285] failed synthesizing module 'Top_COMPONENT' [C:/Projects/HDL/FPGA/Models/Model_2.0/FPGA/Latest/ZU7_COMPONENT_PLUS/COMPONENT_PLUS_V004_000/COMPONENT/COMPONENT.srcs/sources_
1/new/Top_COMPONENT.vhd:167]

[Process exited 0]

So for example error parsing with errorformat is broken. We should expect just tree output lines, not six, due to the split.

nvim version:

NVIM v0.8.0-1210-gd367ed9b2
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
Compilato da runneradmin@fv-az177-603

Os is Windows 10 Pro.

Processes do not send output to task terminal until they are finished

The stream of output that some tasks produce, while they are running (e.g., terraform apply), is not displayed in a corresponding task terminal. In this example, that means, that the user does not get any feedback from the process until the task is finished.

Is there a possibility to enable this with overseer?

On another note, what do you think about external task runners, e.g., another tmux or kitty tab?

Kill or warn about tasks when exiting Neovim

I had a long-running task with Overseer and I forgot about it when closing Neovim. The task was still running, and I had to manually kill it.

Is there a way to kill them automatically or prevent closing with running tasks?

Thanks for the nice plugin!

Dap and `.vscode/launch.json`

I just discovered yet another of your awesome plugins.

I am working on a shared codebase with colleagues using vscode.

I managed to get :OverseerRun to pick up and run tasks in .vscode/tasks.json. However, debug tasks inside .vscode/launch.json are not listed, and I do not know if that is the intention or if a picker should show up on dap.continue, as it is not quite clear from the docs. https://github.com/stevearc/overseer.nvim/blob/master/doc/third_party.md#dap

Looking at the code it looks like only tasks.json is loaded.

local function get_tasks_file(opts)
local filename = vim.fn.findfile(files.join(".vscode", "tasks.json"), opts.dir .. ";")
if filename ~= "" then
filename = vim.fn.fnamemodify(filename, ":p")
end
return filename
end

Any help would be appreciated.

Setup

require "config.dap"
local overseer = require "overseer"
overseer.setup {
  dap = true,
}

overseer.add_template_hook({}, function(task_defn, util)
  util.add_component(task_defn, { "on_output_quickfix", open = true })
end)

vim.api.nvim_create_user_command("WatchRun", function()
  overseer.run_template({ name = "test" }, function(task)
    if task then
      task:add_component { "restart_on_save", path = vim.fn.expand "%:p" }
      local main_win = vim.api.nvim_get_current_win()
      overseer.run_action(task, "open vsplit")
      vim.api.nvim_set_current_win(main_win)
    else
      vim.notify("WatchRun not supported for filetype " .. vim.bo.filetype, vim.log.levels.ERROR)
    end
  end)
end, {})

config.dap

dap.configurations.rust = {
  {
    name = "codelldb",
    type = "codelldb",
    request = "launch",

    -- if you change `runInTerminal` to true, you might need to change the yama/ptrace_scope setting:
    --
    --    echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope
    --
    -- Otherwise you might get the following error:
    --
    --    Error on launch: Failed to attach to the target process
    --
    -- But you should be aware of the implications:
    -- https://www.kernel.org/doc/html/latest/admin-guide/LSM/Yama.html
  },
}

dap.adapters.codelldb = require("config.codelldb").get_codelldb()
dap.defaults.rust.exception_breakpoints = { "rust_panic" }

[Bug] Neotest - Attempt to call field 'adapters' (a nil value)

I have a mapping to run my Neotest test suite:

function()
  local neotest = require("neotest")
  for _, adapter_id in ipairs(neotest.run.adapters()) do
    neotest.run.run({ suite = true, adapter = adapter_id })
   end
end,

with the following Neotest config:

require("neotest").setup({
  adapters = {
    require("neotest-rspec"),
  },
  consumers = {
    overseer = require("neotest.consumers.overseer"),
  },
})

I'm getting the following error:

E5108: Error executing lua: /Users/Oli/.config/nvim/lua/Oli/core/mappings.lua:366: attempt to call field 'adapters' (a nil value)
stack traceback:
        /Users/Oli/.config/nvim/lua/Oli/core/mappings.lua:366: in function </Users/Oli/.config/nvim/lua/Oli/core/mappings.lua:364>

where line 364 is my mapping.

If I remove the overseer = require("neotest.consumers.overseer") line then the mapping works as expected

How to set quickfix list?

Hi. Thanks a lot for this incredibly cool plugin. I absolutely love it.

I have defined some templates for working with platformio and they work really nicely. The only thing I can't get working is the population of the quickfix list. I cannot deduce from the docs what it is I am doing wrong. Any pointers?

Here's the template:

        -- Build
	overseer.register_template({
		name = "piobuild",
		builder = function(params)
			return {
				cmd = {'pio'},
				args = {"run", "--verbose"},
				name = "piobuild",
				cwd = "",
				env = {},
				components = {
					"default",
					"on_result_diagnostics",
					["on_result_diagnostics_quickfix"] = {
						open = true
					}
				},
				metadata = {},
			}
		end,
		desc = "Build a platformio project",
		tags = {overseer.TAG.BUILD},
		params = { },
		priority = 50,
		condition = {
			filetype = {"c", "cpp", "ino", "h", "hpp", "ini"},
			callback = function(search)
				return isdir(search.dir .. "/.pio")
			end
		},
	})

Question on opening the quickfixlist to show errors from a gcc compilation process

I am coming to Overseer from other task automation tools (asyncrun/asynctasks initially and later on, mg979/tasks.nvim) that load the output from the compilation command onto the quickfix window by parsing the errorformat.

I came to Overseer based on good experience with your other neovim plugins e.g. aerial, and was interested in a pure lua plugin for my compilations. Most importantly, the major compatibility with vscode's tasks.json format means that I can mostly reuse the standard json (with some minor modifications) that my colleagues are using.

While the documentation is quite extensive, and it is certainly a well thought out example of high quality software engineering, the documentation is missing simple recipes e.g. building, running and debugging a C++/python/rust application. While the demo video piqued my interest, it is certainly not satisying the needs of the tutorial. The exhaustive project documentation currently is less tailored to those who simply want to achieve simple end goals.

Here's a specific question. How can I use the following .vscode/tasks.json on a simple helloworld.cpp (with syntax error missing a semicolon) to automatically populate and open the quickfix window upon building?

.vscode/tasks.json

{
  "tasks": [
    {
      "type": "shell",
      "label": "g++ debug build: compile active file",
      "command": "g++",
      "args": [
        "-std=c++20",
        "-Wall",
        "-fdiagnostics-color=always",
        "-DDEBUG",
        "-O0",
        "-g",
        "-gdwarf-5",
        "${file}",
        "-o",
        "${fileDirname}/${fileBasenameNoExtension}.x"
      ],
      "problemMatchers": "$cpp",
      "options": {
        "cwd": "${fileDirname}"
      },
      "group": {
        "kind": "build",
        "isDefault": true
      }
    }
  ],
  "version": "2.0.0"
}

helloworld.cpp (with syntax error, missing a semicolon in the cout statement within the loop)

#include <iostream>
#include <vector>
#include <string>

int main()
{
    std::vector<std::string> msg{"Hello", "C++"};

    for (const std::string &word : msg)
    {
        std::cout << word << " "
    }
    std::cout << endl;
}

Custom binding settings does not disable default bindings

Hi @stevearc

I added custom bindings as below, the default <C-l> is still mapped to increase detail level which conflicts my mapping config.

bindings = {
      ["+"] = "IncreaseDetail",
}

Maybe the key, value should be swapped?

bindings = {
      IncreaseDetail = "+",
}

So the vim.tbl_deep_extend can replace default value with custom value.

[Feature] Overseer redirection to ToggleTerm

Excellent plugin so far! Something I'm desiring is redirection of output to a ToggleTerm pane (with shading and such implemented). Since at it's core it's still a built-in terminal window, I figured Overseer could still have tight control over the output. How would I be able to accomplish this? ToggleTerm does some setup, so it isn't as simple as creating an action to swap out the existing terminal buffer that the task is in without losing all of ToggleTerm's wrapping functionality.

Config to not automatically open task picker when `dap=true` and `postDebugTask=nil`

Thank you for this plugin, it is almost too good to be true, when compared to the other task plugins available for neovim :)

My issue is with the dap = true feature:

overseer.setup({
  dap = true,
})

For me this always opens the Overseer task picker, when the debug session is done and no postDebugTask is defined in the config:

dap.configurations.cpp = {
  {
    preLaunchTask = "Compile C++ with gdb flag",
    postDebugTask = nil
  },

In many cases this is not needed and can be annoying. It would be nice. if we were able to turn off the automatic task picking, when there is no postDebugTask defined in the dap config.

Template execution error

I can see that with commit ce49d5237546e441a1780331d5d8ec1cd9bf9155, the template registration was changed to accept a callback. But since then, none of my templates that used to work previously work anymore. It throws the following error.

E5108: Error executing lua .../packer/opt/overseer.nvim/lua/overseer/template/init.lua:295: attempt to call upvalue 'cb' (a nil value)
stack traceback:
        .../packer/opt/overseer.nvim/lua/overseer/template/init.lua:295: in function 'final_callback'
        .../packer/opt/overseer.nvim/lua/overseer/template/init.lua:341: in function 'list'
        .../packer/opt/overseer.nvim/lua/overseer/template/init.lua:353: in function 'get_by_name'
        .../pack/packer/opt/overseer.nvim/lua/overseer/commands.lua:163: in function 'run_template'
        /home/ranjith/.config/nvim/lua/r/utils/compiler.lua:9: in function 'sequencer'
        /home/ranjith/.config/nvim/lua/r/utils/compiler.lua:125: in function 'callback'
        ...cker/opt/dressing.nvim/lua/dressing/select/telescope.lua:112: in function 'run_replace_or_original'
        ...k/packer/opt/telescope.nvim/lua/telescope/actions/mt.lua:65: in function 'key_func'
        ...ack/packer/opt/telescope.nvim/lua/telescope/mappings.lua:341: in function 'execute_keymap'
        [string ":lua"]:1: in main chunk

The same templates work if I am calling it using OverseerRun. Just not when I try to do something like :lua require("overseer").run_template({name="TheNAME"})

Could you please point me to the new signature of the run_template call? Or do I need to define templates differently than before?

Cannot see output when task finish

Hi, there is a way to avoid overseer to close the open floating terminal when a task finish? I have some VS Code shell task that I run with overseer that, when the task terminates, closes the floating terminal and I cannot re-open it so I cannot see the output of the task.

As alternative, I saw that is possible to show the output in quickfix buffer. There is a way to do it with a VS Code task?

Offtopic: is there an api to list all tasks defined in tasks.json? I'd like to associate tasks in tasks.json automatically to a key mapping using which-key. Do you now if it possible doing something like this?

Offtopic2: since my compilation scripts accepts arguments from command line to build different application variants, I would like to spawn a selection menu, after selecting the task to run, to select the build variant and pass the relative command argument to the script lunched by the task. The task is defined in tasks.json. Is it possible to do something like that?

Tmux pane support

Hi, is it possible to support Tmux panes using Tmux pane ids or tokens? I see Overseer use built-in terminal but I'd like to run tasks and commands in a Tmux pane.

Single command with arguments

Currently the plugin have a lot of standalone commands. But it would be great to provide a single command with subcommands instead.
Like Overseer open or Overseer run. It just nicer to use with completion.

preLaunchTask not working when using require("dap").continue()

Hi, I have the following in my launch.json

"name": "Remote GDB",
"type":"cppdbg",
"request": "launch",
"preLaunchTask": "gdb_server",

and this is part of a task in task.json

"taskName": "gdb_server",
"label": "Run remote gdb server",
"type": "shell",
"command": "launch_ssh_gdb_server.sh"

but when I launch the require("dap").continue() do not start the gdb_server task

Is there any reason why this config should not work?

Attach to terminal

When I close Buf of terminal, I should have to restart the task to view the output. Is there, is there a way to reattach to output, without taping?

: OverseerQuickAction
restart
:OverseerQuickAction
8 vsplit

Create Wiki?

Why don't add these doc file to Wiki, I think it easy to read these documents

Provide cargo run subcommand

Overseer supports built-in cargo commands. But it currently missing run:

{ args = { "build" }, tags = { TAG.BUILD } },
{ args = { "test" }, tags = { TAG.TEST } },
{ args = { "check" } },
{ args = { "doc" } },
{ args = { "clean" } },
{ args = { "bench" } },
{ args = { "update" } },
{ args = { "publish" } },

It would be great to add run subcommand too.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.