folke / lazy.nvim

💤 A modern plugin manager for Neovim
https://lazy.folke.io/
Apache License 2.0
13.93k stars 332 forks source link

bug: plugin not being updated to latest version #1347

Closed ameddin73 closed 6 months ago

ameddin73 commented 6 months ago

Did you check docs and existing issues?

Neovim version (nvim -v)

v0.9.5

Operating system/version

macOS 14.3

Describe the bug

Updating plugin mason-lspconfig.nvim (currently at version 1.26.0) has the following output:

✔ [task] clone 1657.78ms
  Cloning into '/Users/alex/.local/share/lunarvim/site/pack/lazy/opt/mason-lspconfig.nvim'...
  remote: Enumerating objects: 1251, done.
  remote: Counting objects: 100% (100/100), done.
  remote: Compressing objects: 100% (61/61), done.
  remote: Total 1251 (delta 66), reused 48 (delta 31), pack-reused 1151
  Receiving objects: 100% (1251/1251), 208.80 KiB | 1.00 MiB/s, done.
  Resolving deltas: 100% (531/531), done.
✔ [task] checkout 512.01ms
  Note: switching to '7276ffffcf51a8304b5fd4b81293be4ee010ec47'.

  You are in 'detached HEAD' state. You can look around, make experimental
  changes and commit them, and you can discard any commits you make in this
  state without impacting any branches by switching back to a branch.

  If you want to create a new branch to retain commits you create, you may
  do so (now or later) by using -c with the switch command. Example:

    git switch -c <new-branch-name>

  Or undo this operation with:

    git switch -

  Turn off this advice by setting config variable advice.detachedHead to false

  HEAD is now at 7276fff chore: update generated code (#213)
✔ [task] docs 21.13ms

But that commit is 1.1.0 from last April.

Steps To Reproduce

  1. Add mason-lspconfig.nvim to lazy plugin list
  2. Install plugins
  3. See that the wrong version is checked out.

Expected Behavior

Version 1.26.0 would be checked out.

Repro

-- DO NOT change the paths and don't remove the colorscheme
local root = vim.fn.fnamemodify("./.repro", ":p")

-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
  vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end

-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
  vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", lazypath, })
end
vim.opt.runtimepath:prepend(lazypath)

-- install plugins
local plugins = {
  "folke/tokyonight.nvim",
{
    "williamboman/mason-lspconfig.nvim",
    cmd = { "LspInstall", "LspUninstall" },
    config = function()
      require("mason-lspconfig").setup(lvim.lsp.installer.setup)

      -- automatic_installation is handled by lsp-manager
      local settings = require "mason-lspconfig.settings"
      settings.current.automatic_installation = false
    end,
    lazy = true,
    event = "User FileOpened",
    dependencies = "mason.nvim",
  },
}
require("lazy").setup(plugins, {
  root = root .. "/plugins",
})

vim.cmd.colorscheme("tokyonight")
-- add anything else here
ameddin73 commented 6 months ago

Closing as this was an issue with plugins being pinned in my distro Lunarvim.