kabouzeid / nvim-lspinstall

Provides the missing :LspInstall for nvim-lspconfig
MIT License
526 stars 67 forks source link

Options for java #181

Open delfick opened 2 years ago

delfick commented 2 years ago

Hello,

I'm struggling to figure out how to tell nvim that my gradle wrapper is not malicious. This is what I'm trying so far which feels wrong and doesn't work

local function setup_servers()
  require'lspinstall'.setup()
  local servers = require'lspinstall'.installed_servers()
  for _, server in pairs(servers) do
    if server == "java" then
        require'lspconfig'[server].setup{
            on_attach=on_attach,
            settings = {
                java = {
                    imports = {
                        gradle = {
                            wrapper = {
                                checksums = {
                                    sha256 = "ad79758b1d82bca41798b3a72354d50cc255a6298ff9ea85ec4fa76d81887458",
                                    allowed = true
                                }
                            }
                        }
                    }
                }
            }
        }
    else
        require'lspconfig'[server].setup{on_attach=on_attach}
    end
  end
end