Analyzing source code using Roslyn
summary
Shows how Roslyn parses student C# submissions on exercism.io, then normalizes code, detects patterns, and compiles to run tests. Demonstrates concrete analyzers that find method overloading and suggest optional parameters, replace default null with a string literal, recommend string interpolation and expression-bodied members, and rewrite AST nodes to normalize whitespace, usings, comments and identifiers. Builds an in-memory assembly from a Project using MSBuildWorkspace and runs xUnit tests via the runner; uses Roslyn syntax trees to transform and compare solutions.
AI-written summary · about
chapters (6)
- 0:00Start
- 15:42start by just looking at the properties of the class
- 30:29modify some parts of the syntax tree functionality
- 42:50normalize identifiers
- 50:47run x unit in memory
- 52:37output the number of errors
related talks
50mAutomate Yourself Out Of a Job With Roslyn
01h 01mBuilding Code Analyzers with the new C# compiler platform (Roslyn)
01h 00mAutomate Yourself Out of a Job with Roslyn
01h 16mAutomate yourself out of a job with Roslyn
50mImproving Source Code with Roslyn
51mThe Future of C#
01h 02mUse your source code to document your application
50mAnalyzing Code in .NET
