mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-02 11:36:54 -04:00
refactor: use vim.uv
This commit is contained in:
parent
ea192c36ad
commit
161310566a
9 changed files with 44 additions and 66 deletions
|
|
@ -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')
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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')
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
local uv = vim.loop
|
||||
local uv = vim.uv
|
||||
|
||||
local M = {}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue