[breaking] deprecate neodev setup inside navigator, please setup it as metioned in README.md

pull/268/head
ray-x 1 year ago
parent 7e95b1baae
commit 1b2a0856f4

@ -640,16 +640,26 @@ There are lots of plugins provides lsp support
* [neodev](https://github.com/folke/neodev.nvim) Dev setup for lua development. Navigator help you setup neodev
Here is an example to setup rust with rust-tools
* setup with neodev
```lua
use {"folke/neodev.nvim",
ft = 'lua',
config = function()
require'neodev'.setup{}
end
}
use {"ray-x/navigator.lua",
config=function()
require'navigator'.setup{}
end
}
```
* Here is an example to setup rust with rust-tools
```lua
require'navigator'.setup({
lsp = {
disable_lsp = { "rust_analyzer", "clangd" }, -- will not run rust_analyzer setup from navigator
['neodev'] = { runtime_path=true } -- any non default neodev setups, if not empty, navigator will call neodev.setup
-- with those configures
},
})
require('rust-tools').setup({
server = {

@ -95,10 +95,7 @@ _NgConfigValues = {
-- filetypes = {'typescript'} -- disable javascript etc,
-- set to {} to disable the lspclient for all filetype
},
['neodev'] = { -- navigator can use neodev settings to setup sumneko_lua
-- your setting for neodev here
-- navigator will setup neodev
},
neodev = false,
sumneko_lua = {
-- sumneko_root_path = sumneko_root_path,
-- sumneko_binary = sumneko_binary,
@ -158,23 +155,8 @@ _NgConfigValues = {
}
M.deprecated = function(cfg)
if cfg.code_action_prompt then
warn('code_action_prompt moved to lsp.code_action')
end
if cfg.code_lens_action_prompt then
warn('code_lens_action_prompt moved to lsp.code_lens_action')
end
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.lsp ~= nil and cfg.lsp.code_lens == true then
warn('code_lens moved to lsp.code_lens_action')
end
if cfg.lspinstall ~= nil then
warn('lspinstall deprecated, please use lsp-installer instead or use "lspinstall" branch')
if cfg.lsp ~= nil and cfg.lsp.neodev ~= false and cfg.lsp.neodev then
warn('neodev option deprecated, refer to README for more details')
end
end

@ -49,20 +49,12 @@ local disabled_ft = {
local on_attach = require('navigator.lspclient.attach').on_attach
-- gopls["ui.completion.usePlaceholders"] = true
-- lua setup
if _NgConfigValues.lsp['lua-dev'] ~= nil then
vim.notify('lua-dev is deprecated, please use neodev instead', vim.lsp.log_levels.WARN)
end
require('navigator.lazyloader').load('neodev.nvim', 'folke/neodev.nvim')
if _NgConfigValues.mason then
require('navigator.lazyloader').load('mason.nvim', 'williamboman/mason.nvim')
require('navigator.lazyloader').load('mason-lspconfig.nvim', 'williamboman/mason-lspconfig.nvim')
end
local setups = require('navigator.lspclient.clients_default').defaults()
local servers = require('navigator.lspclient.servers')
local lsp_mason_servers = {}
@ -81,6 +73,8 @@ local ng_default_cfg = {
-- check and load based on file type
local function load_cfg(ft, client, cfg, loaded, starting)
local setups = require('navigator.lspclient.clients_default').defaults()
log(ft, client, loaded, starting)
trace(cfg)
if lspconfig[client] == nil then
@ -218,6 +212,7 @@ end
local loaded = {}
local function lsp_startup(ft, retry, user_lsp_opts)
local setups = require('navigator.lspclient.clients_default').defaults()
retry = retry or false
local path_sep = require('navigator.util').path_sep()
local capabilities = update_capabilities()

@ -68,18 +68,6 @@ local function sumneko_lua()
},
setup_jsonls = true,
}
local user_luadev = _NgConfigValues.lsp['neodev']
if user_luadev then
luadevcfg = vim.tbl_deep_extend('force', luadevcfg, user_luadev)
end
require('navigator.lazyloader').load('neodev.nvim', 'folke/neodev.nvim')
local ok, l = pcall(require, 'neodev')
if ok and l then
l.setup(luadevcfg)
end
return sumneko_cfg
end

Loading…
Cancel
Save