From 37957d6bcf88999d41240f81610d29d48364c452 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Sat, 3 Jun 2023 12:08:14 +0200 Subject: refactor: use `vim.uv` --- lua/nvim-treesitter/config.lua | 2 +- lua/nvim-treesitter/health.lua | 2 +- lua/nvim-treesitter/install.lua | 2 +- lua/nvim-treesitter/job.lua | 8 ++++---- lua/nvim-treesitter/util.lua | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) (limited to 'lua') diff --git a/lua/nvim-treesitter/config.lua b/lua/nvim-treesitter/config.lua index c77ee1358..9d9e1d3af 100644 --- a/lua/nvim-treesitter/config.lua +++ b/lua/nvim-treesitter/config.lua @@ -62,7 +62,7 @@ end function M.get_install_dir(dir_name) local dir = vim.fs.joinpath(config.install_dir, dir_name) - if not vim.loop.fs_stat(dir) then + if not vim.uv.fs_stat(dir) then local ok, err = pcall(vim.fn.mkdir, dir, 'p', '0755') if not ok then local log = require('nvim-treesitter.log') diff --git a/lua/nvim-treesitter/health.lua b/lua/nvim-treesitter/health.lua index 037887c59..3573e7f5a 100644 --- a/lua/nvim-treesitter/health.lua +++ b/lua/nvim-treesitter/health.lua @@ -104,7 +104,7 @@ local function install_health() end end - vim.health.start('OS Info:\n' .. vim.inspect(vim.loop.os_uname())) + vim.health.start('OS Info:\n' .. vim.inspect(vim.uv.os_uname())) end local function query_status(lang, query_group) diff --git a/lua/nvim-treesitter/install.lua b/lua/nvim-treesitter/install.lua index 3fba73db4..84bc99024 100644 --- a/lua/nvim-treesitter/install.lua +++ b/lua/nvim-treesitter/install.lua @@ -1,6 +1,6 @@ local api = vim.api local fs = vim.fs -local uv = vim.loop +local uv = vim.uv local a = require('nvim-treesitter.async') local config = require('nvim-treesitter.config') diff --git a/lua/nvim-treesitter/job.lua b/lua/nvim-treesitter/job.lua index 9c2788cb0..460a543bf 100644 --- a/lua/nvim-treesitter/job.lua +++ b/lua/nvim-treesitter/job.lua @@ -1,5 +1,5 @@ -- Interface with Neovim job control and provide a simple job sequencing structure -local uv = vim.loop +local uv = vim.uv local a = require('nvim-treesitter.async') local log = require('nvim-treesitter.log') @@ -18,8 +18,8 @@ local M = { JobResult = {}, Opts = {} } --- @field on_stderr fun(_: string) --- @field on_stdout fun(_: string) ---- Wrapper for vim.loop.spawn. Takes a command, options, and callback just like ---- vim.loop.spawn, but ensures that all output from the command has been +--- Wrapper for vim.uv.spawn. Takes a command, options, and callback just like +--- vim.uv.spawn, but ensures that all output from the command has been --- flushed before calling the callback. --- @param cmd string --- @param options uv.aliases.spawn_options @@ -66,7 +66,7 @@ end --- Main exposed function for the jobs module. Takes a task and options and --- returns an async function that will run the task with the given opts via ---- vim.loop.spawn +--- vim.uv.spawn --- @param task string[] --- @param opts JobOpts --- @param callback fun(_: JobResult) diff --git a/lua/nvim-treesitter/util.lua b/lua/nvim-treesitter/util.lua index 276eafdd7..3087e9422 100644 --- a/lua/nvim-treesitter/util.lua +++ b/lua/nvim-treesitter/util.lua @@ -1,4 +1,4 @@ -local uv = vim.loop +local uv = vim.uv local M = {} -- cgit v1.2.3-70-g09d2