From 9b89ba5f158f73779cd58d0bb2783dfb40b28b0e Mon Sep 17 00:00:00 2001 From: dundargoc Date: Sun, 1 Dec 2024 13:01:51 +0100 Subject: 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. --- lua/lspconfig/util.lua | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'lua/lspconfig/util.lua') 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 -- cgit v1.2.3-70-g09d2