wbthomason / packer.nvim

A use-package inspired plugin manager for Neovim. Uses native packages, supports Luarocks dependencies, written in Lua, allows for expressive config
MIT License
7.74k stars 262 forks source link

`commit` gets ignored #916

Open xsteadfastx opened 2 years ago

xsteadfastx commented 2 years ago

Steps to reproduce

adding commit line for some package.

Actual behaviour

still installs latest commit.

Expected behaviour

to install the commit defined.

config part

     use {
        "williamboman/nvim-lsp-installer",
        requires = {
          "hrsh7th/nvim-cmp"
        },
        commit = "97b36e9938cc06156212accc73411afd7bab3a01",
        {
          "neovim/nvim-lspconfig",
          config = function()
            local lspinstaller = require("nvim-lsp-installer")
            lspinstaller.setup {}

            local lspconfig = require("lspconfig")

            -- individuell lsp configs
            lspconfig.gopls.setup {
              init_options = {
                buildFlags = { "-tags=integration,tools" },
                gofumpt = true
              }
            }

            lspconfig.sumneko_lua.setup {
              settings = {
                Lua = {
                  diagnostics = {
                    globals = { "vim" }
                  }
                }
              }
            }

            -- setup the rest
            for _, server in ipairs(lspinstaller.get_installed_servers()) do
              if server.name ~= "sumneko_lua" and server.name ~= "gopls" then
                lspconfig[server.name].setup {}
              end
            end

            vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(
              vim.lsp.handlers.hover,
              {
                border = "single"
              }
            )

            vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with(
              vim.lsp.handlers.signature_help,
              {
                border = "single"
              }
            )

            -- completions
            require("cmp_nvim_lsp").update_capabilities(vim.lsp.protocol.make_client_capabilities())
          end
        }
      }

full config can be found here: https://gist.github.com/xsteadfastx/9f7c7aa96c161e9466e5775cfcce7f87

gabezbm commented 2 years ago

I ran into the same issue while specifying commit for a plugin whose latest commit version has been installed. Then running :PackerSync still installed the latest commit. To solve this on my end, I removed this plugin and then ran :PackerSync with a certain commit specified, and it worked.

joshuajeschek commented 1 year ago

For me, the method described by @garyzhang2002 does not work.