deprecate lspinstall in faviour of lsp_installer

neovim_0.6
ray-x 3 years ago
parent 7514301d80
commit 87f4c2b664

@ -223,7 +223,7 @@ require'navigator'.setup({
diagnostic_head_severity_1 = "🈲",
-- refer to lua/navigator.lua for more icons setups
},
lspinstall = false, -- set to true if you would like use the lsp installed by lspinstall
lsp_installer = false, -- set to true if you would like use the lsp installed by williamboman/nvim-lsp-installer
lsp = {
code_action = {enable = true, sign = true, sign_priority = 40, virtual_text = true},
code_lens_action = {enable = true, sign = true, sign_priority = 40, virtual_text = true},
@ -400,24 +400,24 @@ The plugin can be loaded lazily (packer `opt = true` ), And it will check if opt
The terminal will need to be able to output nerdfont and emoji correctly. I am using Kitty with nerdfont (Victor Mono).
## Integration with lspinstall
## Integration with lsp_installer (williamboman/nvim-lsp-installer)
If you'd like to only use the lsp servers installed by lspinstall. Please set
If you'd like to only use the lsp servers installed by lsp_installer. Please set
```lua
lspinstall = false
lsp_installer = false
```
In the config.
If you need to use the setup from navigator instead of default setup in lspinstall. Please setup
If you need to use the setup from navigator instead of default setup in lsp_installer. Please setup
```lua
lspinstall = false
-- lsp_installer = false -- default value is false
require'navigator'.setup({
lsp = {
tsserver = { cmd = {'your tsserver installed by lspinstall'} }
tsserver = { cmd = {'your tsserver installed by lsp_installer'} }
}
})

@ -60,7 +60,7 @@ _NgConfigValues = {
-- cmd = {'lua-language-server'}
}
},
lspinstall = false, -- set to true if you would like use the lsp installed by lspinstall
lsp_installer = false, -- set to true if you would like use the lsp installed by williamboman/nvim-lsp-installer
icons = {
icons = true, -- set to false to use system default ( if you using a terminal does not have nerd/icon)
-- Code action
@ -114,6 +114,10 @@ M.deprecated = function(cfg)
if cfg.lsp ~= nil and cfg.lsp.disable_format_ft ~= nil and cfg.lsp.disable_format_ft ~= {} then
warn('disable_format_ft renamed to disable_format_cap')
end
if cfg.lspinstall ~= nil then
warn('lspinstall deprecated, please use lsp-installer instead')
end
end
local extend_config = function(opts)

@ -10,8 +10,8 @@ return {
["guihua.lua"] = "ray-x/guihua.lua"
}
if _NgConfigValues.lspinstall == true then
lazy_plugins["nvim-lspinstall"] = "kabouzeid/nvim-lspinstall"
if _NgConfigValues.lsp_installer == true then
lazy_plugins["nvim-lsp-installer"] = "williamboman/nvim-lsp-installer"
end
-- packer installed
@ -25,13 +25,13 @@ return {
end
if _NgConfigValues.lspinstall == true then
local has_lspinst, lspinst = pcall(require, "lspinstall")
log('lspinstall', has_lspinst)
if _NgConfigValues.lsp_installer == true then
local has_lspinst, lspinst = pcall(require, "lsp_installer")
log('lsp_installer', has_lspinst)
if has_lspinst then
lspinst.setup()
local configs = require "lspconfig/configs"
local servers = require'lspinstall'.installed_servers()
local servers = require'nvim-lsp-installer'.get_installed_servers()
for _, server in pairs(servers) do
local cfg = require'navigator.lspclient.clients'.get_cfg(server)
local lsp_inst_cfg = configs[server]

@ -156,8 +156,7 @@ local setups = {
},
rust_analyzer = {
root_dir = function(fname)
return util.root_pattern("Cargo.toml", "rust-project.json", ".git")(fname)
or util.path.dirname(fname)
return util.root_pattern("Cargo.toml", "rust-project.json", ".git")(fname) or util.path.dirname(fname)
end,
filetypes = {"rust"},
message_level = vim.lsp.protocol.MessageType.error,
@ -268,11 +267,11 @@ local servers = {
"r_language_server", "rust_analyzer", "terraformls", "svelte"
}
if config.lspinstall == true then
local has_lspinst, lspinst = pcall(require, "lspinstall")
if config.lsp_installer == true then
local has_lspinst, lspinst = pcall(require, "nvim-lsp-installer")
if has_lspinst then
local srvs = lspinst.installed_servers()
log('lspinstalled servers', srvs)
local srvs = require'nvim-lsp-installer.servers'.get_installed_servers()
log('lsp_installered servers', srvs)
if #srvs > 0 then
servers = srvs
end

Loading…
Cancel
Save