chore: add type annotations to (almost) all functions
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user