diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2020-12-19 22:45:33 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2020-12-19 22:45:33 +0800 |
commit | a7e39649d815a0bcb5e8ba71f265ddf00443ec6a (patch) | |
tree | ac761e31435c4e2b3a7f13774982a239fcc8e23b /script/workspace | |
parent | 2fb905253c4e3ae78269bcb500bc4f219df77eb7 (diff) | |
download | lua-language-server-a7e39649d815a0bcb5e8ba71f265ddf00443ec6a.zip |
try support soft link
Diffstat (limited to 'script/workspace')
-rw-r--r-- | script/workspace/workspace.lua | 9 |
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' |