chore: add type annotations to (almost) all functions

This commit is contained in:
Akmadan23
2023-11-24 12:01:24 +01:00
parent 46e1f776f0
commit fabea3376e
48 changed files with 438 additions and 83 deletions

View File

@@ -11,10 +11,17 @@ local Watcher = require "nvim-tree.watcher"
local M = {}
---@param type_ string|nil
---@param cwd string
---@return any
local function get_type_from(type_, cwd)
return type_ or (vim.loop.fs_stat(cwd) or {}).type
end
---@param handle uv_fs_t
---@param cwd string
---@param node Node
---@param git_status table
local function populate_children(handle, cwd, node, git_status)
local node_ignored = explorer_node.is_git_ignored(node)
local nodes_by_path = utils.bool_record(node.nodes, "absolute_path")
@@ -53,6 +60,9 @@ local function populate_children(handle, cwd, node, git_status)
end
end
---@param node Node
---@param status table
---@return Node[]|nil
function M.explore(node, status)
local cwd = node.link_to or node.absolute_path
local handle = vim.loop.fs_scandir(cwd)