You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are a set of Microsoft emitter whose name convention is @typespec/{protocol}-{client|server}-{language}-{framework} and {framework} part is optional. for example, the csharp emitter name will be @typespec/http-client-csharp. (see loop typespec's codegen ecosystem
TCGC now only adopt "@azure-tools/typespec-{language}" format to parse emitter name( see following). Need to adopt the new emitter name format.
export function parseEmitterName(
program: Program,
emitterName?: string
): [string, readonly Diagnostic[]] {
const diagnostics = createDiagnosticCollector();
if (!emitterName) {
diagnostics.add(
createDiagnostic({
code: "no-emitter-name",
format: {},
target: program.getGlobalNamespaceType(),
})
);
return diagnostics.wrap("none");
}
const regex = /(?:cadl|typespec)-([^\\/]*)/;
const match = emitterName.match(regex);
if (!match || match.length < 2) return diagnostics.wrap("none");
const language = match[1];
if (["typescript", "ts"].includes(language)) return diagnostics.wrap("javascript");
return diagnostics.wrap(language);
}
Expected:
TCGC adopt the new emitter name format and parse out the language from emitter name.
The text was updated successfully, but these errors were encountered:
There are a set of Microsoft emitter whose name convention is
@typespec/{protocol}-{client|server}-{language}-{framework}
and{framework}
part is optional. for example, the csharp emitter name will be@typespec/http-client-csharp
. (see loop typespec's codegen ecosystemTCGC now only adopt "@azure-tools/typespec-{language}" format to parse emitter name( see following). Need to adopt the new emitter name format.
Expected:
TCGC adopt the new emitter name format and parse out the language from emitter name.
The text was updated successfully, but these errors were encountered: