diff --git a/lua/lspconfig/configs/crystalline.lua b/lua/lspconfig/configs/crystalline.lua index 9cf4841e3c..0b321f2ba8 100644 --- a/lua/lspconfig/configs/crystalline.lua +++ b/lua/lspconfig/configs/crystalline.lua @@ -5,7 +5,8 @@ return { cmd = { 'crystalline' }, filetypes = { 'crystal' }, root_dir = function(fname) - return util.root_pattern 'shard.yml' or vim.fs.dirname(vim.fs.find('.git', { path = fname, upward = true })[1]) + return util.root_pattern('shard.yml')(fname) + or vim.fs.dirname(vim.fs.find('.git', { path = fname, upward = true })[1]) end, single_file_support = true, }, diff --git a/lua/lspconfig/configs/janet_lsp.lua b/lua/lspconfig/configs/janet_lsp.lua index 5d3ca1d59d..ce0908ad2e 100644 --- a/lua/lspconfig/configs/janet_lsp.lua +++ b/lua/lspconfig/configs/janet_lsp.lua @@ -8,7 +8,7 @@ return { }, filetypes = { 'janet' }, root_dir = function(fname) - return util.root_pattern 'project.janet' + return util.root_pattern('project.janet')(fname) or vim.fs.dirname(vim.fs.find('.git', { path = fname, upward = true })[1]) end, single_file_support = true, diff --git a/lua/lspconfig/configs/ruff.lua b/lua/lspconfig/configs/ruff.lua index dbe5718b2b..bec2254b3b 100644 --- a/lua/lspconfig/configs/ruff.lua +++ b/lua/lspconfig/configs/ruff.lua @@ -5,7 +5,7 @@ return { cmd = { 'ruff', 'server' }, filetypes = { 'python' }, root_dir = function(fname) - return util.root_pattern('pyproject.toml', 'ruff.toml', '.ruff.toml') + return util.root_pattern('pyproject.toml', 'ruff.toml', '.ruff.toml')(fname) or vim.fs.dirname(vim.fs.find('.git', { path = fname, upward = true })[1]) end, single_file_support = true, diff --git a/lua/lspconfig/configs/ruff_lsp.lua b/lua/lspconfig/configs/ruff_lsp.lua index e304a52254..ea00352bd7 100644 --- a/lua/lspconfig/configs/ruff_lsp.lua +++ b/lua/lspconfig/configs/ruff_lsp.lua @@ -5,7 +5,7 @@ return { cmd = { 'ruff-lsp' }, filetypes = { 'python' }, root_dir = function(fname) - return util.root_pattern('pyproject.toml', 'ruff.toml') + return util.root_pattern('pyproject.toml', 'ruff.toml')(fname) or vim.fs.dirname(vim.fs.find('.git', { path = fname, upward = true })[1]) end, single_file_support = true,