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

Compiler/Emitter behavior consistency and improvement #5660

Open
7 tasks
Tracked by #2070
allenjzhang opened this issue Jan 17, 2025 · 1 comment
Open
7 tasks
Tracked by #2070

Compiler/Emitter behavior consistency and improvement #5660

allenjzhang opened this issue Jan 17, 2025 · 1 comment
Assignees

Comments

@allenjzhang
Copy link
Member

allenjzhang commented Jan 17, 2025

Compiler improvements:

  • Display emitters being invoked. This is helpful when there are multiple emitters, users will be able to see the progress.
  • When multiple emitters run, if one emitter fails, currently compiler skip the rest. We should decide whether we want to change the behavior to run all. If not, minimally should display message telling user we have skipped the rest of xxx emitters.
  • When crash happens, write out detailed log including callstack in a temp file instead of showing on console

Consistent behavior among emitters

  • Currently C# directly write out to console on files generated while other emitters writes nothing. They should be consistent. We should decide what's the rule and ways to allow emitter/user to see message at different level.
  • Proposed rules:
    • When dealing with KNOWN bad states, each emitter should use diagnostic report at the consistent level.
    • For UNKNOWN bad states, they are allow to throw which generates callstacks & display File a bug message.
  • Each emitter output same given an empty spec
  • Champion scenario specs & common known bad state specs should be checked into Spector http-spec for regression tracking

More to add?

@ArcturusZhang
Copy link
Member

Hi @allenjzhang maybe we should also design pages for those known bad states (defined either in compiler/TCGC/language emitters) and put them inside typespec.io or typespec-azure.io about why this happens, how to fix it, examples, etc just like those compiler reported errors in other languages such as this.
In this way, when a user sees the diagnostic warning or error, there is a code that they could search for in our document pages.

To build this page, I would like to propose that we do it through automation inside of writing docs from scratches. Such as those reference docs for our decorators, we write them inside our code as comments, and there is a tool to extract them out as a doc page. We should do the same for those diagnostic error/warning pages.

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

No branches or pull requests

6 participants