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

Go CodeGen should address the errors and warnings from TCGC #1485

Open
Tracked by #2070
lirenhe opened this issue Jan 13, 2025 · 3 comments
Open
Tracked by #2070

Go CodeGen should address the errors and warnings from TCGC #1485

lirenhe opened this issue Jan 13, 2025 · 3 comments
Milestone

Comments

@lirenhe
Copy link
Member

lirenhe commented Jan 13, 2025

We need to empower our customers both internal and external to easily trouble shooting and fix spec issues that would block the CodeGen.

Today, TCGC could already do the check on the patterns and results from TypeSpec compiler and reports warning and errors for the unsupported case and invalid usage.

However, our CodeGen didn't address those errors and warnings from TCGC in the implementation and in most cases would continue the codegen which would result in unexpected generated code & error. When that happens, the outcome would be difficult to trouble shooting.

Proposals:

  • Go CodeGen need to display those warnings and errors in the command line output instead of ignoring them.
  • Go CodeGen should properly address the errors and warnings to provide a better user experience.
@tadelesh
Copy link
Member

tcgc issue here: Azure/typespec-azure#1487.
java impl reference: microsoft/typespec#4382.

@jhendrixMSFT
Copy link
Member

Regarding "Go CodeGen should properly address the errors and warnings to provide a better user experience.", does this mean we need to do something more that just context.program.reportDiagnostics(sdkContext.diagnostics);?

@jhendrixMSFT
Copy link
Member

Also, is there a reason why tcgc's createSdkContext() can't report the diagnostics? It should have access to the context.program to do so. This way, emitters don't have to do it (they all get it for free).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants