1111namespace PoshCode . Pansies . Provider
1212{
1313 [ CmdletProvider ( "Pansies" , ProviderCapabilities . None ) ]
14- public class EntityProvider : CodeOwls . PowerShell . Provider . Provider
14+ public class PansiesProvider : CodeOwls . PowerShell . Provider . Provider
1515 {
1616 /// <summary>
1717 /// a required P2F override
@@ -25,12 +25,12 @@ protected override IPathResolver PathResolver
2525
2626 protected override IPathResolver PathResolver2 ( string path )
2727 {
28- var name = path . Split ( [ System . IO . Path . DirectorySeparatorChar , System . IO . Path . PathSeparator ] , StringSplitOptions . RemoveEmptyEntries ) . FirstOrDefault ( ) ;
28+ var name = path . Split ( [ System . IO . Path . DirectorySeparatorChar , ':' , System . IO . Path . AltDirectorySeparatorChar ] , StringSplitOptions . RemoveEmptyEntries ) . FirstOrDefault ( ) ;
2929 var drive = ( from driveInfo in ProviderInfo . Drives
30- where StringComparer . OrdinalIgnoreCase . Equals ( driveInfo . Root . Trim ( ' \\ ' ) , name )
31- select driveInfo ) . FirstOrDefault ( ) as Drive ;
30+ where StringComparer . OrdinalIgnoreCase . Equals ( driveInfo . Root . Trim ( System . IO . Path . DirectorySeparatorChar , ':' , System . IO . Path . AltDirectorySeparatorChar ) , name )
31+ select driveInfo ) . FirstOrDefault ( ) as Drive ;
3232
33- return drive . PathResolver ?? new PansiesResolver ( ( ) => new PansiesProviderRoot ( ) ) ;
33+ return drive . PathResolver ?? new PathNodeResolver ( ( ) => new PansiesProviderRoot ( ) ) ;
3434 }
3535 /// <summary>
3636 /// overridden to supply a default drive when the provider is loaded
@@ -40,35 +40,35 @@ protected override Collection<PSDriveInfo> InitializeDefaultDrives()
4040 var drives = new Collection < PSDriveInfo >
4141 {
4242 new PansiesDrive (
43- new PSDriveInfo ( "Fg " , ProviderInfo , "ForegroundColors :" + System . IO . Path . DirectorySeparatorChar , "Foreground Colors" , null , "Fg:" ) ,
44- new PansiesResolver ( ( ) => new RgbColorProviderRoot ( RgbColorMode . Foreground ) )
43+ new PSDriveInfo ( "fg " , ProviderInfo , "fg :" + System . IO . Path . DirectorySeparatorChar , "Foreground Colors" , null , "Fg:" ) ,
44+ new PathNodeResolver ( ( ) => new RgbColorProviderRoot ( RgbColorMode . Foreground ) )
4545 ) ,
4646 new PansiesDrive (
47- new PSDriveInfo ( "Bg " , ProviderInfo , "BackgroundColors :" + System . IO . Path . DirectorySeparatorChar , "Background Colors" , null , "Bg:" ) ,
48- new PansiesResolver ( ( ) => new RgbColorProviderRoot ( RgbColorMode . Background ) )
47+ new PSDriveInfo ( "bg " , ProviderInfo , "bg :" + System . IO . Path . DirectorySeparatorChar , "Background Colors" , null , "Bg:" ) ,
48+ new PathNodeResolver ( ( ) => new RgbColorProviderRoot ( RgbColorMode . Background ) )
4949 ) ,
5050 new PansiesDrive (
51- new PSDriveInfo ( "Esc " , ProviderInfo , "EscapeSequences :" + System . IO . Path . DirectorySeparatorChar , "Escape Sequences" , null , "Esc:" ) ,
52- new PansiesResolver ( ( ) => Entities . EscapeSequences . ToDriveRoot ( "Esc " ) )
51+ new PSDriveInfo ( "esc " , ProviderInfo , "esc :" + System . IO . Path . DirectorySeparatorChar , "Escape Sequences" , null , "Esc:" ) ,
52+ new PathNodeResolver ( ( ) => Entities . EscapeSequences . ToDriveRoot ( "esc " ) )
5353 ) ,
5454 new PansiesDrive (
55- new PSDriveInfo ( "Extra " , ProviderInfo , "Strings :" + System . IO . Path . DirectorySeparatorChar , "Named Extended Strings" , null , "Extra:" ) ,
56- new PansiesResolver ( ( ) => Entities . ExtendedCharacters . ToDriveRoot ( "Extra " ) )
55+ new PSDriveInfo ( "extra " , ProviderInfo , "extra :" + System . IO . Path . DirectorySeparatorChar , "Named Extended Strings" , null , "Extra:" ) ,
56+ new PathNodeResolver ( ( ) => Entities . ExtendedCharacters . ToDriveRoot ( "extra " ) )
5757 ) ,
5858 } ;
5959 if ( Entities . EnableNerdFonts ) {
6060 drives . Add (
6161 new PansiesDrive (
62- new PSDriveInfo ( "NF ", ProviderInfo , "NerdFontSymbols :" + System . IO . Path . DirectorySeparatorChar , "NerdFont Symbols" , null , "NF:" ) ,
63- new PansiesResolver ( ( ) => Entities . NerdFontSymbols . ToDriveRoot ( "Extra " ) )
62+ new PSDriveInfo ( "nf ", ProviderInfo , "nf :" + System . IO . Path . DirectorySeparatorChar , "NerdFont Symbols" , null , "NF:" ) ,
63+ new PathNodeResolver ( ( ) => Entities . NerdFontSymbols . ToDriveRoot ( "nf " ) )
6464 )
6565 ) ;
6666 }
6767 if ( Entities . EnableEmoji ) {
6868 drives . Add (
6969 new PansiesDrive (
70- new PSDriveInfo ( "Emoji ", ProviderInfo , "Emoji :" + System . IO . Path . DirectorySeparatorChar , "Emoji 16" , null , "Emoji:" ) ,
71- new PansiesResolver ( ( ) => Entities . Emoji . ToDriveRoot ( "Extra " ) )
70+ new PSDriveInfo ( "emoji ", ProviderInfo , "emoji :" + System . IO . Path . DirectorySeparatorChar , "Emoji 16" , null , "Emoji:" ) ,
71+ new PathNodeResolver ( ( ) => Entities . Emoji . ToDriveRoot ( "emoji " ) )
7272 )
7373 ) ;
7474 } ;
0 commit comments