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

[tcgc] put all scope for decorator to the last calculation priority #1961

Open
tadelesh opened this issue Dec 7, 2024 · 0 comments
Open
Labels
lib:tcgc Issues for @azure-tools/typespec-client-generator-core library

Comments

@tadelesh
Copy link
Member

tadelesh commented Dec 7, 2024

for the following typespec:

@clientName("Bar")
@clientName("Baz", "go")
model A {
}
 
@@clientName(A, "Foo", "csharp");
@@clientName(A, "Qux", "java");

current tcgc result for A name is:
csharp -> "Foo"
java -> "Qux"
others -> "Bar"

we received feedback about why go does not get the Baz name but get Bar.
the reason is tcgc get the @clientName decorator info for A from compiler with:
"Baz" for "go";
"Bar" for all;
"Foo" for csharp";
"Qux" for "java";
then, tcgc handle them one by one, and overwrite former with the later setting. that's our current design.

we are thinking about put the all scope to the last calculation, which could make the result more reasonable. if multiple setting for all scope, still later overwrite former, but when calculation, all scope is the last priority.

then the result for the above example should be:
csharp -> "Foo"
java -> "Qux"
go -> "Baz"
others -> "Bar"

@tadelesh tadelesh added the lib:tcgc Issues for @azure-tools/typespec-client-generator-core library label Dec 7, 2024
@tadelesh tadelesh changed the title [tcgc] put all scope for decorator to the last calculation priority [tcgc] put all scope for decorator to the last calculation priority Dec 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lib:tcgc Issues for @azure-tools/typespec-client-generator-core library
Projects
None yet
Development

No branches or pull requests

1 participant