summaryrefslogtreecommitdiff
path: root/server/src/workspace.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2019-01-22 17:01:01 +0800
committer最萌小汐 <sumneko@hotmail.com>2019-01-22 17:01:01 +0800
commitf6cf28b71d81785a29a163a82427a9276744793e (patch)
treec23170a8ded44ff30a8d2f9af06e67dd6c963520 /server/src/workspace.lua
parent382a83df0058bd6243a06f1129399060c9cb9303 (diff)
downloadlua-language-server-f6cf28b71d81785a29a163a82427a9276744793e.zip
忽略目录也交给后端处理
Diffstat (limited to 'server/src/workspace.lua')
-rw-r--r--server/src/workspace.lua17
1 files changed, 6 insertions, 11 deletions
diff --git a/server/src/workspace.lua b/server/src/workspace.lua
index a0641b2d..8f51fc11 100644
--- a/server/src/workspace.lua
+++ b/server/src/workspace.lua
@@ -78,14 +78,15 @@ function mt:init(rootUri)
log.info('Log path: ', logPath)
log.init(ROOT, logPath)
- local ignored = {}
+ local ignore = {}
for name in pairs(config.config.workspace.ignoreDir) do
- local path = fs.absolute(self.root / name)
- local str = path:string():lower()
- ignored[#ignored+1] = str
+ ignore[#ignore+1] = name
end
- async.run('scanfiles', self.root:string(), function (file)
+ async.run('scanfiles', {
+ root = self.root:string(),
+ ignore = ignore,
+ }, function (file)
if file == 'ok' then
self:reset()
self._complete = true
@@ -93,12 +94,6 @@ function mt:init(rootUri)
end
local path = fs.path(file.path)
local name = path:string():lower()
- for _, ignore in ipairs(ignored) do
- if name:sub(1, #ignore) == ignore then
- ok = false
- return
- end
- end
local uri = self:uriEncode(path)
self.files[name] = uri
self.lsp:readText(uri, path, file.buf)