From f94a0591b3e5838794b1c3897ec21491aeb080fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?George=20Guimar=C3=A3es?= Date: Mon, 22 Jul 2024 15:11:30 -0700 Subject: [PATCH] feat(elixir): add elixirls code actions (#4148) This is a refactoring of #3846 with the changes: - Use `Lazyvim.lsp.execute` on keymaps to make everything simpler; - Remove expandMacro. Closes #3846 --------- Co-authored-by: Ahmed Kamal --- lua/lazyvim/plugins/extras/lang/elixir.lua | 27 +++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/extras/lang/elixir.lua b/lua/lazyvim/plugins/extras/lang/elixir.lua index d82e988e..f391edbd 100644 --- a/lua/lazyvim/plugins/extras/lang/elixir.lua +++ b/lua/lazyvim/plugins/extras/lang/elixir.lua @@ -9,7 +9,32 @@ return { "neovim/nvim-lspconfig", opts = { servers = { - elixirls = {}, + elixirls = { + keys = { + { + "cp", + function() + local params = vim.lsp.util.make_position_params() + LazyVim.lsp.execute({ + command = "manipulatePipes:serverid", + arguments = { "toPipe", params.textDocument.uri, params.position.line, params.position.character }, + }) + end, + desc = "To Pipe", + }, + { + "cP", + function() + local params = vim.lsp.util.make_position_params() + LazyVim.lsp.execute({ + command = "manipulatePipes:serverid", + arguments = { "fromPipe", params.textDocument.uri, params.position.line, params.position.character }, + }) + end, + desc = "From Pipe", + }, + }, + }, }, }, },