summaryrefslogtreecommitdiff
path: root/lua/lsp/lua-ls.lua
diff options
context:
space:
mode:
authorchristianchiarulli <[email protected]>2021-06-30 18:45:40 -0400
committerchristianchiarulli <[email protected]>2021-06-30 18:45:40 -0400
commit9e7ad6074746a3f7d60e164be919b53ad17a33dd (patch)
tree6ccd7982f850908d317945fd8967119b298c4ffb /lua/lsp/lua-ls.lua
parentd8cf871a389d9900fa21077870a817cdb6a6b47b (diff)
refactor autocommands
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
+