File tree Expand file tree Collapse file tree 1 file changed +16
-9
lines changed Expand file tree Collapse file tree 1 file changed +16
-9
lines changed Original file line number Diff line number Diff line change 12
12
//
13
13
//===----------------------------------------------------------------------===//
14
14
15
- import { all , any } from "micromatch" ;
15
+ import { contains } from "micromatch" ;
16
16
import * as fs from "fs/promises" ;
17
17
import * as path from "path" ;
18
18
import * as vscode from "vscode" ;
@@ -111,17 +111,24 @@ export function isIncluded(
111
111
uri : vscode . Uri ,
112
112
excludeList : Record < string , boolean > = getDefaultExcludeList ( )
113
113
) : boolean {
114
- const { include, exclude } = getGlobPattern ( excludeList ) ;
115
- const notExcluded = all (
116
- uri . fsPath ,
117
- exclude . map ( pattern => `!${ pattern } ` ) ,
118
- { contains : true }
119
- ) ;
114
+ let notExcluded = true ;
115
+ let included = false ;
116
+ for ( const key of Object . keys ( excludeList ) ) {
117
+ if ( excludeList [ key ] ) {
118
+ if ( contains ( uri . fsPath , key , { contains : true } ) ) {
119
+ notExcluded = false ;
120
+ included = false ;
121
+ }
122
+ } else {
123
+ if ( contains ( uri . fsPath , key , { contains : true } ) ) {
124
+ included = true ;
125
+ }
126
+ }
127
+ }
120
128
if ( notExcluded ) {
121
129
return true ;
122
130
}
123
- const reincluded = any ( uri . fsPath , include , { contains : true } ) ;
124
- return reincluded ;
131
+ return included ;
125
132
}
126
133
127
134
export function isExcluded (
You can’t perform that action at this time.
0 commit comments