From d4991d5aac3c4ab5865e65d73fb8957b3d61bdc3 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 19 Jun 2024 18:25:56 +0200 Subject: [PATCH] fix(root): also check root_dir. Fixes #3732 --- lua/lazyvim/util/root.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lua/lazyvim/util/root.lua b/lua/lazyvim/util/root.lua index a401ccf4..fc81e92f 100644 --- a/lua/lazyvim/util/root.lua +++ b/lua/lazyvim/util/root.lua @@ -30,12 +30,13 @@ function M.detectors.lsp(buf) end local roots = {} ---@type string[] for _, client in pairs(LazyVim.lsp.get_clients({ bufnr = buf })) do - -- only check workspace folders, since we're not interested in clients - -- running in single file mode local workspace = client.config.workspace_folders for _, ws in pairs(workspace or {}) do roots[#roots + 1] = vim.uri_to_fname(ws.uri) end + if client.root_dir then + roots[#roots + 1] = client.root_dir + end end return vim.tbl_filter(function(path) path = LazyVim.norm(path)