From 8f6bdd213247ecdc88e5061904bfbf2e6a5e35cc Mon Sep 17 00:00:00 2001 From: Emma <4430224+justiceenunciate@users.noreply.github.com> Date: Sun, 6 Oct 2024 00:57:55 +0000 Subject: fix(fennel-ls): use closest cfg as root directory and fallback to git repo root (#3325) Co-authored-by: Emma --- lua/lspconfig/configs/fennel_ls.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'lua/lspconfig') diff --git a/lua/lspconfig/configs/fennel_ls.lua b/lua/lspconfig/configs/fennel_ls.lua index aa4f643b..f125d54f 100644 --- a/lua/lspconfig/configs/fennel_ls.lua +++ b/lua/lspconfig/configs/fennel_ls.lua @@ -5,7 +5,10 @@ return { cmd = { 'fennel-ls' }, filetypes = { 'fennel' }, root_dir = function(dir) - return util.find_git_ancestor(dir) + local has_fls_project_cfg = function(path) + return util.path.is_file(vim.fs.joinpath(path, 'flsproject.fnl')) + end + return util.search_ancestors(dir, has_fls_project_cfg) or vim.fs.root(0, '.git') end, settings = {}, capabilities = { @@ -17,6 +20,9 @@ return { https://sr.ht/~xerool/fennel-ls/ A language server for fennel. + +fennel-ls is configured using the closest file to your working directory named `flsproject.fnl`. +All fennel-ls configuration options [can be found here](https://git.sr.ht/~xerool/fennel-ls/tree/HEAD/docs/manual.md#configuration). ]], }, } -- cgit v1.2.3-70-g09d2