issue #262 sumneko_lua deprecated

pull/268/head
ray-x 1 year ago
parent 11dfaa794a
commit 6dc7a842f7

@ -76,7 +76,7 @@ variable is:
- Async request with lsp.buf_request for reference search
- Treesitter symbol search. It is handy for large files (Some of LSP e.g. sumneko_lua, there is a 100kb file size limitation?). Also as LSP trying to hide details behind, Treesitter allows you to access all AST semantics.
- Treesitter symbol search. It is handy for large files (Some of LSP e.g. lua_ls, there is a 100kb file size limitation?). Also as LSP trying to hide details behind, Treesitter allows you to access all AST semantics.
- FZY search with either native C (if gcc installed) or Lua-JIT
@ -299,7 +299,7 @@ require'navigator'.setup({
-- disable: a blacklist of language that will not be formatted on save
-- function: function(bufnr) return true end to enable/disable lsp format on save
format_options = {async=false}, -- async: disable by default, the option used in vim.lsp.buf.format({async={true|false}, name = 'xxx'})
disable_format_cap = {"sqls", "sumneko_lua", "gopls"}, -- a list of lsp disable format capacity (e.g. if you using efm or vim-codeformat etc), empty {} by default
disable_format_cap = {"sqls", "lua_ls", "gopls"}, -- a list of lsp disable format capacity (e.g. if you using efm or vim-codeformat etc), empty {} by default
-- If you using null-ls and want null-ls format your code
-- you should disable all other lsp and allow only null-ls.
-- disable_lsp = {'pylsd', 'sqlls'}, -- prevents navigator from setting up this list of servers.
@ -352,7 +352,7 @@ require'navigator'.setup({
end
end,
sumneko_lua = {
lua_ls = {
sumneko_root_path = vim.fn.expand("$HOME") .. "/github/sumneko/lua-language-server",
sumneko_binary = vim.fn.expand("$HOME") .. "/github/sumneko/lua-language-server/bin/macOS/lua-language-server",
},
@ -372,7 +372,7 @@ Built clients:
```lua
local servers = {
"angularls", "gopls", "tsserver", "flow", "bashls", "dockerls", "julials", "pylsp", "pyright",
"jedi_language_server", "jdtls", "sumneko_lua", "vimls", "html", "jsonls", "solargraph", "cssls",
"jedi_language_server", "jdtls", "lua_ls", "vimls", "html", "jsonls", "solargraph", "cssls",
"yamlls", "clangd", "ccls", "sqls", "denols", "graphql", "dartls", "dotls",
"kotlin_language_server", "nimls", "intelephense", "vuels", "phpactor", "omnisharp",
"r_language_server", "rust_analyzer", "terraformls", "svelte", "texlab", "clojure_lsp", "elixirls",
@ -390,7 +390,7 @@ Other than above setup, additional none default setup are used for following lsp
- clangd
- rust_analyzer
- sqls
- sumneko_lua
- lua_ls
- pyright
- ccls

@ -96,7 +96,7 @@ _NgConfigValues = {
-- set to {} to disable the lspclient for all filetype
},
neodev = false,
sumneko_lua = {
lua_ls = {
-- sumneko_root_path = sumneko_root_path,
-- sumneko_binary = sumneko_binary,
-- cmd = {'lua-language-server'}
@ -158,6 +158,9 @@ M.deprecated = function(cfg)
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
if cfg.lsp and cfg.lsp.sumneko_lua then
warn('sumneko_lua option deprecated, refer to README for more details')
end
end
local extend_config = function(opts)
@ -234,9 +237,9 @@ local extend_config = function(opts)
end
end
end
if _NgConfigValues.sumneko_root_path or _NgConfigValues.sumneko_binary then
vim.notify("Please put sumneko setup in lsp['sumneko_lua']", vim.log.levels.WARN)
end
-- if _NgConfigValues.sumneko_root_path or _NgConfigValues.sumneko_binary then
-- vim.notify("Please put sumneko setup in lsp['lua_ls']", vim.log.levels.WARN)
-- end
M.deprecated(opts)
end

@ -13,7 +13,7 @@ M.current_buf_folds = {}
M.servers_supporting_folding = {
pylsp = true,
pyright = false,
sumneko_lua = true,
lua_ls = true,
texlab = true,
clangd = false,
gopls = true,

@ -564,16 +564,16 @@ local function setup(user_opts, cnt)
local lsp_opts = user_opts.lsp or {}
if vim.bo.filetype == 'lua' then
local slua = lsp_opts.sumneko_lua
local slua = lsp_opts.lua_ls
if slua and not slua.cmd then
if slua.sumneko_root_path and slua.sumneko_binary then
lsp_opts.sumneko_lua.cmd = {
lsp_opts.lua_ls.cmd = {
slua.sumneko_binary,
'-E',
slua.sumneko_root_path .. '/main.lua',
}
else
lsp_opts.sumneko_lua.cmd = { 'lua-language-server' }
lsp_opts.lua_ls.cmd = { 'lua-language-server' }
end
end
end

@ -188,7 +188,7 @@ M.defaults = function()
},
}
setups.sumneko_lua = require('navigator.lspclient.sumneko_lua').sumneko_lua()
setups.lua_ls = require('navigator.lspclient.lua_ls').lua_ls()
return setups
end

@ -11,7 +11,7 @@ local function add(lib)
end
end
end
local function sumneko_lua()
local function lua_ls()
-- add runtime
-- add plugins it may be very slow to add all in path
add('$VIMRUNTIME')
@ -62,5 +62,5 @@ local function sumneko_lua()
end
return {
sumneko_lua = sumneko_lua,
lua_ls = lua_ls,
}

@ -10,7 +10,7 @@ return {
'pyright',
'jedi_language_server',
'jdtls',
'sumneko_lua',
'lua_ls',
'vimls',
'html',
'jsonls',

@ -126,7 +126,7 @@ function M.get_tsnode_at_pos(pos, bufnr, ignore_injected_langs)
if ignore_injected_langs then
for _, tree in ipairs(root_lang_tree:trees()) do
local tree_root = tree:root()
if tree_root and ts_utils.is_in_node_range(tree_root, cursor_range[1], cursor_range[2]) then
if tree_root and vim.treesitter.is_in_node_range(tree_root, cursor_range[1], cursor_range[2]) then
root = tree_root
break
end

Loading…
Cancel
Save