From 71a704cf27c3a6d4ebc9a05f7d20e7262154a2e6 Mon Sep 17 00:00:00 2001 From: Travis Prescott Date: Tue, 5 Dec 2023 09:32:23 -0800 Subject: [PATCH] Fix incorrect method name. --- cspell.yaml | 1 + docs/extending-typespec/emitter-framework.md | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/cspell.yaml b/cspell.yaml index 4268461c4d..8414054d8a 100644 --- a/cspell.yaml +++ b/cspell.yaml @@ -34,6 +34,7 @@ words: - jsyaml - keyer - lzutf + - mocharc - msbuild - MSRC - multis diff --git a/docs/extending-typespec/emitter-framework.md b/docs/extending-typespec/emitter-framework.md index 3fa78f5ebc..596991bdd5 100644 --- a/docs/extending-typespec/emitter-framework.md +++ b/docs/extending-typespec/emitter-framework.md @@ -24,11 +24,11 @@ Let's walk through each of these types in turn. The asset emitter is responsible for driving the emit process. It has methods for taking TypeSpec types to emit, and maintains the state of your current emit process including the declarations you've accumulated, current emit context, and converting your emitted content into files on disk. -To create your asset emitter, call `createAssetEmitter` on your emit context in `$onEmit`. It takes the TypeEmitter which is covered in the next section. Once created, you can call `emitProgram()` to emit every type in the TypeSpec graph. Otherwise, you can call `emitType(someType)` to emit specific types instead. +To create your asset emitter, call `getAssetEmitter` on your emit context in `$onEmit`. It takes the TypeEmitter which is covered in the next section. Once created, you can call `emitProgram()` to emit every type in the TypeSpec graph. Otherwise, you can call `emitType(someType)` to emit specific types instead. ```typescript export async function $onEmit(context: EmitContext) { - const assetEmitter = context.createAssetEmitter(MyTypeEmitter); + const assetEmitter = context.getAssetEmitter(MyTypeEmitter); // emit my entire typespec program assetEmitter.emitProgram(); @@ -59,7 +59,7 @@ class MyCodeEmitter extends CodeTypeEmitter { } ``` -Passing this to `createAssetEmitter` and calling `assetEmitter.emitProgram()` will console.log all the models in the program. +Passing this to `getAssetEmitter` and calling `assetEmitter.emitProgram()` will console.log all the models in the program. #### EmitterOutput