fix(#1831): remove instrumentation (#1968)

This commit is contained in:
Alexander Courtis
2023-02-04 16:54:36 +11:00
committed by GitHub
parent 8505b6ecd8
commit e0166d1469
4 changed files with 7 additions and 55 deletions

View File

@@ -1,6 +1,5 @@
local Iterator = require "nvim-tree.iterators.node-iterator"
local notify = require "nvim-tree.notify"
local log = require "nvim-tree.log"
local M = {
debouncers = {},
@@ -415,51 +414,4 @@ function M.is_nvim_tree_buf(bufnr)
return false
end
---Profile a call to vim.loop.fs_scandir
---This should be removed following resolution of #1831
---@param path string
---@return userdata|nil uv_fs_t
---@return string|nil type
---@return string|nil err (fail)
---@return string|nil name (fail)
function M.fs_scandir_profiled(path)
local pn = string.format("fs_scandir %s", path)
local ps = log.profile_start(pn)
local handle, err, name = vim.loop.fs_scandir(path)
if err or name then
log.line("profile", " %s err '%s'", pn, vim.inspect(err))
log.line("profile", " %s name '%s'", pn, vim.inspect(name))
end
log.profile_end(ps, pn)
return handle, err, name
end
---Profile a call to vim.loop.fs_scandir_next
---This should be removed following resolution of #1831
---@param handle userdata uv_fs_t
---@param tag string arbitrary
---@return string|nil name
---@return string|nil type
---@return string|nil err (fail)
---@return string|nil name (fail)
function M.fs_scandir_next_profiled(handle, tag)
local pn = string.format("fs_scandir_next %s", tag)
local ps = log.profile_start(pn)
local n, t, err, name = vim.loop.fs_scandir_next(handle)
if err or name then
log.line("profile", " %s err '%s'", pn, vim.inspect(err))
log.line("profile", " %s name '%s'", pn, vim.inspect(name))
end
log.profile_end(ps, pn)
return n, t, err, name
end
return M