Our great sponsors
-
Buildalyzer
A utility to perform design-time builds of .NET projects without having to think too hard about it.
-
Roslyn
The Roslyn .NET compiler provides C# and Visual Basic languages with rich code analysis APIs.
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
Agreed, Roslyn Workspaces can be helpful. I use them for some code-gen of TypeScript types based on my C# model. There's also Buildalyzer which can help simplify working with Workspaces.
We do support rewrapping arguments like you're trying to do as a Roslyn code action, so you could take a look at how we do it. The core bit (I think) that matches what you're doing is in https://github.com/dotnet/roslyn/blob/ef242b10242389eb00feb2114a50fe746bc8435e/src/Features/Core/Portable/Wrapping/SeparatedSyntaxList/SeparatedSyntaxListCodeActionComputer.cs, which is where we are doing whitespace editing between the tokens. Some of that is using internal helpers to Roslyn so you'll have to dig a bit to see fully how it works.
Related posts
- Software Engineer Ranks Programming Languages - Quali le vostre?
- Recursive descent parsers with good error recovery
- .NET Application Optimization: Simple Edits Speeded Up PVS-Studio and Reduced Memory Consumption by 70%
- 20 Lessons from 5 years of developing Academia: School Simulator
- Still No REPL for .NET Core in Visual Studio