-
Notifications
You must be signed in to change notification settings - Fork 337
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug: If a plugin having dev = true
and other plugins depends on the plugin, dev = true
is ignored
#982
Comments
Hi @kyoh86 I can load your example with the following changes:
local plugins = {
{ "kyo86/momiji", dev = true },
{
"rebelot/heirline.nvim",
-- dependencies = { "kyo86/momiji" },
dependencies = { "momiji" },
},
}
require("lazy").setup(plugins, {
root = root .. "/plugins",
dev = { path = root .. "/locals/" },
}) |
@abeldekat Thank you, the second one was my mistake. |
Could you redefine |
Hi @kyoh86, Regarding your question: As a user of lazy.nvim, I can only give you an opinion. I am thinking about the first change:
I contributed a little to the code that processes the spec, and for now I do not fully understand why using the full name in the dependencies breaks the dev setup. I think it's a bug, further investigation is necessary. |
@abeldekat Thank you for your kind reply. And I also looked into the process, but could not find the root cause of this issue. |
Hi @kyoh86, I can narrow down your use case. The problem is not related to dependencies. {
{ "kyoh86/momiji", dev = true }, -- parent spec, dir is "dev dir"
{ "kyoh86/momiji"}, -- new spec, dir is "plugin dir"
} The last snippet in this example overrides the
In your example, the
If the
The solution: {
{
"rebelot/heirline.nvim",
dependencies = { "kyoh86/momiji" },
},
{ "kyoh86/momiji", dev = true },
}
EDIT local plugins = {
{ "kyo86/momiji", dev = true },
{
"rebelot/heirline.nvim",
-- dependencies = { "kyo86/momiji" },
dependencies = { "momiji" },
},
} |
imo this isn't a bug at all |
Hi @max397574,
Of course. I did not say anything in that regard.
That was not my intention at all though. I should have mentioned my first comment In that comment I already gave the solution you mention:
I will add the above to the comment you are referring to.
I agree and I hope that the arguments in my comment illustrate this. |
Thank you all for your kind responses. I use As a result, I do not get the advantage of being able to describe specs in dependencies. It seems that the spec in dependencies can only be beneficial in a limited cases.
|
I think you can use the full potential of the dependencies field. Fragment of config: dev = {
-- directory where you store your local plugin projects
path = "~/projects",
---@type string[] plugins that match these patterns will use your local versions instead of being fetched from GitHub
patterns = {}, -- For example {"folke"}
fallback = false, -- Fallback to git when local plugin doesn't exist
}, Now, the order is irrelevant. Lazy.nvim automatically adds the |
@abeldekat |
You're welcome. Glad I could help. |
@abeldekat this is a very well put together comment: #982 (comment) Although I do think this should be considered a bug or at least an unintentional implementation detail of the override mechanism. Basically from the documentation that you quoted:
I would completely expect this to be only explicitly set fields not that when a new spec is put in it is fully calculated out in place. I would expect that it would do all of the merging throughout the configuration and then at the end fill in the missing pieces. I totally understand the behavior that you are describing, but imagine the case where I specify Maybe this is just considered outside of the scope of lazy.nvim if it would take such a large rewrite of the methodology to change which I think is totally fine. I do think if that's the case, then the |
I think now that the root cause is found to be the same, I think we should consolidate these as duplicates because I don't think they are different bugs now! Let me know what you think @abeldekat and I can just close mine out and drop a link to this thread to consolidate the conversation |
We have narrowed down the use cases in both these issues, thus I think we can save Folke some time. |
Hi @kyoh86, I created a new issue and would appreciate your feedback. @max397574, if you have the time, please have a look at the new issue. |
@abeldekat Thank you for your kind guidance. |
Did you check docs and existing issues?
Neovim version (nvim -v)
v0.10.0-dev 4a06de4
Operating system/version
Linux 5.15.90.1-microsoft-standard-WSL2
Describe the bug
To modify one plugin, I place the plugin under config.dev and set dev=true.
If there are other plugins that depend on that plugin, dev=true will be ignored and the plugin will be installed remotely under the control of lazy.nvim.
Steps To Reproduce
dev = true
for X plugindependencies = { "X" }
for Y pluginExpected Behavior
X loaded from
config.devconfig.dev.path
directoryRepro
The text was updated successfully, but these errors were encountered: