summaryrefslogtreecommitdiff
path: root/script/workspace
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2021-07-15 16:04:38 +0800
committer最萌小汐 <sumneko@hotmail.com>2021-07-15 16:04:38 +0800
commit283fb8792e9b931fc5f8c7a6a3bdf883c4f76197 (patch)
tree6068fb0a74d3cca73f0b498843f00c1bbb8d12b8 /script/workspace
parent64d622342370237ff5418e67088171fd8b3950b8 (diff)
downloadlua-language-server-283fb8792e9b931fc5f8c7a6a3bdf883c4f76197.zip
fix ignore priority
Diffstat (limited to 'script/workspace')
-rw-r--r--script/workspace/workspace.lua30
1 files changed, 15 insertions, 15 deletions
diff --git a/script/workspace/workspace.lua b/script/workspace/workspace.lua
index e69c6d76..485fd5f4 100644
--- a/script/workspace/workspace.lua
+++ b/script/workspace/workspace.lua
@@ -80,11 +80,6 @@ function m.getNativeMatcher()
end
local pattern = {}
- -- config.get 'workspace.ignoreDir'
- for path in pairs(config.get 'Lua.workspace.ignoreDir') do
- log.info('Ignore directory:', path)
- pattern[#pattern+1] = path
- end
-- config.get 'files.exclude'
for path, ignore in pairs(config.get 'files.exclude') do
if ignore then
@@ -92,16 +87,6 @@ function m.getNativeMatcher()
pattern[#pattern+1] = path
end
end
- -- config.get 'workspace.ignoreSubmodules'
- if config.get 'Lua.workspace.ignoreSubmodules' then
- local buf = pub.awaitTask('loadFile', furi.encode(m.path .. '/.gitmodules'))
- if buf then
- for path in buf:gmatch('path = ([^\r\n]+)') do
- log.info('Ignore by .gitmodules:', path)
- pattern[#pattern+1] = path
- end
- end
- end
-- config.get 'workspace.useGitIgnore'
if config.get 'Lua.workspace.useGitIgnore' then
local buf = pub.awaitTask('loadFile', furi.encode(m.path .. '/.gitignore'))
@@ -123,12 +108,27 @@ function m.getNativeMatcher()
end
end
end
+ -- config.get 'workspace.ignoreSubmodules'
+ if config.get 'Lua.workspace.ignoreSubmodules' then
+ local buf = pub.awaitTask('loadFile', furi.encode(m.path .. '/.gitmodules'))
+ if buf then
+ for path in buf:gmatch('path = ([^\r\n]+)') do
+ log.info('Ignore by .gitmodules:', path)
+ pattern[#pattern+1] = path
+ end
+ end
+ end
-- config.get 'workspace.library'
for path in pairs(config.get 'Lua.workspace.library') do
path = m.getAbsolutePath(path)
log.info('Ignore by library:', path)
pattern[#pattern+1] = path
end
+ -- config.get 'workspace.ignoreDir'
+ for path in pairs(config.get 'Lua.workspace.ignoreDir') do
+ log.info('Ignore directory:', path)
+ pattern[#pattern+1] = path
+ end
m.nativeMatcher = glob.gitignore(pattern, m.matchOption, globInteferFace)
m.nativeMatcher:setOption('root', m.path)