aboutsummaryrefslogtreecommitdiffstats
path: root/lua/lspconfig/util.lua
diff options
context:
space:
mode:
authordundargoc <gocdundar@gmail.com>2024-12-01 13:01:51 +0100
committerdundargoc <33953936+dundargoc@users.noreply.github.com>2024-12-02 11:12:18 +0100
commit9b89ba5f158f73779cd58d0bb2783dfb40b28b0e (patch)
treed35c60d499f9866c6f0ad9298f4ceea26e83eb1d /lua/lspconfig/util.lua
parentdocs: update configs.md (diff)
downloadnvim-lspconfig-9b89ba5f158f73779cd58d0bb2783dfb40b28b0e.tar
nvim-lspconfig-9b89ba5f158f73779cd58d0bb2783dfb40b28b0e.tar.gz
nvim-lspconfig-9b89ba5f158f73779cd58d0bb2783dfb40b28b0e.tar.bz2
nvim-lspconfig-9b89ba5f158f73779cd58d0bb2783dfb40b28b0e.tar.lz
nvim-lspconfig-9b89ba5f158f73779cd58d0bb2783dfb40b28b0e.tar.xz
nvim-lspconfig-9b89ba5f158f73779cd58d0bb2783dfb40b28b0e.tar.zst
nvim-lspconfig-9b89ba5f158f73779cd58d0bb2783dfb40b28b0e.zip
refactor: replace all instances of vim.uv with vim.loop
We still support neovim 0.9 currently, so we can't use vim.uv. Also add a check so we don't accidentally reintroduce it.
Diffstat (limited to 'lua/lspconfig/util.lua')
-rw-r--r--lua/lspconfig/util.lua11
1 files changed, 5 insertions, 6 deletions
diff --git a/lua/lspconfig/util.lua b/lua/lspconfig/util.lua
index 7c02d76c..dbd3e789 100644
--- a/lua/lspconfig/util.lua
+++ b/lua/lspconfig/util.lua
@@ -1,10 +1,9 @@
local validate = vim.validate
local api = vim.api
local lsp = vim.lsp
-local uv = vim.uv or vim.loop
local nvim_eleven = vim.fn.has 'nvim-0.11' == 1
-local iswin = uv.os_uname().version:match 'Windows'
+local iswin = vim.loop.os_uname().version:match 'Windows'
local M = {}
@@ -128,7 +127,7 @@ M.path = (function()
-- Traverse the path calling cb along the way.
local function traverse_parents(path, cb)
- path = uv.fs_realpath(path)
+ path = vim.loop.fs_realpath(path)
local dir = path
-- Just in case our algo is buggy, don't infinite loop.
for _ = 1, 100 do
@@ -154,7 +153,7 @@ M.path = (function()
else
return
end
- if v and uv.fs_realpath(v) then
+ if v and vim.loop.fs_realpath(v) then
return v, path
else
return
@@ -224,7 +223,7 @@ function M.root_pattern(...)
for _, pattern in ipairs(patterns) do
local match = M.search_ancestors(startpath, function(path)
for _, p in ipairs(vim.fn.glob(M.path.join(M.path.escape_wildcards(path), pattern), true, true)) do
- if uv.fs_stat(p) then
+ if vim.loop.fs_stat(p) then
return path
end
end
@@ -392,7 +391,7 @@ M.path.sanitize = vim.fs.normalize
--- @param filename string
--- @return string|false
function M.path.exists(filename)
- local stat = uv.fs_stat(filename)
+ local stat = vim.loop.fs_stat(filename)
return stat and stat.type or false
end