From d9e7713044edff63400c7b79e91e967a2a2f9817 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Wed, 3 Sep 2025 21:00:17 -0400 Subject: docs, lint #4055 --- lsp/elixirls.lua | 10 ++++++++-- lsp/expert.lua | 4 ++-- 2 files changed, 10 insertions(+), 4 deletions(-) (limited to 'lsp') diff --git a/lsp/elixirls.lua b/lsp/elixirls.lua index 2876ad28..da7b7b31 100644 --- a/lsp/elixirls.lua +++ b/lsp/elixirls.lua @@ -12,7 +12,9 @@ --- chmod +x /path/to/elixir-ls/language_server.sh --- ``` --- ---- **By default, elixir-ls doesn't have a `cmd` set.** This is because nvim-lspconfig does not make assumptions about your path. You must add the following to your init.vim or init.lua to set `cmd` to the absolute path ($HOME and ~ are not expanded) of your unzipped elixir-ls. +--- **By default, elixir-ls doesn't have a `cmd` set.** This is because nvim-lspconfig does not make assumptions about +--- your path. You must add the following to your init.vim or init.lua to set `cmd` to the absolute path ($HOME and +--- ~ are not expanded) of your unzipped elixir-ls. --- --- ```lua --- vim.lsp.config('elixirls', { @@ -24,13 +26,17 @@ --- }) --- ``` --- ---- 'root_dir' is chosen like this: if two or more directories containing `mix.exs` were found when searching directories upward, the second one (higher up) is chosen, with the assumption that it is the root of an umbrella app. Otherwise the directory containing the single mix.exs that was found is chosen. +--- 'root_dir' is chosen like this: if two or more directories containing `mix.exs` were found when searching +--- directories upward, the second one (higher up) is chosen, with the assumption that it is the root of an umbrella +--- app. Otherwise the directory containing the single mix.exs that was found is chosen. ---@type vim.lsp.Config return { filetypes = { 'elixir', 'eelixir', 'heex', 'surface' }, root_dir = function(bufnr, on_dir) local fname = vim.api.nvim_buf_get_name(bufnr) + --- Elixir workspaces may have multiple `mix.exs` files, for an "umbrella" layout or monorepo. + --- So we specify `limit=2` and treat the highest one (if any) as the root of an umbrella app. local matches = vim.fs.find({ 'mix.exs' }, { upward = true, limit = 2, path = fname }) local child_or_root_path, maybe_umbrella_path = unpack(matches) local root_dir = vim.fs.dirname(maybe_umbrella_path or child_or_root_path) diff --git a/lsp/expert.lua b/lsp/expert.lua index 971e3de4..f7146a69 100644 --- a/lsp/expert.lua +++ b/lsp/expert.lua @@ -15,8 +15,8 @@ return { cmd = { 'expert' }, root_dir = function(bufnr, on_dir) local fname = vim.api.nvim_buf_get_name(bufnr) - --- Elixir workspaces may have `mix.exs` files, e.g. for an "umbrella" layout or monorepo. So we - --- specify `limit=2` and treat the highest one (if any) as the root of an umbrella app. + --- Elixir workspaces may have multiple `mix.exs` files, for an "umbrella" layout or monorepo. + --- So we specify `limit=2` and treat the highest one (if any) as the root of an umbrella app. local matches = vim.fs.find({ 'mix.exs' }, { upward = true, limit = 2, path = fname }) local child_or_root_path, maybe_umbrella_path = unpack(matches) local root_dir = vim.fs.dirname(maybe_umbrella_path or child_or_root_path) -- cgit v1.2.3-70-g09d2