summaryrefslogtreecommitdiff
path: root/server/src/workspace.lua
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/workspace.lua')
-rw-r--r--server/src/workspace.lua16
1 files changed, 15 insertions, 1 deletions
diff --git a/server/src/workspace.lua b/server/src/workspace.lua
index 2fd7ad65..6e7faaaf 100644
--- a/server/src/workspace.lua
+++ b/server/src/workspace.lua
@@ -78,9 +78,23 @@ function mt:init(rootUri)
log.info('Log path: ', logPath)
log.init(ROOT, logPath)
+ local ignored = {}
+ for path in pairs(config.config.workspace.ignoreDir) do
+ ignored[path] = true
+ end
+ if config.config.workspace.ignoreSubmodules then
+ local buf = io.load(ROOT:parent_path() / '.gitmodules')
+ if buf then
+ for path in buf:gmatch('path = ([^\r\n]+)') do
+ log.debug('忽略子模块:', path)
+ ignored[path] = true
+ end
+ end
+ end
+
async.run('scanfiles', {
root = self.root:string(),
- ignore = config.config.workspace.ignoreDir,
+ ignore = ignored,
}, function (file)
if file == 'ok' then
self:reset()