@@ -12,21 +12,31 @@ type CodeFormatter =
1212 return results |> Array.map ( fun ( ast , DefineCombination ( defines )) -> ast, defines)
1313 }
1414
15- static member FormatASTAsync ( ast : ParsedInput ) : Async < FormatResult > =
16- CodeFormatterImpl.formatAST ast None FormatConfig.Default None |> async.Return
17-
18- static member FormatASTAsync ( ast : ParsedInput , config ) : Async < FormatResult > =
19- CodeFormatterImpl.formatAST ast None config None |> async.Return
15+ static member FormatASTAsync ( ast : ParsedInput ) : Async < string > =
16+ async {
17+ let result = CodeFormatterImpl.formatAST ast None FormatConfig.Default None
18+ return result.Code
19+ }
2020
21- static member FormatASTAsync ( ast : ParsedInput , source ) : Async < FormatResult > =
22- let sourceText = Some( CodeFormatterImpl.getSourceText source)
21+ static member FormatASTAsync ( ast : ParsedInput , config ) : Async < string > =
22+ async {
23+ let result = CodeFormatterImpl.formatAST ast None config None
24+ return result.Code
25+ }
2326
24- CodeFormatterImpl.formatAST ast sourceText FormatConfig.Default None
25- |> async.Return
27+ static member FormatASTAsync ( ast : ParsedInput , source ) : Async < string > =
28+ async {
29+ let sourceText = Some( CodeFormatterImpl.getSourceText source)
30+ let result = CodeFormatterImpl.formatAST ast sourceText FormatConfig.Default None
31+ return result.Code
32+ }
2633
2734 static member FormatASTAsync ( ast : ParsedInput , source , config ) : Async < FormatResult > =
28- let sourceText = Some( CodeFormatterImpl.getSourceText source)
29- CodeFormatterImpl.formatAST ast sourceText config None |> async.Return
35+ async {
36+ let sourceText = Some( CodeFormatterImpl.getSourceText source)
37+ let result = CodeFormatterImpl.formatAST ast sourceText config None
38+ return result
39+ }
3040
3141 static member FormatDocumentAsync ( isSignature , source ) =
3242 CodeFormatterImpl.formatDocument FormatConfig.Default isSignature ( CodeFormatterImpl.getSourceText source) None
0 commit comments