zed/assets
Nathan Sobo ad44b459cd
Improve content generation prompt to reduce over-generation (#16333)
I focused on cases where we're inserting doc comments or annotations
above symbols.

I added 5 new examples to the content generation prompt, covering
various scenarios:

1. Inserting documentation for a Rust struct
2. Writing docstrings for a Python class
3. Adding comments to a TypeScript method
4. Adding a derive attribute to a Rust struct
5. Adding a decorator to a Python class

These examples demonstrate how to handle different languages and common
tasks like adding documentation, attributes, and decorators.

To improve context integration, I've made the following changes:

1. Added a `transform_context_range` that includes 3 lines before and
after the transform range
2. Introduced `rewrite_section_prefix` and `rewrite_section_suffix` to
provide more context around the section being rewritten
3. Updated the prompt template to include this additional context in a
separate code snippet

Release Notes:

- Reduced instances of over-generation when inserting docs or
annotations above a symbol.
2024-08-15 22:20:11 -06:00
..
fonts Fix font selection on macOS (#13615) 2024-06-27 17:02:45 -06:00
icons assistant: Change the quote selection crease icon (#16180) 2024-08-13 17:31:23 -03:00
keymaps Revert "Match VSCode behavior for ctrl-a/ctrl-e on MacOS" (#16246) 2024-08-14 14:51:49 -06:00
prompts Improve content generation prompt to reduce over-generation (#16333) 2024-08-15 22:20:11 -06:00
settings context_servers: Add initial implementation (#16103) 2024-08-15 10:49:30 -04:00
sounds Update collaboration sounds, add sounds to screensharing 2023-07-04 16:18:42 -04:00
themes linux: Indicate when the window is focused (#14266) 2024-07-12 14:20:58 -07:00