diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2022-04-27 21:04:47 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2022-04-27 21:04:47 +0800 |
commit | 727c3a086091d1bc2f153c88e83d7118ce3d78d2 (patch) | |
tree | 5141211919d0b4aefbb30c22e8da4eaf97a9ecee | |
parent | 601ad6e2487ef49bd9ec3e45377b854b239264cf (diff) | |
download | lua-language-server-727c3a086091d1bc2f153c88e83d7118ce3d78d2.zip |
dose not load files in symbol links
-rw-r--r-- | changelog.md | 1 | ||||
-rw-r--r-- | script/workspace/workspace.lua | 7 |
2 files changed, 5 insertions, 3 deletions
diff --git a/changelog.md b/changelog.md index d119a7a7..372f8b3b 100644 --- a/changelog.md +++ b/changelog.md @@ -1,6 +1,7 @@ # changelog ## 3.2.3 +* `CHG` dose not load files in symbol links * `FIX` diagnostic: send empty results to every file after startup ## 3.2.2 diff --git a/script/workspace/workspace.lua b/script/workspace/workspace.lua index 26c3a3b2..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 = {} |