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
|
||||
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
|
||||
|
||||
|
@ -44,7 +44,7 @@ local on_attach = function(client, bufrn)
|
|||
buf_set_keymap('n', '<space>wr', '<cmd>lua vim.lsp.buf.remove_workspace_folder()<CR>', opts, "LSP",
|
||||
"remove_workspace_folder", "Remove workspace folder")
|
||||
buf_set_keymap('n', '<space>wl', '<cmd>lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))<CR>', opts, "LSP"
|
||||
, "list_workspace_folders", "List workspace folder")
|
||||
, "list_workspace_folders", "List workspace folder")
|
||||
buf_set_keymap('n', '<space>D', '<cmd>lua vim.lsp.buf.type_definition()<CR>', opts, "LSP", "type_definition",
|
||||
"Show type definition")
|
||||
buf_set_keymap('n', '<space>rn', '<cmd>lua vim.lsp.buf.rename()<CR>', opts, "LSP", "rename", "Rename")
|
||||
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user