Skip to content

Conversation

@randlee
Copy link
Owner

@randlee randlee commented Jan 15, 2026

Summary

  • Complete C# Roslyn semantic diff implementation
  • CSharpDiffer detects structural changes (classes, methods, properties)
  • SyntaxComparer with NodeMatcher for semantic comparison
  • 28 test fixture files for diff scenarios
  • GitHub Actions CI pipeline for PRs and pushes

Changes

  • src/RoslynDiff.Core/Differ/CSharpDiffer.cs - C# semantic differ using Roslyn
  • src/RoslynDiff.Core/Comparison/SyntaxComparer.cs - Core comparison logic
  • src/RoslynDiff.Core/Comparison/NodeMatcher.cs - Node matching algorithm
  • src/RoslynDiff.Core/Differ/DifferFactory.cs - Updated to use CSharpDiffer
  • 28 test fixtures in tests/RoslynDiff.Core.Tests/TestFixtures/CSharp/
  • tests/RoslynDiff.Core.Tests/CSharpDifferTests.cs - 13 unit tests
  • .github/workflows/ci.yml - CI pipeline

Test plan

  • 65 tests passing (57 Core + 4 Output + 4 CLI)
  • C# files show structural changes
  • Non-C# files still work (line diff)
  • Parse failures gracefully handled

🤖 Generated with Claude Code

randlee and others added 3 commits January 14, 2026 22:24
Runs on:
- Push to main or develop
- PRs targeting main or develop

Pipeline:
- Restore, build, test with .NET 10
- Upload test results and coverage reports

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Implement syntax-aware diffing for C# files using Roslyn:

- CSharpDiffer: Parses C# syntax trees, detects structural changes
- SyntaxComparer: Compares syntax trees, matches nodes by name/kind
- NodeMatcher: Extracts structural nodes, handles overloads via signatures
- RoslynDifferBase: Abstract base for language-specific Roslyn differs

Detects changes in:
- Namespaces, classes, structs, records, interfaces, enums
- Methods, constructors, properties, fields
- Nested declarations with hierarchical change representation

Includes:
- 28 C# test fixtures covering all change scenarios
- 13 unit tests for CSharpDiffer (65 total tests passing)
- DifferFactory auto-selects CSharpDiffer for .cs files

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…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 <noreply@anthropic.com>
@randlee randlee merged commit b0d9a48 into main Jan 15, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants