Skip to content

Commit

Permalink
vim.loop is also deprecated.
Browse files Browse the repository at this point in the history
  • Loading branch information
Julian committed Jun 1, 2024
1 parent 7d1d5fc commit 6781f42
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lua/lean/_util.lua
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ end
--- Run a subprocess, blocking on exit, and returning its stdout.
---
--- Unlike `system()`, we don't mix stdout and stderr, and unlike
--- `vim.loop.spawn`, we wait for process exit and collect the output.
--- `vim.uv.spawn`, we wait for process exit and collect the output.
--- @return table: the lines of stdout of the exited process
function M.subprocess_check_output(opts, timeout)
timeout = timeout or 10000
Expand Down
8 changes: 5 additions & 3 deletions lua/lean/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
--- To find out more, see https://github.com/Julian/lean.nvim.
---@brief ]]

local uv = vim.uv or vim.loop

---@tag lean.nvim
local util = require 'lean._util'

Expand Down Expand Up @@ -146,9 +148,9 @@ function lean.current_search_paths()
end

local executable = (
vim.loop.fs_stat(root .. '/' .. 'lakefile.lean')
or vim.loop.fs_stat(root .. '/' .. 'lakefile.toml')
or not vim.loop.fs_stat(root .. '/' .. 'leanpkg.toml')
uv.fs_stat(root .. '/' .. 'lakefile.lean')
or uv.fs_stat(root .. '/' .. 'lakefile.toml')
or not uv.fs_stat(root .. '/' .. 'leanpkg.toml')
)
and 'lake'
or 'leanpkg'
Expand Down
7 changes: 5 additions & 2 deletions lua/lean/rpc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,15 @@
--- the below data structures.
---@brief ]]

local rpc = {}
local a = require 'plenary.async'
local control = require 'plenary.async.control'
local lsp = require 'lean.lsp'
local util = require 'lean._util'

local uv = vim.uv or vim.loop

local rpc = {}

---@class RpcRef

---@class Session
Expand Down Expand Up @@ -41,7 +44,7 @@ function Session:new(client, bufnr, uri)
to_release = {},
release_timer = nil,
}, self)
self.keepalive_timer = vim.loop.new_timer()
self.keepalive_timer = uv.new_timer()
self.keepalive_timer:start(
20000,
20000,
Expand Down

0 comments on commit 6781f42

Please sign in to comment.