-
Notifications
You must be signed in to change notification settings - Fork 245
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
Extension: Generate from TypeSpec does not work with client.tsp as entrypoint file #6062
Comments
@timotheeguerin , @allenjzhang , do you have more context about using the client.tsp as entrypoint? I checked our doc but it only mentioned main.tsp as entrypoint. |
typespec takes whatever input file you give it tsp compile . // resolve the input file for the current folder which could be main.tsp or what is configured in the package.json if its there
tsp compile client.tsp // compile client.tsp
tsp compile other.tsp // compile other.tsp if the generation is assumining its always resolving a main.tsp and not building the file that the user asked this is broken then |
hello @swathipil The default entrypoint file is you can set
|
This is not an good solution. The spec repo has a single package.json that should be touched and hundreds of specs. |
In typespec extension, when customer select a tsp file to generate, there will be two options:
Option 1 more convenience, but as for a tsp project, the generated code may not acceptable if the selected file is not mainEntrypointTspFile. typespec extension choose Option 2, make sure every round of generation generate code for the whole project. In spec repo, it may not be suitable. |
Describe the bug
I've copied over the main.tsp and client.tsp from [this] folder into a test project following these instructions.
I tried to "Generate from TypeSpec" with the client.tsp and Python emitter specified, but it's still using main.tsp as the entrypoint file and the client.tsp changes are not being applied during Python client generation.
tspconfig.yaml:
Reproduction
I'm not sure if the entrypoint file needs to be set/change elsewhere in the config files. However, I believe it should automatically use the client.tsp file as the entrypoint file/apply those if I'm explicitly right-clicking on that file for generation.
Checklist
The text was updated successfully, but these errors were encountered: