Skip to content

Commit d89d774

Browse files
committed
fix(nextls): correctly find root dir
1 parent cc14cde commit d89d774

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

lua/elixir/nextls/init.lua

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,19 @@ function M.setup(opts)
4949
group = nextls_group,
5050
pattern = { "elixir", "eelixir", "heex", "surface" },
5151
callback = function()
52-
local matches = vim.fs.find({ "mix.lock", "mix.exs" }, {
52+
local lock_matches = vim.fs.find({ "mix.lock" }, {
5353
stop = vim.uv.os_homedir(),
5454
upward = true,
5555
path = vim.fs.dirname(vim.api.nvim_buf_get_name(0)),
5656
})
5757

58-
local file = matches[1]
58+
local mix_exs_matches = vim.fs.find({ "mix.exs" }, {
59+
stop = vim.uv.os_homedir(),
60+
upward = true,
61+
path = vim.fs.dirname(vim.api.nvim_buf_get_name(0)),
62+
})
63+
64+
local file = lock_matches[1] or mix_exs_matches[1]
5965

6066
if file then
6167
local cmd

0 commit comments

Comments
 (0)