Skip to content

Commit

Permalink
refactor!: deprecate util.root_pattern
Browse files Browse the repository at this point in the history
This will be breaking primarily for language servers that rely on
code dependencies that is archived but still needs to be read. More
context: neovim#1687.

Work on neovim#2079.
  • Loading branch information
dundargoc committed Jan 20, 2025
1 parent 9ee2e7d commit 704f2d0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
5 changes: 1 addition & 4 deletions lua/lspconfig/configs/crystalline.lua
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
local util = require 'lspconfig.util'

return {
default_config = {
cmd = { 'crystalline' },
filetypes = { 'crystal' },
root_dir = function(fname)
return util.root_pattern('shard.yml')(fname)
or vim.fs.dirname(vim.fs.find('.git', { path = fname, upward = true })[1])
return vim.fs.dirname(vim.fs.find({ '.git', 'shard.yml' }, { path = fname, upward = true })[1])
end,
single_file_support = true,
},
Expand Down
5 changes: 1 addition & 4 deletions lua/lspconfig/configs/sourcery.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
local util = require 'lspconfig.util'

local root_files = {
'pyproject.toml',
'setup.py',
Expand Down Expand Up @@ -38,8 +36,7 @@ return {
token = nil,
},
root_dir = function(fname)
return util.root_pattern(unpack(root_files))(fname)
or vim.fs.dirname(vim.fs.find('.git', { path = fname, upward = true })[1])
return vim.fs.dirname(vim.fs.find({ '.git', unpack(root_files) }, { path = fname, upward = true })[1])
end,
single_file_support = true,
},
Expand Down

0 comments on commit 704f2d0

Please sign in to comment.