Conversation
zuqini
left a comment
There was a problem hiding this comment.
Thanks for the contribution! The change looks reasonable and I don't see any major concerns with the implementation, but I need to sleep on the direction.
In general I think zpack should delegate to vim.pack for plugin management, and this feature bypasses it entirely.
Could you describe what dev mode is meant to achieve, and what specifically can't be done through the vim.pack API?
| end | ||
|
|
||
| local src = get_source_url(spec) | ||
| if not src then goto continue end |
There was a problem hiding this comment.
This guard is unreachable — get_source_url above still calls error(err) when normalize_source returns nil, so a missing dev directory aborts the whole import pipeline before this runs.
I think either drop the error(err) so nil propagates here and shedule_notify an error, or handle the dev miss with schedule_notify + return nil in normalize_source
| M.load_local_plugin = function(path, source_plugin_files) | ||
| vim.opt.runtimepath:prepend(path) | ||
| if source_plugin_files then | ||
| local files = vim.fn.glob(path .. '/plugin/**/*.{vim,lua}', false, true) |
There was a problem hiding this comment.
:packadd also sources ftdetect/**/*; bypassing it here means filetype detection shipped inside a dev plugin won't fire.
I'm not completely sure what the best solution is, or if it should be considered in-scope forzpack.nvim to re-implement :packadd
|
|
||
| ---@param spec zpack.Spec | ||
| ---@return string | ||
| ---@return string|nil |
There was a problem hiding this comment.
note that because of https://github.com/zuqini/zpack.nvim/pull/17/changes#r3097565585, this currently never returns nil.
| -- not call the load callback for local directories. Register them directly | ||
| -- with a synthetic plugin object so the rest of the pipeline (startup, | ||
| -- lazy triggers, config hooks) works normally. | ||
| for _, pack_spec in ipairs(local_packs) do |
There was a problem hiding this comment.
Minor architecture point: previously pack_spec.name was always populated by vim.pack.add before register_plugin saw it. This backfill keeps that invariant working, but splits name-derivation across two spots — could we do it once during resolve instead?
No description provided.