Skip to content
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

ISourceGenerator should have async methods #44045

Closed
springy76 opened this issue May 7, 2020 · 4 comments
Closed

ISourceGenerator should have async methods #44045

springy76 opened this issue May 7, 2020 · 4 comments
Labels
Area-Compilers Discussion New Feature - Source Generators Source Generators Resolution-By Design The behavior reported in the issue matches the current design

Comments

@springy76
Copy link

Please don't repeat the same design error as aspnetcore1.0 did with the unmodified IFileProvider imported from Owin/Katana.

@jcouv
Copy link
Member

jcouv commented May 7, 2020

FYI @chsienki

@chsienki
Copy link
Contributor

chsienki commented May 7, 2020

The ISourceGenerator methods are synchronous by design. Generators shouldn't be doing any I/O bound work: the reading of files etc should be handled by the compiler itself, and the generator just accesses the contents.

I'm going to close this as by-design, but feel free to add comments if there are scenarios that you think can only be achieved with async.

@chsienki chsienki closed this as completed May 7, 2020
@chsienki chsienki added the Resolution-By Design The behavior reported in the issue matches the current design label May 7, 2020
@as-ivanov
Copy link

Hi @chsienki,

I'm going to close this as by-design, but feel free to add comments if there are scenarios that you think can only be achieved with async.

What if I need to generate, say, a typescript or json-schema file based on my C# code? In case source generators (or analyzers) had async flow, async I/O could be utilized for that.
From the other hand source generators do not provide any API for generating arbitrary files. Do you have an intention to support possibility of generating arbitrary content in future?

@CyrusNajmabadi
Copy link
Member

Do you have an intention to support possibility of generating arbitrary content in future?

No, there is no intention to support that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Compilers Discussion New Feature - Source Generators Source Generators Resolution-By Design The behavior reported in the issue matches the current design
Projects
None yet
Development

No branches or pull requests

5 participants