Quick Edit Templates
AI Editing Templates are reusable prompt templates that can be “attached” to functions, classes or any other types of symbols:You can configure the edit templates via AI->Manage Quick Edit Templates:
Under the hood, clicking on a quick edit template is equivalent to starting a normal AI edit and copying the prompt into the prompt window. You can even step back from a template-based edit, tweak the copied prompt and retry it.
Typical Use
Quick Edit templates are useful for common small actions like:
- Generating a ToString() method
- Adding null checks
- Adding try/catch wrappers
The benefit of using AI instead of just code snippets is that you can give reasonably generic instructions and still get good results. For instance, generating a ToString() method by just printing the values of all properties would not work for large classes. Printing the first 3 properties would not always be useful. But something like “pick the most important ones” and “if the struct contains a length-like field or property, print {N} elements” will produce reasonably good results. And, since AI editing is iterative and fast, you can give the AI a nudge like “use Foo instead of Bar” during the reviewing phase, and it will very quickly change the proposed implementation to your liking.