Skip to content

Commit da68d09

Browse files
author
LoneWandererProductions
committed
Sync back Lector
Fix up my my file watcher
1 parent 8d4513e commit da68d09

106 files changed

Lines changed: 929 additions & 369 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CoreBuilder/CommandFactory.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@ public static IReadOnlyList<ICommand> GetCommands(Weave? weave = null)
3535
{
3636
ICommand[] modules =
3737
{
38-
new DirectorySizeAnalyzer(), new LogTailCommand(), new HeaderExtractor(), new ResXtract(),
38+
new DirectorySizeAnalyzer(weave.Runtime.Variables), new LogTailCommand(), new HeaderExtractor(), new ResXtract(),
3939
new AllocationAnalyzer(), new DisposableAnalyzer(), new DoubleNewlineAnalyzer(),
4040
new DuplicateStringLiteralAnalyzer(), new EventHandlerAnalyzer(), new HotPathAnalyzer(),
4141
new LicenseHeaderAnalyzer(), new UnusedClassAnalyzer(), new UnusedConstantAnalyzer(),
4242
new UnusedLocalVariableAnalyzer(), new UnusedParameterAnalyzer(), new UnusedPrivateFieldAnalyzer(),
4343
new DocCommentCoverageCommand(), new DeadReferenceAnalyzer(), new ApiExplorerCommand(),
44-
new FileLockScanner(), new SmartPingPro(), new WhoAmI(weave.Runtime.Variables), new Tree()
44+
new FileLockScanner(weave.Runtime.Variables), new SmartPingPro(), new WhoAmI(weave.Runtime.Variables), new Tree()
4545
};
4646

4747
return modules;
@@ -50,28 +50,28 @@ public static IReadOnlyList<ICommand> GetCommands(Weave? weave = null)
5050
/// <summary>
5151
/// Gets the commands.
5252
/// </summary>
53-
/// <param name="userspace">The userspace.</param>
53+
/// <param name="userSpace">The user space.</param>
5454
/// <param name="weave">The weave.</param>
5555
/// <returns>
5656
/// All commands by Namespace.
5757
/// </returns>
58-
public static IReadOnlyList<ICommand> GetCommands(string userspace, Weave? weave = null)
58+
public static IReadOnlyList<ICommand> GetCommands(string userSpace, Weave? weave = null)
5959
{
6060
ICommand[] modules =
6161
{
62-
new DirectorySizeAnalyzer(), new DirectorySizeAnalyzer(), new LogTailCommand(),
62+
new DirectorySizeAnalyzer(weave.Runtime.Variables), new LogTailCommand(),
6363
new HeaderExtractor(), new ResXtract(), new AllocationAnalyzer(), new DisposableAnalyzer(),
6464
new DoubleNewlineAnalyzer(), new DuplicateStringLiteralAnalyzer(), new EventHandlerAnalyzer(),
6565
new HotPathAnalyzer(), new LicenseHeaderAnalyzer(), new UnusedClassAnalyzer(),
6666
new UnusedConstantAnalyzer(), new UnusedLocalVariableAnalyzer(), new UnusedParameterAnalyzer(),
6767
new UnusedPrivateFieldAnalyzer(), new DocCommentCoverageCommand(), new DeadReferenceAnalyzer(),
68-
new ApiExplorerCommand(), new FileLockScanner(), new SmartPingPro(),
68+
new ApiExplorerCommand(), new FileLockScanner(weave.Runtime.Variables), new SmartPingPro(),
6969
new WhoAmI(weave.Runtime.Variables), new Tree()
7070
};
7171

7272
// Filter by Namespace
7373
return modules
74-
.Where(m => string.Equals(m.Namespace, userspace, StringComparison.OrdinalIgnoreCase))
74+
.Where(m => string.Equals(m.Namespace, userSpace, StringComparison.OrdinalIgnoreCase))
7575
.ToList();
7676
}
7777

@@ -106,4 +106,4 @@ public static IReadOnlyList<ICodeAnalyzer> GetAllAnalyzers()
106106
return modules;
107107
}
108108
}
109-
}
109+
}

CoreBuilder/CoreResources.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ internal static class CoreResources
2323
/// </summary>
2424
internal const string ResourceCsProjectExtension = "*.csproj";
2525
}
26-
}
26+
}

CoreBuilder/Development/ApiExplorerCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,4 +188,4 @@ private static bool IsPublic(SyntaxTokenList modifiers)
188188
return modifiers.Any(m => m.IsKind(SyntaxKind.PublicKeyword));
189189
}
190190
}
191-
}
191+
}

CoreBuilder/Development/HeaderExtractor.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,9 @@ public CommandResult TryRun(params string[] args)
168168
"no" => CommandResult.Fail("Operation cancelled by user."),
169169
_ => new CommandResult
170170
{
171-
Message = "Please answer yes/no.", RequiresConfirmation = true, Feedback = feedback
171+
Message = "Please answer yes/no.",
172+
RequiresConfirmation = true,
173+
Feedback = feedback
172174
}
173175
};
174176
});
@@ -241,4 +243,4 @@ private static string InsertHeader(string fileContent, string fileName, string p
241243
return string.Concat(header, Environment.NewLine, fileContent);
242244
}
243245
}
244-
}
246+
}

CoreBuilder/Development/ResXtract.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,4 +368,4 @@ private static void GenerateResourceFile(Dictionary<string, string> resourceMap,
368368
}
369369
}
370370
}
371-
}
371+
}

CoreBuilder/Diagnostic.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,4 +98,4 @@ public override string ToString()
9898
: $"{Name}, {Severity}, {FilePath}({LineNumber}): {Message}";
9999
}
100100
}
101-
}
101+
}

CoreBuilder/Enums/DiagnosticImpact.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,4 @@ public enum DiagnosticImpact
3434
Other = 3,
3535
Readability = 4
3636
}
37-
}
37+
}

CoreBuilder/Enums/DiagnosticSeverity.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ public enum DiagnosticSeverity
2828
/// </summary>
2929
Error = 2
3030
}
31-
}
31+
}

CoreBuilder/Enums/LoopContext.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,4 @@ public enum LoopContext
3333
/// </summary>
3434
Nested = 3
3535
}
36-
}
36+
}

CoreBuilder/Extensions/WhoAmIExtension.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,15 @@ public CommandResult Invoke(ICommand command, string[] extensionArgs, Func<strin
4242
"No parameter specified. Example: whoami().who(ip,hostname) or whoami().who(ip)");
4343
}
4444

45-
// 1. Cast to the concrete parent command to access its public/internal fields
46-
if (command is not WhoAmI parent)
45+
// 1. Logic check: If it doesn't implement IRegistryProducer, we can't save data.
46+
if (command is not IRegistryProducer producer)
4747
{
48-
return CommandResult.Fail("Extension 'who' is only compatible with the WhoAmI command.");
48+
return CommandResult.Fail($"Extension 'who' requires an IRegistryProducer, but {command.Name} does not implement it.");
4949
}
5050

5151
// Use the registry and the key defined by the parent command
52-
var registry = parent.Variables;
53-
string storeKey = parent.LastStoreKey;
52+
var registry = producer.Variables;
53+
string storeKey = producer.CurrentRegistryKey;
5454

5555
try
5656
{
@@ -142,4 +142,4 @@ public CommandResult Invoke(ICommand command, string[] extensionArgs, Func<strin
142142
}
143143
}
144144
}
145-
}
145+
}

0 commit comments

Comments
 (0)