From 4970e2b306421eb8a085671ec34b903f880f8c22 Mon Sep 17 00:00:00 2001 From: Nicolas THIERRY Date: Wed, 4 Sep 2024 22:44:45 +0200 Subject: [PATCH 1/2] fix: #1780 by using fs_stat if fs_readdir fails --- lua/mason-core/fs.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lua/mason-core/fs.lua b/lua/mason-core/fs.lua index 203c96d72..c2bc42001 100644 --- a/lua/mason-core/fs.lua +++ b/lua/mason-core/fs.lua @@ -134,6 +134,10 @@ local function make_module(uv) log.trace("fs: fs_readdir", path, entries) if entries and #entries > 0 then for i = 1, #entries do + if entries[i].name and not entries[i].type then + local stat = uv.fs_stat(path .. "/" .. entries[i].name) + entries[i].type = stat.type + end all_entries[#all_entries + 1] = entries[i] end else From 71ee1b357b31c827b7e069b767e82449d5550cfd Mon Sep 17 00:00:00 2001 From: Nicolas THIERRY Date: Wed, 4 Sep 2024 22:51:52 +0200 Subject: [PATCH 2/2] feat: add trace log to new feature --- lua/mason-core/fs.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/mason-core/fs.lua b/lua/mason-core/fs.lua index c2bc42001..0a2b74683 100644 --- a/lua/mason-core/fs.lua +++ b/lua/mason-core/fs.lua @@ -137,6 +137,7 @@ local function make_module(uv) if entries[i].name and not entries[i].type then local stat = uv.fs_stat(path .. "/" .. entries[i].name) entries[i].type = stat.type + log.trace("fs: using fs_stat to find type of ", path, stat.type) end all_entries[#all_entries + 1] = entries[i] end