summaryrefslogtreecommitdiff
path: root/lua/lsp/lua-ls.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua/lsp/lua-ls.lua')
-rw-r--r--lua/lsp/lua-ls.lua16
1 files changed, 15 insertions, 1 deletions
diff --git a/lua/lsp/lua-ls.lua b/lua/lsp/lua-ls.lua
index 775eb92f..4257605f 100644
--- a/lua/lsp/lua-ls.lua
+++ b/lua/lsp/lua-ls.lua
@@ -19,9 +19,23 @@ require'lspconfig'.sumneko_lua.setup {
},
workspace = {
-- Make the server aware of Neovim runtime files
- library = {[vim.fn.expand('$VIMRUNTIME/lua')] = true, [vim.fn.expand('$VIMRUNTIME/lua/vim/lsp')] = true},
+ library = {
+ [vim.fn.expand('$VIMRUNTIME/lua')] = true,
+ [vim.fn.expand('$VIMRUNTIME/lua/vim/lsp')] = true
+ },
maxPreload = 10000
}
}
}
}
+if O.lang.lua.autoformat then
+ require('lv-utils').define_augroups({
+ _lua_autoformat = {
+ {
+ 'BufWritePre', '*.lua',
+ 'lua vim.lsp.buf.formatting_sync(nil, 1000)'
+ }
+ }
+ })
+end
+