diff options
Diffstat (limited to 'script')
-rw-r--r-- | script/workspace/scope.lua | 9 | ||||
-rw-r--r-- | script/workspace/workspace.lua | 14 |
2 files changed, 22 insertions, 1 deletions
diff --git a/script/workspace/scope.lua b/script/workspace/scope.lua index 304e875e..ab9c3fb9 100644 --- a/script/workspace/scope.lua +++ b/script/workspace/scope.lua @@ -70,6 +70,15 @@ function mt:getLinkedUri(uri) return nil end +---@param uri uri +---@return uri +function mt:getRootUri(uri) + if self:isChildUri(uri) then + return self.uri + end + return self:getLinkedUri(uri) +end + ---@param k string ---@param v any function mt:set(k, v) diff --git a/script/workspace/workspace.lua b/script/workspace/workspace.lua index 31566e32..89908468 100644 --- a/script/workspace/workspace.lua +++ b/script/workspace/workspace.lua @@ -162,6 +162,18 @@ function m.getLibraryMatchers(scp) end log.info('Build library matchers:', scp) + local pattern = {} + for path, ignore in pairs(config.get(scp.uri, 'files.exclude')) do + if ignore then + log.info('Ignore by exclude:', path) + pattern[#pattern+1] = path + end + end + for _, path in ipairs(config.get(scp.uri, 'Lua.workspace.ignoreDir')) do + log.info('Ignore directory:', path) + pattern[#pattern+1] = path + end + local librarys = {} for path in pairs(config.get(scp.uri, 'Lua.workspace.library')) do path = m.getAbsolutePath(scp.uri, path) @@ -178,7 +190,7 @@ function m.getLibraryMatchers(scp) for path in pairs(librarys) do if fs.exists(fs.path(path)) then local nPath = fs.absolute(fs.path(path)):string() - local matcher = glob.gitignore(true, { + local matcher = glob.gitignore(pattern, { root = path, ignoreCase = platform.OS == 'Windows', }, globInteferFace) |