Skip to content

Commit 17df44d

Browse files
randleeclaude
andcommitted
feat: Complete Sprints 3 & 4 - VB.NET, Semantic Analysis, and Output Formatters
Sprint 3: VB.NET + Semantic Analysis - VisualBasicDiffer for VB.NET files (.vb) - VisualBasicSyntaxComparer and VisualBasicNodeMatcher - SemanticComparer for rename/move detection - SymbolMatcher for content similarity matching - VB.NET test fixtures (modules, classes, subs, functions) - Semantic test fixtures (renames, moves) Sprint 4: Output Formatters - IOutputFormatter interface and OutputFormatterFactory - JsonFormatter with AI-friendly structure - HtmlFormatter with side-by-side diff view - PlainTextFormatter for pipes/redirects - SpectreConsoleFormatter for rich terminal output - Comprehensive tests for all formatters Test Results: 242 tests passing - Core: 108 tests - Output: 130 tests - CLI: 4 tests Co-Authored-By: Claude Opus 4.5 <[email protected]>
1 parent 97fcfed commit 17df44d

Some content is hidden

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

48 files changed

+8149
-38
lines changed

src/RoslynDiff.Cli/Commands/DiffCommand.cs

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -137,16 +137,19 @@ public override async Task<int> ExecuteAsync(CommandContext context, Settings se
137137
var result = differ.Compare(oldContent, newContent, options);
138138

139139
// Get the formatter
140-
var formatter = GetFormatter(settings.Format);
140+
var formatterFactory = new OutputFormatterFactory();
141+
var formatter = formatterFactory.IsFormatSupported(settings.Format)
142+
? formatterFactory.GetFormatter(settings.Format)
143+
: GetLegacyFormatter(settings.Format);
141144

142145
// Format output
143146
var outputOptions = new OutputOptions
144147
{
145148
UseColor = settings.UseColor,
146-
IndentJson = true
149+
PrettyPrint = true
147150
};
148151

149-
var output = formatter.Format(result, outputOptions);
152+
var output = formatter.FormatResult(result, outputOptions);
150153

151154
// Write output
152155
if (!string.IsNullOrEmpty(settings.OutputFile))
@@ -168,14 +171,15 @@ public override async Task<int> ExecuteAsync(CommandContext context, Settings se
168171
}
169172
}
170173

171-
private static IOutputFormatter GetFormatter(string format)
174+
private static IOutputFormatter GetLegacyFormatter(string format)
172175
{
173176
return format.ToLowerInvariant() switch
174177
{
175-
"json" => new JsonOutputFormatter(),
176-
"unified" or "text" or "plain" => new UnifiedFormatter(),
177-
// "html" => new HtmlFormatter(), // Future implementation
178-
_ => throw new ArgumentException($"Unknown format: {format}. Supported formats: unified, json")
178+
"unified" => new UnifiedFormatter(),
179+
"html" => new HtmlFormatter(),
180+
"plain" => new PlainTextFormatter(),
181+
"terminal" => new SpectreConsoleFormatter(),
182+
_ => throw new ArgumentException($"Unknown format: {format}. Supported formats: json, text, unified, html, plain, terminal")
179183
};
180184
}
181185
}

0 commit comments

Comments
 (0)