8
8
using System . Linq ;
9
9
using System . Security ;
10
10
using System . Text ;
11
- using Microsoft . Extensions . FileSystemGlobbing ;
12
11
using Microsoft . Extensions . Logging ;
13
12
using Microsoft . PowerShell . EditorServices . Services . TextDocument ;
14
- using Microsoft . PowerShell . EditorServices . Services . Workspace ;
15
13
using Microsoft . PowerShell . EditorServices . Utility ;
16
14
using OmniSharp . Extensions . LanguageServer . Protocol ;
17
15
using OmniSharp . Extensions . LanguageServer . Protocol . Models ;
@@ -26,25 +24,6 @@ internal class WorkspaceService
26
24
{
27
25
#region Private Fields
28
26
29
- // List of all file extensions considered PowerShell files in the .Net Core Framework.
30
- private static readonly string [ ] s_psFileExtensionsCoreFramework =
31
- {
32
- ".ps1" ,
33
- ".psm1" ,
34
- ".psd1"
35
- } ;
36
-
37
- // .Net Core doesn't appear to use the same three letter pattern matching rule although the docs
38
- // suggest it should be find the '.ps1xml' files because we search for the pattern '*.ps1'.
39
- // ref https://docs.microsoft.com/en-us/dotnet/api/system.io.directory.getfiles?view=netcore-2.1#System_IO_Directory_GetFiles_System_String_System_String_System_IO_EnumerationOptions_
40
- private static readonly string [ ] s_psFileExtensionsFullFramework =
41
- {
42
- ".ps1" ,
43
- ".psm1" ,
44
- ".psd1" ,
45
- ".ps1xml"
46
- } ;
47
-
48
27
// An array of globs which includes everything.
49
28
private static readonly string [ ] s_psIncludeAllGlob = new [ ]
50
29
{
@@ -358,36 +337,7 @@ public IEnumerable<string> EnumeratePSFiles(
358
337
string [ ] excludeGlobs ,
359
338
string [ ] includeGlobs ,
360
339
int maxDepth ,
361
- bool ignoreReparsePoints )
362
- {
363
- Matcher matcher = new ( ) ;
364
- foreach ( string pattern in includeGlobs ) { matcher . AddInclude ( pattern ) ; }
365
- foreach ( string pattern in excludeGlobs ) { matcher . AddExclude ( pattern ) ; }
366
-
367
- foreach ( string rootPath in WorkspacePaths )
368
- {
369
- if ( ! Directory . Exists ( rootPath ) )
370
- {
371
- continue ;
372
- }
373
-
374
- WorkspaceFileSystemWrapperFactory fsFactory = new (
375
- rootPath ,
376
- maxDepth ,
377
- VersionUtils . IsNetCore ? s_psFileExtensionsCoreFramework : s_psFileExtensionsFullFramework ,
378
- ignoreReparsePoints ,
379
- logger ) ;
380
-
381
- PatternMatchingResult fileMatchResult = matcher . Execute ( fsFactory . RootDirectory ) ;
382
- foreach ( FilePatternMatch item in fileMatchResult . Files )
383
- {
384
- // item.Path always contains forward slashes in paths when it should be backslashes on Windows.
385
- // Since we're returning strings here, it's important to use the correct directory separator.
386
- string path = VersionUtils . IsWindows ? item . Path . Replace ( '/' , Path . DirectorySeparatorChar ) : item . Path ;
387
- yield return Path . Combine ( rootPath , path ) ;
388
- }
389
- }
390
- }
340
+ bool ignoreReparsePoints ) => [ ] ;
391
341
392
342
#endregion
393
343
0 commit comments