microsoft / microsoft/typespec
[http-client-csharp] generated sample files should be treated differently
- Dominant language
- Java
- Stars
- 5.9k
- Forks
- 394
- Avg merge
- 1d 23h
- Merged PRs (30d)
- 104
Description
Now all the file writing work was handled by Microsoft.TypeSpec.Generator.
If we want to write files for samples, we will have to add them into the outputlibrary, and the system will handle them and write them.
But sample files are a little bit different from source code files.
Sample files should not need visitors. Sample files should be generated based on those typeproviders that have gone through their corresponding visitors.
Currently we did not have a system to ensure this.
Now all the typeproviders are put in the same `OutputLibrary.OutputTypes` list, if we want to ensure when we write those samples, all other source code related stuffs have all been through the visitors, the best we could do is to put all the sample providers at the end of the list. But considering samples might access to members of other providers, which might accidentally prematurely initialize some of the providers.
Contributor guide
Assessment
This issue has not been assessed yet.