Skip to content

Commit d250f2c

Browse files
author
LoneWandererProductions
committed
sync back
1 parent 67d3a0a commit d250f2c

2 files changed

Lines changed: 13 additions & 17 deletions

File tree

Core.Apps/Development/DependencyExplorer.cs

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Weaver/Registry/RegistryExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ public static bool TryGetPointer(
131131
this IVariableRegistry? registry,
132132
string name,
133133
out EnumTypes type,
134-
out string pointer)
134+
out string? pointer)
135135
{
136136
type = default;
137137
pointer = null;

0 commit comments

Comments
 (0)