Skip to content

Commit

Permalink
fix(ruff, ruff_lsp, crystalline, janet_lsp): returning a function fro…
Browse files Browse the repository at this point in the history
…m root pattern (#3513)

* fix(ruff, ruff_lsp): error returning the function returned by util.root_pattern on lsp start

* fix(crystalline, janet_lsp): invoke function returned by root pattern
  • Loading branch information
apostolos-geyer authored Dec 15, 2024
1 parent c502e4d commit ae8a01b
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion lua/lspconfig/configs/crystalline.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
Expand Down
2 changes: 1 addition & 1 deletion lua/lspconfig/configs/janet_lsp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion lua/lspconfig/configs/ruff.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion lua/lspconfig/configs/ruff_lsp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit ae8a01b

Please sign in to comment.