Skip to content

Commit 4ea9083

Browse files
authored
refactor: replace vim.loop with vim.uv #3703
The former is deprecated in neovim 0.10. Remove the check added in 9b89ba5. See: https://github.com/neovim/neovim/blob/v0.10.0/runtime/doc/deprecated.txt#L55
1 parent 94dda50 commit 4ea9083

26 files changed

+37
-46
lines changed

.github/ci/run_sanitizer.sh

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,3 @@ if git diff --pickaxe-all -U0 -G "${SEARCH_PATTERN}" "${REF_BRANCH}" "${PR_BRANC
2222
echo 'Do not use deprecated util functions: '"${SEARCH_PATTERN}"
2323
exit 1
2424
fi
25-
26-
SEARCH_PATTERN='(vim\.uv)'
27-
28-
if git diff --pickaxe-all -U0 -G "${SEARCH_PATTERN}" "${REF_BRANCH}" "${PR_BRANCH}" -- '*.lua' | grep -Ev '\.lua$' | grep -E "^\+.*${SEARCH_PATTERN}" ; then
29-
echo
30-
echo 'Do not use modules that are too new: '"${SEARCH_PATTERN}"
31-
echo 'Consult README to check the minimum supported neovim version.'
32-
exit 1
33-
fi

doc/configs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6279,7 +6279,7 @@ require'lspconfig'.lua_ls.setup {
62796279
on_init = function(client)
62806280
if client.workspace_folders then
62816281
local path = client.workspace_folders[1].name
6282-
if path ~= vim.fn.stdpath('config') and (vim.loop.fs_stat(path..'/.luarc.json') or vim.loop.fs_stat(path..'/.luarc.jsonc')) then
6282+
if path ~= vim.fn.stdpath('config') and (vim.uv.fs_stat(path..'/.luarc.json') or vim.uv.fs_stat(path..'/.luarc.jsonc')) then
62836283
return
62846284
end
62856285
end

doc/configs.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5757,7 +5757,7 @@ require'lspconfig'.lua_ls.setup {
57575757
on_init = function(client)
57585758
if client.workspace_folders then
57595759
local path = client.workspace_folders[1].name
5760-
if path ~= vim.fn.stdpath('config') and (vim.loop.fs_stat(path..'/.luarc.json') or vim.loop.fs_stat(path..'/.luarc.jsonc')) then
5760+
if path ~= vim.fn.stdpath('config') and (vim.uv.fs_stat(path..'/.luarc.json') or vim.uv.fs_stat(path..'/.luarc.jsonc')) then
57615761
return
57625762
end
57635763
end

lua/lspconfig/configs.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ function configs.__newindex(t, config_name, config_def)
9898
return
9999
end
100100

101-
local pwd = vim.loop.cwd()
101+
local pwd = vim.uv.cwd()
102102

103103
async.run(function()
104104
local root_dir

lua/lspconfig/configs/angularls.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ local function get_angular_core_version(root_dir)
1717
end
1818

1919
local package_json = project_root .. '/package.json'
20-
if not vim.loop.fs_stat(package_json) then
20+
if not vim.uv.fs_stat(package_json) then
2121
return ''
2222
end
2323

lua/lspconfig/configs/eslint.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ return {
125125
-- Support Yarn2 (PnP) projects
126126
local pnp_cjs = new_root_dir .. '/.pnp.cjs'
127127
local pnp_js = new_root_dir .. '/.pnp.js'
128-
if vim.loop.fs_stat(pnp_cjs) or vim.loop.fs_stat(pnp_js) then
128+
if vim.uv.fs_stat(pnp_cjs) or vim.uv.fs_stat(pnp_js) then
129129
config.cmd = vim.list_extend({ 'yarn', 'exec' }, config.cmd)
130130
end
131131
end,

lua/lspconfig/configs/fennel_ls.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ return {
77
root_dir = function(dir)
88
local has_fls_project_cfg = function(path)
99
local fnlpath = vim.fs.joinpath(path, 'flsproject.fnl')
10-
return (vim.loop.fs_stat(fnlpath) or {}).type == 'file'
10+
return (vim.uv.fs_stat(fnlpath) or {}).type == 'file'
1111
end
1212
return util.search_ancestors(dir, has_fls_project_cfg) or vim.fs.root(0, '.git')
1313
end,

lua/lspconfig/configs/foam_ls.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ return {
66
filetypes = { 'foam', 'OpenFOAM' },
77
root_dir = function(fname)
88
return util.search_ancestors(fname, function(path)
9-
if vim.loop.fs_stat(path .. '/system/controlDict') then
9+
if vim.uv.fs_stat(path .. '/system/controlDict') then
1010
return path
1111
end
1212
end)

lua/lspconfig/configs/gitlab_ci_ls.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
local util = require 'lspconfig.util'
22

3-
local cache_dir = vim.loop.os_homedir() .. '/.cache/gitlab-ci-ls/'
3+
local cache_dir = vim.uv.os_homedir() .. '/.cache/gitlab-ci-ls/'
44
return {
55
default_config = {
66
cmd = { 'gitlab-ci-ls' },

lua/lspconfig/configs/intelephense.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ return {
55
cmd = { 'intelephense', '--stdio' },
66
filetypes = { 'php' },
77
root_dir = function(pattern)
8-
local cwd = vim.loop.cwd()
8+
local cwd = vim.uv.cwd()
99
local root = util.root_pattern('composer.json', '.git')(pattern)
1010

1111
-- prefer cwd if root is a descendant

0 commit comments

Comments
 (0)