Update lspconfig

This commit is contained in:
sfigato 2023-04-16 11:45:06 -03:00
parent 4dd9b137eb
commit b342c1154a
Signed by: blallo
GPG Key ID: C530464EEDCF489A

View File

@ -6,13 +6,13 @@ local configs = require('lspconfig.configs')
if not configs.harepls then
configs.harepls = {
default_config = {
cmd = { '/home/leo/code/hare/harepls/harepls' };
filetypes = { 'hare' };
cmd = { '/home/leo/code/hare/harepls/harepls' },
filetypes = { 'hare' },
root_dir = function(fname)
return nvim_lsp.util.find_git_ancestor(fname)
end;
settings = {};
};
end,
settings = {},
},
}
end
@ -57,7 +57,7 @@ local on_attach = function(client, bufrn)
buf_set_keymap('n', ']d', '<cmd>lua vim.lsp.diagnostic.goto_next()<CR>', opts, "LSP", "goto_next", "Go to next")
buf_set_keymap('n', '<space>q', '<cmd>lua vim.lsp.diagnostic.set_loclist()<CR>', opts, "LSP", "set_loclist",
"Set loclist")
buf_set_keymap('n', '<space>f', '<cmd>lua vim.lsp.buf.formatting()<CR>', opts, "LSP", "formatting", "Format")
buf_set_keymap('n', '<space>f', '<cmd>lua vim.lsp.buf.format()<CR>', opts, "LSP", "formatting", "Format")
end
-- Launch language servers
@ -102,7 +102,7 @@ local runtime_path = vim.split(package.path, ';')
table.insert(runtime_path, "lua/?.lua")
table.insert(runtime_path, "lua/?/init.lua")
require 'lspconfig'.sumneko_lua.setup {
require 'lspconfig'.lua_ls.setup {
settings = {
Lua = {
runtime = {
@ -143,4 +143,6 @@ vim.keymap.set(
-- Format on save
vim.cmd [[autocmd BufWritePre <buffer> lua vim.lsp.buf.formatting_sync()]]
vim.cmd [[autocmd BufWritePre <buffer> lua vim.lsp.buf.format()]]
return servers