diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2019-01-22 17:35:14 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2019-01-22 17:35:14 +0800 |
commit | 5a6a18c61e3954173b7a277999210fa1500b5f4a (patch) | |
tree | bf56cd22c19930082965d8917b3b59ef6431ea60 /server/src/async | |
parent | 82958680c103fa7cbdf7131c1da0fe578f2eafdb (diff) | |
download | lua-language-server-5a6a18c61e3954173b7a277999210fa1500b5f4a.zip |
整理代码
Diffstat (limited to 'server/src/async')
-rw-r--r-- | server/src/async/scanfiles.lua | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/server/src/async/scanfiles.lua b/server/src/async/scanfiles.lua index 4829f8e1..f53564f8 100644 --- a/server/src/async/scanfiles.lua +++ b/server/src/async/scanfiles.lua @@ -2,16 +2,17 @@ local args = ... require 'utility' local fs = require 'bee.filesystem' -local ignore = { - ['.git'] = true, - ['node_modules'] = true, -} +local ignore = { '.git', 'node_modules' } +local root = fs.absolute(fs.path(args.root)) for name in pairs(args.ignore) do - ignore[name] = true + ignore[#ignore+1] = name +end +for i, name in ipairs(ignore) do + ignore[i] = root / name end -for path in io.scan(fs.path(args.root), ignore) do +for path in io.scan(root, ignore) do if path:extension():string() == '.lua' then local buf = io.load(path) if buf then |