private async void FormatCode(string path)
{
string code = File.ReadAllText(path);
SyntaxTree syntaxTree = CSharpSyntaxTree.ParseText(code);
var root = await syntaxTree.GetRootAsync();
var formattedRoot = Formatter.Format(root, Formatter.Annotation, new AdhocWorkspace());
string formattedCode = formattedRoot.ToFullString();
File.WriteAllText(path, formattedCode);
}
private async void FormatCode(string path)
{
string code = File.ReadAllText(path);
SyntaxTree syntaxTree = CSharpSyntaxTree.ParseText(code);
var root = await syntaxTree.GetRootAsync();
var formattedRoot = Formatter.Format(root, Formatter.Annotation, new AdhocWorkspace());
string formattedCode = formattedRoot.ToFullString();
File.WriteAllText(path, formattedCode);
}