Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,16 @@ elixir.setup {
-- not currently supported by elixirls, but can be a table if you wish to pass other args `{"path/to/elixirls", "--foo"}`
cmd = "/usr/local/bin/elixir-ls.sh",

-- extension point to link in to server specific commands
-- by default, the codelens action below runs a default test runner in a terminal buffer
-- replacing it as shown here will override default behavior, allow running a custom function instead
-- `args` are anything the lsp command passes back to the callback function
commands = {
["elixir.lens.test.run"] = function(args)
-- custom functionality here as needed
end
},

-- default settings, use the `settings` function to override settings
settings = elixirls.settings {
dialyzerEnabled = true,
Expand Down
9 changes: 6 additions & 3 deletions lua/elixir/elixirls/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -318,12 +318,15 @@ function M.setup(opts)

if root_dir then
local log_message = vim.lsp.handlers["window/logMessage"]

local commands = vim.tbl_extend("force", {
["elixir.lens.test.run"] = test,
}, opts.commands or {})

vim.lsp.start(vim.tbl_extend("keep", {
name = "ElixirLS",
cmd = opts.cmd and wrap_in_table(opts.cmd) or { tostring(cmd) },
commands = {
["elixir.lens.test.run"] = test,
},
commands = commands,
settings = opts.settings or M.settings {},
capabilities = opts.capabilities or capabilities,
root_dir = root_dir,
Expand Down
Loading