File tree Expand file tree Collapse file tree 2 files changed +16
-8
lines changed Expand file tree Collapse file tree 2 files changed +16
-8
lines changed Original file line number Diff line number Diff line change 80
80
"type" : " boolean" ,
81
81
"default" : true ,
82
82
"description" : " Whether to use the values from `files.exclude` when deciding which folders to ignore."
83
+ },
84
+ "advancedNewFile.showSymlinks" : {
85
+ "type" : " boolean" ,
86
+ "default" : true ,
87
+ "description" : " Whether to show symbolic links when listing direcotries."
83
88
}
84
89
}
85
90
}
Original file line number Diff line number Diff line change @@ -127,10 +127,6 @@ function isDirectorySymlink(p: string): boolean {
127
127
return fs . lstatSync ( sp ) . isDirectory ( ) ;
128
128
}
129
129
130
- function isDirectoryOrDirectorySymlink ( p : string ) : boolean {
131
- return isDirectory ( p ) || isDirectorySymlink ( p ) ;
132
- }
133
-
134
130
function directoriesSync ( root : string ) : FSLocation [ ] {
135
131
const ignore : string [ ] = [ ] ;
136
132
if (
@@ -145,17 +141,24 @@ function directoriesSync(root: string): FSLocation[] {
145
141
const results = globSync ( '**' , {
146
142
cwd : root ,
147
143
ignore : ignore . map ( invertGlob ) ,
148
- symlinks : true
144
+ symlinks : vscode . workspace
145
+ . getConfiguration ( 'advancedNewFile' )
146
+ . get ( 'showSymlinks' , true )
149
147
} )
150
148
. map ( ( f ) : FSLocation => {
151
149
return {
152
150
relative : path . join ( path . sep , f ) ,
153
151
absolute : path . join ( root , f )
154
152
} ;
155
153
} )
156
- . filter ( ( f ) => isDirectoryOrDirectorySymlink ( f . absolute ) )
157
- . map ( ( f ) => f ) ;
158
-
154
+ . filter (
155
+ ( f ) =>
156
+ isDirectory ( f . absolute ) ||
157
+ ( isDirectorySymlink ( f . absolute ) &&
158
+ vscode . workspace
159
+ . getConfiguration ( 'advancedNewFile' )
160
+ . get ( 'showSymlinks' , true ) )
161
+ ) ;
159
162
return results ;
160
163
}
161
164
You can’t perform that action at this time.
0 commit comments