public FileSystemCompletionHelper( ICompletionProvider completionProvider, TextSpan textChangeSpan, ICurrentWorkingDirectoryDiscoveryService fileSystemDiscoveryService, Glyph folderGlyph, Glyph fileGlyph, ImmutableArray <string> searchPaths, IEnumerable <string> allowableExtensions, Func <string, bool> exclude = null) { Debug.Assert(searchPaths.All(path => PathUtilities.IsAbsolute(path))); this.completionProvider = completionProvider; this.textChangeSpan = textChangeSpan; this.searchPaths = searchPaths; this.allowableExtensions = allowableExtensions.Select(e => e.ToLowerInvariant()).ToSet(); this.fileSystemDiscoveryService = fileSystemDiscoveryService; this.folderGlyph = folderGlyph; this.fileGlyph = fileGlyph; this.exclude = exclude; this.lazyGetDrives = new Lazy <string[]>(() => IOUtilities.PerformIO(Directory.GetLogicalDrives, SpecializedCollections.EmptyArray <string>())); }
private static FileSystemInfo[] GetFileSystemInfos(DirectoryInfo directoryInfo) { return(IOUtilities.PerformIO(directoryInfo.GetFileSystemInfos, SpecializedCollections.EmptyArray <FileSystemInfo>())); }
private static bool IsDriveRoot(string fullPath) { return(IOUtilities.PerformIO(() => new DirectoryInfo(fullPath).Parent == null)); }