summaryrefslogtreecommitdiff
path: root/script/workspace/workspace.lua
diff options
context:
space:
mode:
authorAlexCai2019 <89138532+AlexCai2019@users.noreply.github.com>2022-05-08 01:43:28 +0800
committerGitHub <noreply@github.com>2022-05-08 01:43:28 +0800
commit0fd83c4ca9f82a02becab6c304a8a7de75098507 (patch)
treebe9790d9d4823fe728c5b36e94093fe5f42b7725 /script/workspace/workspace.lua
parent89203efad8c9b5513e05ca4d5696107924865b10 (diff)
parent67b4c574849d1667e0ecb39c51aeed8e30b43056 (diff)
downloadlua-language-server-0fd83c4ca9f82a02becab6c304a8a7de75098507.zip
Merge branch 'sumneko:master' into master
Diffstat (limited to 'script/workspace/workspace.lua')
-rw-r--r--script/workspace/workspace.lua9
1 files changed, 6 insertions, 3 deletions
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