refactor(lsp): move lua defaults to provider
This commit is contained in:
parent
16884c1c09
commit
a96c4cc23d
3 changed files with 20 additions and 20 deletions
|
@ -38,26 +38,6 @@ local default_config = {
|
||||||
format = true,
|
format = true,
|
||||||
disable_formatters = { 'eslint' }, -- e.g. 'eslint', 'prettier', 'stylua'
|
disable_formatters = { 'eslint' }, -- e.g. 'eslint', 'prettier', 'stylua'
|
||||||
},
|
},
|
||||||
sumneko_lua = {
|
|
||||||
opts = {
|
|
||||||
settings = {
|
|
||||||
Lua = {
|
|
||||||
diagnostics = {
|
|
||||||
-- Get the language server to recognize the `vim` global
|
|
||||||
globals = { 'vim' },
|
|
||||||
},
|
|
||||||
workspace = {
|
|
||||||
-- Make the server aware of Neovim runtime files
|
|
||||||
library = {
|
|
||||||
[vim.fn.expand('$VIMRUNTIME/lua')] = true,
|
|
||||||
[vim.fn.expand('$VIMRUNTIME/lua/vim/lsp')] = true,
|
|
||||||
},
|
|
||||||
maxPreload = 10000,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
tsserver = {
|
tsserver = {
|
||||||
format = false, -- disable formatting all together
|
format = false, -- disable formatting all together
|
||||||
},
|
},
|
||||||
|
|
|
@ -67,6 +67,8 @@ lsp_installer.on_server_ready(function(server)
|
||||||
opts = vim.tbl_deep_extend('force', opts, require('cosmic.lsp.providers.efm'))
|
opts = vim.tbl_deep_extend('force', opts, require('cosmic.lsp.providers.efm'))
|
||||||
elseif server.name == 'jsonls' then
|
elseif server.name == 'jsonls' then
|
||||||
opts = vim.tbl_deep_extend('force', opts, require('cosmic.lsp.providers.jsonls'))
|
opts = vim.tbl_deep_extend('force', opts, require('cosmic.lsp.providers.jsonls'))
|
||||||
|
elseif server.name == 'sumneko_lua' then
|
||||||
|
opts = vim.tbl_deep_extend('force', opts, require('cosmic.lsp.providers.lua'))
|
||||||
elseif server.name == 'eslint' then
|
elseif server.name == 'eslint' then
|
||||||
opts = vim.tbl_deep_extend('force', opts, require('cosmic.lsp.providers.eslint'))
|
opts = vim.tbl_deep_extend('force', opts, require('cosmic.lsp.providers.eslint'))
|
||||||
end
|
end
|
||||||
|
|
18
lua/cosmic/lsp/providers/lua.lua
Normal file
18
lua/cosmic/lsp/providers/lua.lua
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
return {
|
||||||
|
settings = {
|
||||||
|
Lua = {
|
||||||
|
diagnostics = {
|
||||||
|
-- Get the language server to recognize the `vim` global
|
||||||
|
globals = { 'vim' },
|
||||||
|
},
|
||||||
|
workspace = {
|
||||||
|
-- Make the server aware of Neovim runtime files
|
||||||
|
library = {
|
||||||
|
[vim.fn.expand('$VIMRUNTIME/lua')] = true,
|
||||||
|
[vim.fn.expand('$VIMRUNTIME/lua/vim/lsp')] = true,
|
||||||
|
},
|
||||||
|
maxPreload = 10000,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue