Skip to content

Extension: Generate from TypeSpec does not work with client.tsp as entrypoint file #6062

Open
@swathipil

Description

@swathipil

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:

parameters:
  "service-dir":
    default: "sdk/schemaregistry"
  "dependencies":
    "additionalDirectories": []
    default: ""
emit:
  - "@azure-tools/typespec-autorest"
  - "@typespec/http-client-python"
linter:
  extends:
    - "@azure-tools/typespec-azure-rulesets/data-plane"
options:
  "@azure-tools/typespec-autorest":
    azure-resource-provider-folder: "data-plane"
    emit-lro-options: "none"
    emitter-output-dir: "{project-root}/../"
    output-file: "data-plane/Microsoft.SchemaRegistry/{version-status}/{version}/sc\
      hemaregistry.json"
  "@typespec/http-client-python":
    package-dir: "azure-schemaregistry"
    package-name: "{package-dir}"
    emitter-output-dir: "{project-root}/azure-schemaregistry/_generated/"
    package-version: 1.3.0b4
    generate-packaging-files: false
    flavor: azure
    generate-test: true
    generate-sample: true
  "@azure-tools/typespec-python":
    package-dir: "azure-schemaregistry"
    package-name: "{package-dir}"
    emitter-output-dir: "{project-root}/azure-schemaregistry/_generated/"
    package-version: 1.3.0b4
    generate-packaging-files: false
    flavor: azure
    generate-test: true
    generate-sample: true
  "@azure-tools/typespec-java":
    package-dir: "azure-data-schemaregistry"
    namespace: com.azure.data.schemaregistry
    partial-update: true
    flavor: azure
  "@azure-tools/typespec-ts":
    package-dir: "schema-registry"
    generateMetadata: false
    generateTest: false
    packageDetails:
      name: "@azure/schema-registry"
    flavor: azure
  "@azure-tools/typespec-csharp":
    package-dir: "Azure.Data.SchemaRegistry"
    namespace: "{package-dir}"
    clear-output-folder: true
    model-namespace: true
    flavor: azure

Reproduction

  1. Add the main.tsp, client.tsp, tspconfig.yaml into the project.
  2. Image
  3. Image

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingideIssues for VS, VSCode, Monaco, etc.

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions