Skip to content

Commit 08eb7d7

Browse files
authored
v2.0 breaking changes refactor (#448)
* fix: some improvements to run_in_cwd and run_in_fullscreen_win * refactor!: remove toggleterm and terminal strategies * refactor!: drop support for older Neovim versions * tools: improve makefile * refactor!: simplify logging utility and configuration * refactor: vim.loop -> vim.uv * doc: add some type annotations * cleanup: unused strategy code * refactor: simplify setup logic * refactor!: convert OverseerInfo to checkhealth * refactor!: get rid of task priority * refactor: simplify make task generator * refactor: simplify parameter prompt logic by removing behaviors * refactor: allow error reporting in template generator * refactor: simplify templates * refactor!: get rid of shell template * refactor: rearrange component type definition * refactor!: remove files.join -> vim.fs.joinpath * refactor: move vscode utilities out of template/ dir * refactor: split vscode template logic from utility code * refactor!: task bundles get the axe * refactor!: remove OverseerBuild command * cleanup!: remove callback from condition checks * refactor: automatic template loading; remove options * refactor!: remove auto-require behavior from top-level overseer module * cleanup: remove deprecated method * cleanup: remove some deprecated method handling * refactor!: rename run_template -> run_task * feat: run_task can pass a callback for post-build pre-create * refactor: remove preload_components option * refactor: dynamically find components using runtimepath * doc: update a bunch of docs for the recent changes * perf: make first require(config) faster * refactor!: delete overseer.wrap_template * cleanup: get rid of telescope-specific picker logic * refactor: use virtual text for form labels * refactor: use inline virtual text for forms and task editor * feat: restore template_dirs config option * refactor!: rewrite task list rendering to be function-based * fix: eliminate all deprecation warnings * cleanup!: remove some options for list_tasks that are unnecessary * feat: configurable task sorting * fix: hide deprecated components in task editor * fix: error in condition filetype handling * refactor: mark some methods on task as private * refactor!: remove OverseerClearCache command * feat: do not require calling setup() * fix: undo in task editor no longer borks everything * fix: task editor can change component param values * feat: OverseerShell command and overseer.run_cmd method * refactor!: replace behavior tree parsing with functions * refactor!: remove config and custom keymaps for form and task editor windows * doc: remove entreaty to request task system support * feat: can hook builtin vim.system and vim.fn.jobstart * doc: vim.diagnostics -> vim.diagnostic * doc: replaced :OverseerInfo with :checkhealth overseer * doc: small corrections * feat: add component alias for wrapped tasks * fix: starting a task doesn't switch to normal mode * feat: condition callback for hooking builtins * feat: unique component has 'soft' option * refactor!: rename time options to denote units * fix: guard against cursor outside window * fix: run_in_fullscreen_win uses new buffer by default * refactor: rename hook_builtins -> wrap_builtins * fix: attach source to wrapped tasks and filter them out of task list by default * fix: neotest strategy * fix: disable builtin wrapping when in fast event * refactor: clean up actions and lazy load * refactor!: overhaul keymap utility * feat: can toggle showing wrapped tasks * doc: improve type annotations for config * feat: save template name and params on tasks for serialization * fix: disable autocmds when updating quickfix * feat: expose API for creating a task output view * refactor: tidy and trim config options * doc: more docstrings for render.lua utilities * doc: remove strategies from vimdocs * refactor!: rename task "bundleable" property to "ephemeral" * doc: fix typechecking * refactor: mark wrap_builtins as experimental * refactor: extract highlight creation into function * feat: re-introduce config to customize default jobstart strategy * refactor: delete the run_cmd API * refactor!: make list_tasks sort order more stable * fix: reduce cursor jumping in task list * fix: register_alias doesn't override existing values by default * cleanup: remove unused parameter in make template * refactor!: rename actions -> keymap * feat: OverseerShell can create tasks without starting them * doc: add recipe for abbreviating OverseerShell * feat: add another helper sort function * refactor!: remove OverseerQuickAction command * doc: add some more docs to function signatures * doc: add more docs for output parsers * fix: slightly smarter open_output behavior * ci: drop neovim v0.10 from tests * lint: fix luacheck errors * doc: more resources for customizing task list rendering * doc: update more of the docs for the upcoming changes * refactor!: return truthy value from event to unsubscribe * doc: add a section on subscribing to task events * doc: add help docs for keymaps * refactor!: Task:dispose() returns true if task was already disposed * doc: add Task methods to API documentation * doc: add Task fields to API documentation
1 parent c77c78b commit 08eb7d7

File tree

140 files changed

+7060
-10462
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

140 files changed

+7060
-10462
lines changed

.github/workflows/tests.yml

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111
jobs:
1212
luacheck:
1313
name: Luacheck
14-
runs-on: ubuntu-22.04
14+
runs-on: ubuntu-24.04
1515
steps:
1616
- uses: actions/checkout@v4
1717

@@ -27,37 +27,34 @@ jobs:
2727

2828
stylua:
2929
name: StyLua
30-
runs-on: ubuntu-22.04
30+
runs-on: ubuntu-24.04
3131
steps:
3232
- uses: actions/checkout@v4
3333
- name: Stylua
3434
uses: JohnnyMorganz/stylua-action@v4
3535
with:
3636
token: ${{ secrets.GITHUB_TOKEN }}
37-
version: v2.0.2
37+
version: v2.3.0
3838
args: --check lua tests
3939

4040
typecheck:
4141
name: typecheck
42-
runs-on: ubuntu-22.04
42+
runs-on: ubuntu-24.04
4343
steps:
4444
- uses: actions/checkout@v4
4545
- uses: stevearc/nvim-typecheck-action@v2
4646
with:
4747
path: lua
48-
libraries: https://github.com/nvim-neotest/neotest https://github.com/mfussenegger/nvim-dap https://github.com/akinsho/toggleterm.nvim
48+
libraries: https://github.com/nvim-neotest/neotest https://github.com/mfussenegger/nvim-dap
4949

5050
run_tests:
5151
strategy:
5252
matrix:
5353
nvim_tag:
54-
- v0.8.3
55-
- v0.9.4
56-
- v0.10.0
57-
- v0.10.4
54+
- v0.11.0
5855

5956
name: Run tests
60-
runs-on: ubuntu-22.04
57+
runs-on: ubuntu-24.04
6158
env:
6259
NVIM_TAG: ${{ matrix.nvim_tag }}
6360
steps:
@@ -73,7 +70,7 @@ jobs:
7370
7471
update_docs:
7572
name: Update docs
76-
runs-on: ubuntu-22.04
73+
runs-on: ubuntu-24.04
7774
steps:
7875
- uses: actions/checkout@v4
7976

@@ -110,7 +107,7 @@ jobs:
110107
- typecheck
111108
- run_tests
112109
- update_docs
113-
runs-on: ubuntu-22.04
110+
runs-on: ubuntu-24.04
114111
steps:
115112
- uses: googleapis/release-please-action@v4
116113
id: release

Makefile

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,37 @@
1-
.PHONY: all doc test lint fastlint clean
2-
1+
## help: print this help message
2+
.PHONY: help
3+
help:
4+
@echo 'Usage:'
5+
@sed -n 's/^##//p' ${MAKEFILE_LIST} | column -t -s ':' | sed -e 's/^/ /'
6+
7+
## all: generate docs, lint, and run tests
8+
.PHONY: all
39
all: doc lint test
410

5-
doc: scripts/nvim_doc_tools
6-
python scripts/main.py generate
7-
python scripts/main.py lint
11+
venv:
12+
python3 -m venv venv
13+
venv/bin/pip install -r scripts/requirements.txt
14+
15+
## doc: generate documentation
16+
.PHONY: doc
17+
doc: scripts/nvim_doc_tools venv
18+
venv/bin/python scripts/main.py generate
19+
venv/bin/python scripts/main.py lint
820

21+
## test: run tests
22+
.PHONY: test
923
test:
1024
./run_tests.sh
1125

26+
## lint: run linters and LuaLS typechecking
27+
.PHONY: lint
1228
lint: scripts/nvim-typecheck-action fastlint
13-
./scripts/nvim-typecheck-action/typecheck.sh --lib https://github.com/nvim-neotest/neotest --lib https://github.com/mfussenegger/nvim-dap --lib https://github.com/akinsho/toggleterm.nvim --workdir scripts/nvim-typecheck-action lua
29+
./scripts/nvim-typecheck-action/typecheck.sh --lib https://github.com/nvim-neotest/neotest --lib https://github.com/mfussenegger/nvim-dap --workdir scripts/nvim-typecheck-action lua
1430

15-
fastlint: scripts/nvim_doc_tools
16-
python scripts/main.py lint
31+
## fastlint: run only fast linters
32+
.PHONY: fastlint
33+
fastlint: scripts/nvim_doc_tools venv
34+
venv/bin/python scripts/main.py lint
1735
luacheck lua tests --formatter plain
1836
stylua --check lua tests
1937

@@ -23,5 +41,7 @@ scripts/nvim_doc_tools:
2341
scripts/nvim-typecheck-action:
2442
git clone https://github.com/stevearc/nvim-typecheck-action scripts/nvim-typecheck-action
2543

44+
## clean: reset the repository to a clean state
45+
.PHONY: clean
2646
clean:
2747
rm -rf scripts/nvim_doc_tools scripts/nvim-typecheck-action venv .testenv

README.md

Lines changed: 57 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ A task runner and job management plugin for Neovim
1515
- [Custom tasks](doc/guides.md#custom-tasks)
1616
- [Actions](doc/guides.md#actions)
1717
- [Custom components](doc/guides.md#custom-components)
18+
- [Task events](doc/guides.md#task-events)
1819
- [Customizing built-in tasks](doc/guides.md#customizing-built-in-tasks)
20+
- [Customizing the task appearance in the task list](doc/guides.md#customizing-the-task-appearance-in-the-task-list)
1921
- [Parsing output](doc/guides.md#parsing-output)
2022
- [Running tasks sequentially](doc/guides.md#running-tasks-sequentially)
2123
- [VS Code tasks](doc/guides.md#vs-code-tasks)
@@ -30,22 +32,22 @@ A task runner and job management plugin for Neovim
3032
- [Heirline](doc/third_party.md#heirline)
3133
- [Neotest](doc/third_party.md#neotest)
3234
- [DAP](doc/third_party.md#dap)
33-
- [ToggleTerm](doc/third_party.md#toggleterm)
3435
- [Session managers](doc/third_party.md#session-managers)
3536
- [Recipes](#recipes)
37+
- [Run a quick command like with `:!` or `:term`](doc/recipes.md#run-a-quick-command-like-with--or-term)
3638
- [Restart last task](doc/recipes.md#restart-last-task)
3739
- [Run shell scripts in the current directory](doc/recipes.md#run-shell-scripts-in-the-current-directory)
3840
- [Directory-local tasks with exrc](doc/recipes.md#directory-local-tasks-with-exrc)
39-
- [:Make similar to vim-dispatch](doc/recipes.md#make-similar-to-vim-dispatch)
41+
- [Asynchronous :Make similar to vim-dispatch](doc/recipes.md#asynchronous-make-similar-to-vim-dispatch)
4042
- [Asynchronous :Grep command](doc/recipes.md#asynchronous-grep-command)
43+
- [Create a window that displays the most recent task output](doc/recipes.md#create-a-window-that-displays-the-most-recent-task-output)
4144
- [Reference](#reference)
4245
- [Setup options](doc/reference.md#setup-options)
4346
- [Commands](doc/reference.md#commands)
4447
- [Highlight groups](doc/reference.md#highlight-groups)
4548
- [Lua API](doc/reference.md#lua-api)
4649
- [Components](doc/reference.md#components)
4750
- [Strategies](doc/reference.md#strategies)
48-
- [Parsers](doc/reference.md#parsers)
4951
- [Parameters](doc/reference.md#parameters)
5052
- [Screenshots](#screenshots)
5153

@@ -54,7 +56,7 @@ A task runner and job management plugin for Neovim
5456
## Features
5557

5658
- Built-in support for many task frameworks (make, npm, cargo, `.vscode/tasks.json`, etc)
57-
- Simple integration with vim.diagnostics and quickfix
59+
- Simple integration with `vim.diagnostic` and quickfix
5860
- UI for viewing and managing tasks
5961
- Quick controls for common actions (restart task, rerun on save, or user-defined functions)
6062
- Extreme customizability. Very easy to attach custom logic to tasks
@@ -63,7 +65,7 @@ A task runner and job management plugin for Neovim
6365

6466
## Requirements
6567

66-
- Neovim 0.8+ (for older versions, use the [nvim-0.7 branch](https://github.com/stevearc/overseer.nvim/tree/nvim-0.7))
68+
- Neovim 0.11+ (for older versions, use a [nvim-0.x branch](https://github.com/stevearc/overseer.nvim/branches))
6769

6870
## Installation
6971

@@ -75,6 +77,8 @@ overseer supports all the usual plugin managers
7577
```lua
7678
{
7779
'stevearc/overseer.nvim',
80+
---@module 'overseer'
81+
---@type overseer.SetupOpts
7882
opts = {},
7983
}
8084
```
@@ -85,11 +89,13 @@ overseer supports all the usual plugin managers
8589
<summary>Packer</summary>
8690

8791
```lua
88-
require('packer').startup(function()
89-
use {
90-
'stevearc/overseer.nvim',
91-
config = function() require('overseer').setup() end
92-
}
92+
require("packer").startup(function()
93+
use({
94+
"stevearc/overseer.nvim",
95+
config = function()
96+
require("overseer").setup()
97+
end,
98+
})
9399
end)
94100
```
95101

@@ -99,9 +105,9 @@ end)
99105
<summary>Paq</summary>
100106

101107
```lua
102-
require "paq" {
103-
{'stevearc/overseer.nvim'};
104-
}
108+
require("paq")({
109+
{ "stevearc/overseer.nvim" },
110+
})
105111
```
106112

107113
</details>
@@ -148,14 +154,14 @@ git clone --depth=1 https://github.com/stevearc/overseer.nvim.git \
148154
Add the following to your init.lua
149155

150156
```lua
151-
require('overseer').setup()
157+
require("overseer").setup()
152158
```
153159

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

156162
https://user-images.githubusercontent.com/506791/189036898-05edcd62-42e7-4bbb-ace2-746b7c8c567b.mp4
157163

158-
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](https://github.com/stevearc/overseer.nvim/issues/new/choose)).
164+
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.
159165

160166
If you want to define custom tasks for your project, I'd recommend starting with [the tutorials](doc/tutorials.md).
161167

@@ -173,7 +179,9 @@ If you want to define custom tasks for your project, I'd recommend starting with
173179
- [Custom components](doc/guides.md#custom-components)
174180
- [Component aliases](doc/guides.md#component-aliases)
175181
- [Task result](doc/guides.md#task-result)
182+
- [Task events](doc/guides.md#task-events)
176183
- [Customizing built-in tasks](doc/guides.md#customizing-built-in-tasks)
184+
- [Customizing the task appearance in the task list](doc/guides.md#customizing-the-task-appearance-in-the-task-list)
177185
- [Parsing output](doc/guides.md#parsing-output)
178186
- [Running tasks sequentially](doc/guides.md#running-tasks-sequentially)
179187
- [VS Code tasks](doc/guides.md#vs-code-tasks)
@@ -183,6 +191,7 @@ If you want to define custom tasks for your project, I'd recommend starting with
183191
- [Architecture](doc/explanation.md#architecture)
184192
- [Tasks](doc/explanation.md#tasks)
185193
- [Components](doc/explanation.md#components)
194+
- [Serializability](doc/explanation.md#serializability)
186195
- [Templates](doc/explanation.md#templates)
187196
- [Task list](doc/explanation.md#task-list)
188197
- [Task editor](doc/explanation.md#task-editor)
@@ -195,18 +204,19 @@ If you want to define custom tasks for your project, I'd recommend starting with
195204
- [Heirline](doc/third_party.md#heirline)
196205
- [Neotest](doc/third_party.md#neotest)
197206
- [DAP](doc/third_party.md#dap)
198-
- [ToggleTerm](doc/third_party.md#toggleterm)
199207
- [Session managers](doc/third_party.md#session-managers)
200208
- [resession.nvim](doc/third_party.md#resessionnvim)
201209
- [Other session managers](doc/third_party.md#other-session-managers)
202210

203211
## Recipes
204212

213+
- [Run a quick command like with `:!` or `:term`](doc/recipes.md#run-a-quick-command-like-with--or-term)
205214
- [Restart last task](doc/recipes.md#restart-last-task)
206215
- [Run shell scripts in the current directory](doc/recipes.md#run-shell-scripts-in-the-current-directory)
207216
- [Directory-local tasks with exrc](doc/recipes.md#directory-local-tasks-with-exrc)
208-
- [:Make similar to vim-dispatch](doc/recipes.md#make-similar-to-vim-dispatch)
217+
- [Asynchronous :Make similar to vim-dispatch](doc/recipes.md#asynchronous-make-similar-to-vim-dispatch)
209218
- [Asynchronous :Grep command](doc/recipes.md#asynchronous-grep-command)
219+
- [Create a window that displays the most recent task output](doc/recipes.md#create-a-window-that-displays-the-most-recent-task-output)
210220

211221
## Reference
212222

@@ -215,30 +225,49 @@ If you want to define custom tasks for your project, I'd recommend starting with
215225
- [Highlight groups](doc/reference.md#highlight-groups)
216226
- [Lua API](doc/reference.md#lua-api)
217227
- [setup(opts)](doc/reference.md#setupopts)
218-
- [on_setup(callback)](doc/reference.md#on_setupcallback)
219228
- [new_task(opts)](doc/reference.md#new_taskopts)
220229
- [toggle(opts)](doc/reference.md#toggleopts)
221230
- [open(opts)](doc/reference.md#openopts)
222231
- [close()](doc/reference.md#close)
223-
- [list_task_bundles()](doc/reference.md#list_task_bundles)
224-
- [load_task_bundle(name, opts)](doc/reference.md#load_task_bundlename-opts)
225-
- [save_task_bundle(name, tasks, opts)](doc/reference.md#save_task_bundlename-tasks-opts)
226-
- [delete_task_bundle(name)](doc/reference.md#delete_task_bundlename)
227232
- [list_tasks(opts)](doc/reference.md#list_tasksopts)
228-
- [run_template(opts, callback)](doc/reference.md#run_templateopts-callback)
233+
- [run_task(opts, callback)](doc/reference.md#run_taskopts-callback)
229234
- [preload_task_cache(opts, cb)](doc/reference.md#preload_task_cacheopts-cb)
230235
- [clear_task_cache(opts)](doc/reference.md#clear_task_cacheopts)
231236
- [run_action(task, name)](doc/reference.md#run_actiontask-name)
232-
- [wrap_template(base, override, default_params)](doc/reference.md#wrap_templatebase-override-default_params)
233237
- [add_template_hook(opts, hook)](doc/reference.md#add_template_hookopts-hook)
234238
- [remove_template_hook(opts, hook)](doc/reference.md#remove_template_hookopts-hook)
235239
- [register_template(defn)](doc/reference.md#register_templatedefn)
236-
- [load_template(name)](doc/reference.md#load_templatename)
237-
- [debug_parser()](doc/reference.md#debug_parser)
238-
- [register_alias(name, components)](doc/reference.md#register_aliasname-components)
240+
- [register_alias(name, components, override)](doc/reference.md#register_aliasname-components-override)
241+
- [create_task_output_view(winid, opts)](doc/reference.md#create_task_output_viewwinid-opts)
242+
- [overseer.Task](doc/reference.md#overseertask)
243+
- [Task:serialize()](doc/reference.md#taskserialize)
244+
- [Task:clone()](doc/reference.md#taskclone)
245+
- [Task:add_component(comp)](doc/reference.md#taskadd_componentcomp)
246+
- [Task:add_components(components)](doc/reference.md#taskadd_componentscomponents)
247+
- [Task:set_component(comp)](doc/reference.md#taskset_componentcomp)
248+
- [Task:set_components(components)](doc/reference.md#taskset_componentscomponents)
249+
- [Task:get_component(name)](doc/reference.md#taskget_componentname)
250+
- [Task:remove_component(name)](doc/reference.md#taskremove_componentname)
251+
- [Task:remove_components(names)](doc/reference.md#taskremove_componentsnames)
252+
- [Task:has_component(name)](doc/reference.md#taskhas_componentname)
253+
- [Task:subscribe(event, callback)](doc/reference.md#tasksubscribeevent-callback)
254+
- [Task:unsubscribe(event, callback)](doc/reference.md#taskunsubscribeevent-callback)
255+
- [Task:is_pending()](doc/reference.md#taskis_pending)
256+
- [Task:is_running()](doc/reference.md#taskis_running)
257+
- [Task:is_complete()](doc/reference.md#taskis_complete)
258+
- [Task:is_disposed()](doc/reference.md#taskis_disposed)
259+
- [Task:get_bufnr()](doc/reference.md#taskget_bufnr)
260+
- [Task:open_output(direction)](doc/reference.md#taskopen_outputdirection)
261+
- [Task:broadcast(name)](doc/reference.md#taskbroadcastname)
262+
- [Task:dispatch(name)](doc/reference.md#taskdispatchname)
263+
- [Task:inc_reference()](doc/reference.md#taskinc_reference)
264+
- [Task:dec_reference()](doc/reference.md#taskdec_reference)
265+
- [Task:dispose(force)](doc/reference.md#taskdisposeforce)
266+
- [Task:restart(force_stop)](doc/reference.md#taskrestartforce_stop)
267+
- [Task:start()](doc/reference.md#taskstart)
268+
- [Task:stop()](doc/reference.md#taskstop)
239269
- [Components](doc/reference.md#components)
240270
- [Strategies](doc/reference.md#strategies)
241-
- [Parsers](doc/reference.md#parsers)
242271
- [Parameters](doc/reference.md#parameters)
243272

244273
## Screenshots

autoload/overseer.vim

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)