diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2019-06-25 12:19:47 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2019-06-25 12:19:47 +0800 |
commit | 505761b27889fafc73e7fc73d2873ef7ff40ce29 (patch) | |
tree | bea7e4b87b3da0729528937a709e8ba52f3534da /server | |
parent | eb0f00760e6ee12a492cfcbb7495821c6b67977f (diff) | |
download | lua-language-server-505761b27889fafc73e7fc73d2873ef7ff40ce29.zip |
遍历文件pcall一下,因为目录不一定合法
Diffstat (limited to 'server')
-rw-r--r-- | server/src/async/scanfiles.lua | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/server/src/async/scanfiles.lua b/server/src/async/scanfiles.lua index 04867377..f5249c8e 100644 --- a/server/src/async/scanfiles.lua +++ b/server/src/async/scanfiles.lua @@ -46,7 +46,10 @@ end for _, data in ipairs(args) do local root = fs.path(data.root) - scan(data.mode, root, data.pattern, data.options) + local suc, err = xpcall(scan, debug.traceback, data.mode, root, data.pattern, data.options) + if not suc then + ERR:push(err) + end end OUT:push 'ok' |