sumneko cfg refact

pull/268/head
ray-x 1 year ago
parent 1b2a0856f4
commit 0a6f7bff15

@ -1,9 +1,29 @@
local vfn = vim.fn
local on_attach = require('navigator.lspclient.attach').on_attach
local library = {}
local function add(lib)
for _, p in pairs(vfn.expand(lib, false, true)) do
p = vim.loop.fs_realpath(p)
if p then
library[p] = true
end
end
end
local function sumneko_lua()
-- add runtime
-- add plugins it may be very slow to add all in path
add('$VIMRUNTIME')
-- add your config
-- local home = vfn.expand("$HOME")
add(vfn.stdpath('config'))
local on_attach = require('navigator.lspclient.attach').on_attach
local sumneko_cfg = {
library[vfn.expand('$VIMRUNTIME/lua')] = true
library[vfn.expand('$VIMRUNTIME/lua/vim')] = true
library[vfn.expand('$VIMRUNTIME/lua/vim/lsp')] = true
return {
cmd = { 'lua-language-server' },
filetypes = { 'lua' },
on_attach = on_attach,
@ -37,38 +57,7 @@ local sumneko_cfg = {
cfg.settings.Lua.workspace.library = libs
return cfg
end,
}
local function add(lib)
for _, p in pairs(vfn.expand(lib, false, true)) do
p = vim.loop.fs_realpath(p)
if p then
library[p] = true
end
end
end
local function sumneko_lua()
-- add runtime
-- add plugins it may be very slow to add all in path
add('$VIMRUNTIME')
-- add your config
-- local home = vfn.expand("$HOME")
add(vfn.stdpath('config'))
library[vfn.expand('$VIMRUNTIME/lua')] = true
library[vfn.expand('$VIMRUNTIME/lua/vim')] = true
library[vfn.expand('$VIMRUNTIME/lua/vim/lsp')] = true
local luadevcfg = {
library = {
enabled = true, -- runtime path
runtime = true,
types = true, -- full signature, docs and completion of vim.api, vim.treesitter, vim.lsp and others
plugins = { 'nvim-treesitter', 'plenary.nvim' },
},
setup_jsonls = true,
}
return sumneko_cfg
end
return {

Loading…
Cancel
Save