diff --git a/lua/lspconfig/server_configurations/elixirls.lua b/lua/lspconfig/server_configurations/elixirls.lua index 1450b3e4af..8f56dbc140 100644 --- a/lua/lspconfig/server_configurations/elixirls.lua +++ b/lua/lspconfig/server_configurations/elixirls.lua @@ -4,7 +4,7 @@ return { default_config = { filetypes = { 'elixir', 'eelixir', 'heex', 'surface' }, root_dir = function(fname) - return util.root_pattern('mix.exs', '.git')(fname) or vim.loop.os_homedir() + return util.find_git_ancestor(fname) or util.root_pattern("mix.exs")(fname) or vim.loop.os_homedir() end, }, docs = { @@ -33,7 +33,7 @@ require'lspconfig'.elixirls.setup{ ``` ]], default_config = { - root_dir = [[root_pattern("mix.exs", ".git") or vim.loop.os_homedir()]], + root_dir = [[util.find_git_ancestor(fname) or util.root_pattern("mix.exs")(fname) or vim.loop.os_homedir()]], }, }, }