Skip to content

Commit

Permalink
fix(elixirls): root_dir priority: mix.exs > .git (#2910)
Browse files Browse the repository at this point in the history
If we're in a subdirectory of a git repo, and that subdirectory contains
a mix.exs file, it makes sense to assume the subdirectory is the project
root, rather than the git repo root.
  • Loading branch information
giddie authored Nov 22, 2023
1 parent addad51 commit 3ede70c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lua/lspconfig/server_configurations/elixirls.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ return {
default_config = {
filetypes = { 'elixir', 'eelixir', 'heex', 'surface' },
root_dir = function(fname)
return util.find_git_ancestor(fname) or util.root_pattern 'mix.exs'(fname) or vim.loop.os_homedir()
return util.root_pattern 'mix.exs'(fname) or util.find_git_ancestor(fname) or vim.loop.os_homedir()
end,
},
docs = {
Expand Down

0 comments on commit 3ede70c

Please sign in to comment.