File tree Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -70,6 +70,15 @@ function mt:getLinkedUri(uri)
7070 return nil
7171end
7272
73+ --- @param uri uri
74+ --- @return uri
75+ function mt :getRootUri (uri )
76+ if self :isChildUri (uri ) then
77+ return self .uri
78+ end
79+ return self :getLinkedUri (uri )
80+ end
81+
7382--- @param k string
7483--- @param v any
7584function mt :set (k , v )
Original file line number Diff line number Diff line change @@ -162,6 +162,18 @@ function m.getLibraryMatchers(scp)
162162 end
163163 log .info (' Build library matchers:' , scp )
164164
165+ local pattern = {}
166+ for path , ignore in pairs (config .get (scp .uri , ' files.exclude' )) do
167+ if ignore then
168+ log .info (' Ignore by exclude:' , path )
169+ pattern [# pattern + 1 ] = path
170+ end
171+ end
172+ for _ , path in ipairs (config .get (scp .uri , ' Lua.workspace.ignoreDir' )) do
173+ log .info (' Ignore directory:' , path )
174+ pattern [# pattern + 1 ] = path
175+ end
176+
165177 local librarys = {}
166178 for path in pairs (config .get (scp .uri , ' Lua.workspace.library' )) do
167179 path = m .getAbsolutePath (scp .uri , path )
@@ -178,7 +190,7 @@ function m.getLibraryMatchers(scp)
178190 for path in pairs (librarys ) do
179191 if fs .exists (fs .path (path )) then
180192 local nPath = fs .absolute (fs .path (path )):string ()
181- local matcher = glob .gitignore (true , {
193+ local matcher = glob .gitignore (pattern , {
182194 root = path ,
183195 ignoreCase = platform .OS == ' Windows' ,
184196 }, globInteferFace )
You can’t perform that action at this time.
0 commit comments