feat: add extra_args provider field (#51)
* feat: add `extra_args` provider field Problem: Overriding a single flag (e.g. `-outdir=build`) required redefining the entire `args` function, duplicating all preset defaults. Solution: Add `extra_args` field that appends to the resolved `args` after evaluation. Accepts a static table or a context function. * docs: document `extra_args` provider field
This commit is contained in:
parent
1fbc307bad
commit
12cb20d154
3 changed files with 9 additions and 0 deletions
|
|
@ -309,6 +309,9 @@ function M.compile(bufnr, name, provider, ctx, opts)
|
|||
if provider.args then
|
||||
vim.list_extend(cmd, eval_list(provider.args, resolved_ctx))
|
||||
end
|
||||
if provider.extra_args then
|
||||
vim.list_extend(cmd, eval_list(provider.extra_args, resolved_ctx))
|
||||
end
|
||||
|
||||
log.dbg('compiling buffer %d with provider "%s": %s', bufnr, name, table.concat(cmd, ' '))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue