nvim: Enable LSP for Elixir
This commit is contained in:
parent
9cddec5e81
commit
18106532fc
2 changed files with 18 additions and 0 deletions
4
nvim/.config/nvim/after/ftplugin/elixir.lua
Normal file
4
nvim/.config/nvim/after/ftplugin/elixir.lua
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
local lsp_utils = require('lsp-utils')
|
||||||
|
local elixir_config = lsp_utils.elixir_config()
|
||||||
|
|
||||||
|
vim.lsp.start(elixir_config)
|
|
@ -163,6 +163,20 @@ function M.deno_config()
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function M.elixir_config()
|
||||||
|
local root_files = { 'mix.exs' }
|
||||||
|
local root_directory = get_root_directory(root_files)
|
||||||
|
|
||||||
|
return {
|
||||||
|
name = "elixirls",
|
||||||
|
cmd = { "elixir-ls" },
|
||||||
|
capabilities = default_capabilities,
|
||||||
|
root_dir = root_directory,
|
||||||
|
filetypes = { 'elixir', 'eelixir', 'heex', 'surface' },
|
||||||
|
single_file_support = true,
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
function M.gopls_config()
|
function M.gopls_config()
|
||||||
local root_files = { 'go.mod', 'go.work', '.git' }
|
local root_files = { 'go.mod', 'go.work', '.git' }
|
||||||
local root_directory = get_root_directory(root_files)
|
local root_directory = get_root_directory(root_files)
|
||||||
|
|
Loading…
Reference in a new issue