-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SDLPrinter.Print in addition to SDLPrinter.PrintAsync #275
Comments
Agreed. Unfortunately this would duplicate almost all of the code in both ASTVisitor.cs and SDLPrinter.cs. FYI if you’re writing to a string builder or MemoryStream, I believe |
And it would necessitate duplicating all of the relevant tests for the AST walker and SDL printer. It's just a whole lot of code duplication to properly add synchronous support. Perhaps a temporary solution might be to add a |
Would replacing |
It looks like a good solution, straightforward for the end user, with all tedious caveats resolved internally. |
Note that performance benefits of While there are some limitations with You may be interested in these relevant articles on the use of
Notably, while .NET Framework might require up to 4 allocations the first time
Just FYI |
@Shane32 Thank you for taking an action on this. Looking forward to the next version with |
Is your feature request related to a problem? Please describe.
Having only
SDLPrinter.PrintAsync
is inconvenient in synchronous scenarios.Not usually recommended
Result
orGetAwaiter().GetResult()
seemingly works(so far? by chance?) but produces the code analysis issue / warning
CA2012
:The recommended above safe way of getting
ValueTask
result is somewhat convoluted.Describe the solution you'd like
The synchronous
SDLPrinter.Print
free of potential issues would be handy.The text was updated successfully, but these errors were encountered: