@@ -268,7 +268,7 @@ export function checkUnsavedChanges(): boolean {
268268 return vscode . workspace . textDocuments . some ( ( doc ) => doc . isDirty )
269269}
270270
271- export function getExcludePattern ( additionalPatterns : string [ ] = [ ] , nonGlobalExtraPatterns : boolean = true ) {
271+ export function getExcludePattern ( defaultExcludePatterns : boolean = true ) {
272272 const globAlwaysExcludedDirs = getGlobDirExcludedPatterns ( ) . map ( ( pattern ) => `**/${ pattern } /*` )
273273 const extraPatterns = [
274274 '**/package-lock.json' ,
@@ -290,11 +290,7 @@ export function getExcludePattern(additionalPatterns: string[] = [], nonGlobalEx
290290 '**/License.md' ,
291291 '**/LICENSE.md' ,
292292 ]
293- const allPatterns = [
294- ...globAlwaysExcludedDirs ,
295- ...( nonGlobalExtraPatterns ? extraPatterns : [ ] ) ,
296- ...additionalPatterns ,
297- ]
293+ const allPatterns = [ ...globAlwaysExcludedDirs , ...( defaultExcludePatterns ? extraPatterns : [ ] ) ]
298294 return `{${ allPatterns . join ( ',' ) } }`
299295}
300296
@@ -307,11 +303,11 @@ export function getExcludePattern(additionalPatterns: string[] = [], nonGlobalEx
307303async function filterOutGitignoredFiles (
308304 rootPath : string ,
309305 files : vscode . Uri [ ] ,
310- addExtraPatterns : boolean = true
306+ defaultExcludePatterns : boolean = true
311307) : Promise < vscode . Uri [ ] > {
312308 const gitIgnoreFiles = await vscode . workspace . findFiles (
313309 new vscode . RelativePattern ( rootPath , '**/.gitignore' ) ,
314- getExcludePattern ( [ ] , addExtraPatterns )
310+ getExcludePattern ( defaultExcludePatterns )
315311 )
316312 const gitIgnoreFilter = await GitIgnoreFilter . build ( gitIgnoreFiles )
317313 return gitIgnoreFilter . filterFiles ( files )
@@ -330,7 +326,7 @@ export async function collectFiles(
330326 workspaceFolders : CurrentWsFolders ,
331327 respectGitIgnore : boolean = true ,
332328 maxSize = 200 * 1024 * 1024 , // 200 MB
333- addExtraIgnorePatterns : boolean = true
329+ defaultExcludePatterns : boolean = true
334330) : Promise <
335331 {
336332 workspaceFolder : vscode . WorkspaceFolder
@@ -367,11 +363,11 @@ export async function collectFiles(
367363 for ( const rootPath of sourcePaths ) {
368364 const allFiles = await vscode . workspace . findFiles (
369365 new vscode . RelativePattern ( rootPath , '**' ) ,
370- getExcludePattern ( [ ] , addExtraIgnorePatterns )
366+ getExcludePattern ( defaultExcludePatterns )
371367 )
372368
373369 const files = respectGitIgnore
374- ? await filterOutGitignoredFiles ( rootPath , allFiles , addExtraIgnorePatterns )
370+ ? await filterOutGitignoredFiles ( rootPath , allFiles , defaultExcludePatterns )
375371 : allFiles
376372
377373 for ( const file of files ) {
0 commit comments