Update lspconfig
This commit is contained in:
parent
4dd9b137eb
commit
b342c1154a
|
@ -6,13 +6,13 @@ local configs = require('lspconfig.configs')
|
||||||
if not configs.harepls then
|
if not configs.harepls then
|
||||||
configs.harepls = {
|
configs.harepls = {
|
||||||
default_config = {
|
default_config = {
|
||||||
cmd = { '/home/leo/code/hare/harepls/harepls' };
|
cmd = { '/home/leo/code/hare/harepls/harepls' },
|
||||||
filetypes = { 'hare' };
|
filetypes = { 'hare' },
|
||||||
root_dir = function(fname)
|
root_dir = function(fname)
|
||||||
return nvim_lsp.util.find_git_ancestor(fname)
|
return nvim_lsp.util.find_git_ancestor(fname)
|
||||||
end;
|
end,
|
||||||
settings = {};
|
settings = {},
|
||||||
};
|
},
|
||||||
}
|
}
|
||||||
end
|
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', ']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",
|
buf_set_keymap('n', '<space>q', '<cmd>lua vim.lsp.diagnostic.set_loclist()<CR>', opts, "LSP", "set_loclist",
|
||||||
"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
|
end
|
||||||
|
|
||||||
-- Launch language servers
|
-- 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/?.lua")
|
||||||
table.insert(runtime_path, "lua/?/init.lua")
|
table.insert(runtime_path, "lua/?/init.lua")
|
||||||
|
|
||||||
require 'lspconfig'.sumneko_lua.setup {
|
require 'lspconfig'.lua_ls.setup {
|
||||||
settings = {
|
settings = {
|
||||||
Lua = {
|
Lua = {
|
||||||
runtime = {
|
runtime = {
|
||||||
|
@ -143,4 +143,6 @@ vim.keymap.set(
|
||||||
|
|
||||||
|
|
||||||
-- Format on save
|
-- 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
|
||||||
|
|
Loading…
Reference in New Issue
Block a user