summaryrefslogtreecommitdiff
path: root/script/workspace
diff options
context:
space:
mode:
Diffstat (limited to 'script/workspace')
-rw-r--r--script/workspace/loading.lua2
-rw-r--r--script/workspace/workspace.lua9
2 files changed, 7 insertions, 4 deletions
diff --git a/script/workspace/loading.lua b/script/workspace/loading.lua
index f40c08c6..66e0a3aa 100644
--- a/script/workspace/loading.lua
+++ b/script/workspace/loading.lua
@@ -65,7 +65,7 @@ function mt:checkMaxPreload(uri)
end
---@param uri uri
----@param libraryUri boolean
+---@param libraryUri? uri
---@async
function mt:loadFile(uri, libraryUri)
if files.isLua(uri) then
diff --git a/script/workspace/workspace.lua b/script/workspace/workspace.lua
index 91923bb8..33f8784d 100644
--- a/script/workspace/workspace.lua
+++ b/script/workspace/workspace.lua
@@ -68,9 +68,10 @@ local globInteferFace = {
type = function (path)
local result
pcall(function ()
- if fs.is_directory(fs.path(path)) then
+ local status = fs.symlink_status(path):type()
+ if status == 'directory' then
result = 'directory'
- else
+ elseif status == 'regular' then
result = 'file'
end
end)
@@ -78,7 +79,7 @@ local globInteferFace = {
end,
list = function (path)
local fullPath = fs.path(path)
- if not fs.exists(fullPath) then
+ if fs.symlink_status(fullPath):type() ~= 'directory' then
return nil
end
local paths = {}
@@ -332,6 +333,8 @@ function m.findUrisByFilePath(path)
return results
end
+---@param path string
+---@return string
function m.normalize(path)
if not path then
return nil