File tree Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Original file line number Diff line number Diff line change 14
14
15
15
import * as vscode from "vscode" ;
16
16
import { pathExists } from "./filesystem" ;
17
+ import { convertPathToPattern , glob } from "fast-glob" ;
18
+ import { basename } from "path" ;
17
19
18
20
export async function searchForPackages (
19
21
folder : vscode . Uri ,
@@ -32,14 +34,16 @@ export async function searchForPackages(
32
34
return ;
33
35
}
34
36
35
- await vscode . workspace . fs . readDirectory ( folder ) . then ( async entries => {
37
+ const config = vscode . workspace . getConfiguration ( "files" ) ;
38
+ const vscodeExcludeList = config . get < { [ key : string ] : boolean } > ( "exclude" , { } ) ;
39
+ await glob ( `${ convertPathToPattern ( folder . fsPath ) } /*` , {
40
+ ignore : [ ...Object . keys ( vscodeExcludeList ) . filter ( k => vscodeExcludeList [ k ] ) ] ,
41
+ absolute : true ,
42
+ onlyDirectories : true ,
43
+ } ) . then ( async entries => {
36
44
for ( const entry of entries ) {
37
- if (
38
- entry [ 1 ] === vscode . FileType . Directory &&
39
- entry [ 0 ] [ 0 ] !== "." &&
40
- entry [ 0 ] !== "Packages"
41
- ) {
42
- await search ( vscode . Uri . joinPath ( folder , entry [ 0 ] ) ) ;
45
+ if ( basename ( entry ) !== "." && basename ( entry ) !== "Packages" ) {
46
+ await search ( vscode . Uri . file ( entry ) ) ;
43
47
}
44
48
}
45
49
} ) ;
You can’t perform that action at this time.
0 commit comments