fahadash
fahadash

Reputation: 3281

How to format text code using Roslyn?

I went through samples and other questions, people are mostly using Workspaces. All I have is a single file and no workspace, how can I format it using Formatter static methods ?

Upvotes: 0

Views: 786

Answers (1)

Kevin Pilch
Kevin Pilch

Reputation: 11615

You can either create a Solution and add the file to a project in that Solution (using Solution.Create(), or else use the basic formatting provided by NormalizeWhitespace().

Upvotes: 2

Related Questions