packspec icon indicating copy to clipboard operation
packspec copied to clipboard

Access to dependency versions at runtime

Open ii14 opened this issue 3 years ago • 3 comments

Maybe plugins should have some standard way of accessing versions of their dependencies to handle differences in API and behavior between versions?

Example:

packspec["telescope"].version
-- returns a string, eg. "1.2.3"

if packspec["telescope"].is("~> 2.0") then -- format reused from "version" field in the spec
  -- ...
else
  -- ...
end

ii14 avatar Mar 29 '22 04:03 ii14

I think this is a duplicate of https://github.com/nvim-lua/nvim-package-specification/issues/3

mjlbach avatar Mar 29 '22 04:03 mjlbach

Not quite, I think the idea there was to have multiple versions of the same plugin at the same time. This is about plugins being able to check the version of their dependencies. I guess this could be a different approach to that problem.

ii14 avatar Mar 29 '22 04:03 ii14