summaryrefslogtreecommitdiff
path: root/script/workspace
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2020-12-19 22:45:33 +0800
committer最萌小汐 <sumneko@hotmail.com>2020-12-19 22:45:33 +0800
commita7e39649d815a0bcb5e8ba71f265ddf00443ec6a (patch)
treeac761e31435c4e2b3a7f13774982a239fcc8e23b /script/workspace
parent2fb905253c4e3ae78269bcb500bc4f219df77eb7 (diff)
downloadlua-language-server-a7e39649d815a0bcb5e8ba71f265ddf00443ec6a.zip
try support soft link
Diffstat (limited to 'script/workspace')
-rw-r--r--script/workspace/workspace.lua9
1 files changed, 8 insertions, 1 deletions
diff --git a/script/workspace/workspace.lua b/script/workspace/workspace.lua
index fc6e90bd..76c0ec0a 100644
--- a/script/workspace/workspace.lua
+++ b/script/workspace/workspace.lua
@@ -35,11 +35,18 @@ function m.init(uri)
end
local function interfaceFactory(root)
+ local mark = {}
return {
type = function (path)
local result
pcall(function ()
- if fs.is_directory(fs.path(root .. '/' .. path)) then
+ local abspath = fs.absolute(fs.path(root .. '/' .. path))
+ local abskey = abspath:string():lower()
+ if mark[abskey] then
+ return nil
+ end
+ mark[abskey] = true
+ if fs.is_directory(abspath) then
result = 'directory'
else
result = 'file'