microsoft / typespec

https://typespec.io/
MIT License
4.55k stars 222 forks source link

[vscode] Support SDK Generation for un-branded SDK from TypeSpec with major languages in VSCode Extension #5025

Open lirenhe opened 2 weeks ago

lirenhe commented 2 weeks ago

Clear and concise description of the problem

We need to support SDK Generation for un-branded SDK from TypeSpec for Java, .NET, Python, JS and GO in VSCode Extension

### Tasks
- [ ] document the emitter settings needed for un-branded generation
- [ ] Release @typespec/http-client-language for emitters so that we could have consistent settings in tspconfig files and avoid future breaking change
- [ ] @typespec/http-client-language for emitters need to have a way to map to supported compiler version because we have a strict version dependency rule now (i.e. openapi3 has the same minor # as compiler). Otherwise the Codegen scenario would likely fail because the emitter's package can't install with existing compiler.

Checklist

RodgeFu commented 2 weeks ago

About the settings that end-user must configure before the codegen can work. It's better for us to have a way for IDE to figure them out instead of hardcoded. (i.e. if IDE finds the setting is required without default, we would consider it needs customer input? Or any better suggestions are welcome.)

timotheeguerin commented 2 weeks ago

yeah we should try to keep the ide away from hard coding any libraries or emitters and count on the user config to figure out things and established compiler apis.

Would be good to understand what is actually wanted here? Running tsp compile . is the only thing needed and we have task for that already right @RodgeFu ?

RodgeFu commented 2 weeks ago

this is to improve the end-to-end user experience when emitting common un-branded SDK code in vs code. Users should be able to generate code by using our selected common default emitters (i.e. C#) easily without checking command or related doc. Just some clicks in VS code should be all user needs to do. (And as the next step, user should be able to customize these emitters in the list through configuration as needed just like recommended extensions).

The POC below should be able to give you a brief idea about it (the emit part). Feel free to let us know if you have any suggestions on it. thanks. https://microsoftapc-my.sharepoint.com/:v:/g/personal/wenjiefu_microsoft_com/Ecw5qN49uEdEsjKDe3PQ9IEBlsu_jHfjQ2HK-1QxbnVOgQ