未验证 提交 84582826 编写于 作者: C Chris Sienkiewicz 提交者: GitHub

Update docs/features/source-generators.cookbook.md

Co-Authored-By: NPhillip Carter <pcarter@fastmail.com>
上级 42a568f3
......@@ -141,7 +141,7 @@ public class FileTransformGenerator : ISourceGenerator
### Augment user code
**User scenario:** As a generator author I want to be able to inspect and augment a users code with new functionality.
**User scenario:** As a generator author I want to be able to inspect and augment a user's code with new functionality.
**Solution:** Require the user to make the class you want to augment be a `partial class`, and mark it with e.g. a unique attribute, or name.
Register a `SyntaxReceiver` that looks for any classes marked for generation and records them. Retrieve the populated `SyntaxReceiver`
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册