@@ -64,7 +64,6 @@ public DependencyExplorer(IVariableRegistry variables)
6464 /// <inheritdoc />
6565 public CommandSignature Signature => new ( Namespace , Name , ParameterCount ) ;
6666
67- /// <inheritdoc />
6867 /// <inheritdoc />
6968 public CommandResult Execute ( params string [ ] args )
7069 {
@@ -84,26 +83,23 @@ public CommandResult Execute(params string[] args)
8483 var projName = Path . GetFileNameWithoutExtension ( projFile ) ;
8584 var doc = XDocument . Load ( projFile ) ;
8685
87- // 2. Extract NuGet Packages
88- var packages = doc . Descendants ( "PackageReference" )
89- . Select ( x => x . Attribute ( "Include" ) ? . Value )
90- . Where ( v => v != null )
86+ // 1. Create a list of VmValues for Packages
87+ var packageList = doc . Descendants ( "PackageReference" )
88+ . Select ( x => VmValue . FromString ( x . Attribute ( "Include" ) ? . Value ) )
9189 . ToList ( ) ;
9290
93- // 3. Extract Project References
94- var refs = doc . Descendants ( "ProjectReference" )
95- . Select ( x => Path . GetFileNameWithoutExtension ( x . Attribute ( "Include" ) ? . Value ?? "" ) )
96- . Where ( v => ! string . IsNullOrEmpty ( v ) )
91+ // Store as a temporary list in the heap
92+ _variables . SetList ( $ "{ projName } _pkgs", packageList ) ;
93+
94+ // 2. Create a list of VmValues for References
95+ var refList = doc . Descendants ( "ProjectReference" )
96+ . Select ( x => VmValue . FromString ( Path . GetFileNameWithoutExtension ( x . Attribute ( "Include" ) ? . Value ) ) )
9797 . ToList ( ) ;
9898
99- // 4. Flatten directly into projectMap using prefixed keys
100- projectMap [ $ "{ projName } .packages"] = VmValue . FromString ( string . Join ( ", " , packages ) ) ;
101- projectMap [ $ "{ projName } .references"] = VmValue . FromString ( string . Join ( ", " , refs ) ) ;
99+ _variables . SetList ( $ "{ projName } _refs", refList ) ;
102100
103- sb . AppendLine ( $ "Project: { projName } ") ;
104- sb . AppendLine ( $ " - Libraries: { string . Join ( ", " , packages ) } ") ;
105- sb . AppendLine ( $ " - Projects: { string . Join ( ", " , refs ) } ") ;
106- sb . AppendLine ( ) ;
101+ // 3. Build the Object containing pointers to those lists
102+ projectMap [ projName ] = VmValue . FromObject ( ) ; // Or use Pointer/Object hybrid logic
107103 }
108104
109105 // 5. Store in the Registry for WPF or Scripts to use
0 commit comments