@@ -203,7 +203,7 @@ M.table = {
203
203
204
204
--- if opt is a function, call it with args; otherwise, return a copy of opt
205
205
--- @param opt any
206
- --- @vararg any args
206
+ --- @param ... any args
207
207
--- @return any
208
208
M .handle_function_opt = function (opt , ...)
209
209
if type (opt ) == " function" then
@@ -283,7 +283,7 @@ M.path = {
283
283
--- @alias root_pattern_cb fun ( root_dir : string | nil )
284
284
285
285
--- creates a callback that returns the first root matching a specified pattern
286
- --- @vararg string patterns
286
+ --- @param ... string patterns
287
287
--- @return fun ( startpath : string , root_pattern_cb ): nil root_dir
288
288
M .root_pattern_async = function (...)
289
289
local patterns = util .tbl_flatten ({ ... })
@@ -318,7 +318,7 @@ M.root_pattern_async = function(...)
318
318
end
319
319
320
320
--- creates a callback that returns the first root matching a specified pattern
321
- --- @vararg string patterns
321
+ --- @param ... string patterns
322
322
--- @return fun ( startpath : string ): string | nil root_dir
323
323
M .root_pattern = function (...)
324
324
local patterns = util .tbl_flatten ({ ... })
@@ -331,7 +331,6 @@ M.root_pattern = function(...)
331
331
-- escape wildcard characters in the path so that it is not treated like a glob
332
332
path = path :gsub (" ([%[%]%?%*])" , " \\ %1" )
333
333
for _ , pattern in ipairs (patterns ) do
334
- --- @diagnostic disable-next-line : param-type-mismatch
335
334
for _ , p in ipairs (vim .fn .glob (M .path .join (path , pattern ), true , true )) do
336
335
if M .path .exists (p ) then
337
336
return path
@@ -352,10 +351,12 @@ M.root_pattern = function(...)
352
351
end
353
352
end
354
353
354
+ --- @module " null-ls.utils.make_params"
355
355
M .make_params = function (...)
356
356
return require (" null-ls.utils.make_params" )(... )
357
357
end
358
358
359
+ --- @module " null-ls.utils.cosmiconfig"
359
360
M .cosmiconfig = function (...)
360
361
return require (" null-ls.utils.cosmiconfig" )(... )
361
362
end
365
366
M .get_vcs_root = function ()
366
367
local cwd , err_name , err_msg = uv .cwd ()
367
368
assert (cwd , string.format (" [Error %s]: %s" , err_name , err_msg ))
368
- local vcs_root = M .root_pattern (" .git" , " .hg" , " .svn" , " .bzr" )(cwd )
369
+ local vcs_root = M .root_pattern (" .git" , " .hg" , " .svn" , " .bzr" , " .fossil " , " _darcs " , " .pijul " )(cwd )
369
370
return vcs_root
370
371
end
371
372
0 commit comments