From 8393f7cc0c0056844f0403b4983324fc20f8571a Mon Sep 17 00:00:00 2001 From: Alexander Courtis Date: Mon, 27 Nov 2023 08:32:51 +1100 Subject: [PATCH] add vim and libuv runtime for luals, qualify libuv types --- .luarc.json | 6 ++++++ lua/nvim-tree/explorer/explore.lua | 2 +- lua/nvim-tree/git/runner.lua | 4 ++-- lua/nvim-tree/node.lua | 2 +- lua/nvim-tree/utils.lua | 2 +- 5 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.luarc.json b/.luarc.json index 6ae9cf62..77434c8d 100644 --- a/.luarc.json +++ b/.luarc.json @@ -1,6 +1,12 @@ { "$schema": "https://raw.githubusercontent.com/sumneko/vscode-lua/master/setting/schema.json", "runtime.version" : "Lua 5.1", + "workspace": { + "library": [ + "$VIMRUNTIME", + "${3rd}/luv/library" + ] + }, "diagnostics": { "globals": [ "vim" diff --git a/lua/nvim-tree/explorer/explore.lua b/lua/nvim-tree/explorer/explore.lua index 0385949d..6a9185af 100644 --- a/lua/nvim-tree/explorer/explore.lua +++ b/lua/nvim-tree/explorer/explore.lua @@ -18,7 +18,7 @@ local function get_type_from(type_, cwd) return type_ or (vim.loop.fs_stat(cwd) or {}).type end ----@param handle uv_fs_t +---@param handle uv.uv_fs_t ---@param cwd string ---@param node Node ---@param git_status table diff --git a/lua/nvim-tree/git/runner.lua b/lua/nvim-tree/git/runner.lua index a3c5d107..b0a3db42 100644 --- a/lua/nvim-tree/git/runner.lua +++ b/lua/nvim-tree/git/runner.lua @@ -60,8 +60,8 @@ function Runner:_handle_incoming_data(prev_output, incoming) return "" end ----@param stdout_handle uv_pipe_t ----@param stderr_handle uv_pipe_t +---@param stdout_handle uv.uv_pipe_t +---@param stderr_handle uv.uv_pipe_t ---@return table function Runner:_getopts(stdout_handle, stderr_handle) local untracked = self.list_untracked and "-u" or nil diff --git a/lua/nvim-tree/node.lua b/lua/nvim-tree/node.lua index c04ec29d..cbe86d8b 100644 --- a/lua/nvim-tree/node.lua +++ b/lua/nvim-tree/node.lua @@ -6,7 +6,7 @@ ---@class BaseNode ---@field absolute_path string ---@field executable boolean ----@field fs_stat uv_fs_t +---@field fs_stat uv.uv_fs_t ---@field git_status GitStatus|nil ---@field hidden boolean ---@field name string diff --git a/lua/nvim-tree/utils.lua b/lua/nvim-tree/utils.lua index 3ce8855a..f625d061 100644 --- a/lua/nvim-tree/utils.lua +++ b/lua/nvim-tree/utils.lua @@ -19,7 +19,7 @@ function M.str_find(haystack, needle) end ---@param path string ----@return string|uv_fs_t +---@return string|uv.uv_fs_t function M.read_file(path) local fd = vim.loop.fs_open(path, "r", 438) if not fd then