feat(forge): add validate option for forge ref validation on write (#138)
Problem: Typos in forge refs like `gh:user/repo#42` silently persist — there's no feedback when a ref points to a nonexistent issue. Solution: Add `forge.validate` config option. When enabled, `diff.apply()` returns new/changed `ForgeRef[]` and `forge.validate_refs()` fetches metadata for each, logging specific warnings for not-found, auth, or CLI-missing errors.
This commit is contained in:
parent
61d84f85b8
commit
f198358819
6 changed files with 163 additions and 19 deletions
|
|
@ -489,9 +489,13 @@ function M._on_write(bufnr)
|
|||
if #stack > UNDO_MAX then
|
||||
table.remove(stack, 1)
|
||||
end
|
||||
diff.apply(lines, s, hidden)
|
||||
local new_refs = diff.apply(lines, s, hidden)
|
||||
M._recompute_counts()
|
||||
buffer.render(bufnr)
|
||||
if new_refs and #new_refs > 0 then
|
||||
local forge = require('pending.forge')
|
||||
forge.validate_refs(new_refs)
|
||||
end
|
||||
end
|
||||
|
||||
---@return nil
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue