feat: add :CoderTransform command for inline tag replacement

New feature: Transform /@ @/ tags directly in any file, not just
.coder.* files. The tags are replaced inline with LLM-generated code.

New commands:
- :CoderTransform - Transform ALL /@ @/ tags in current file
- :CoderTransformCursor - Transform only the tag at cursor position
- :Coder transform - Same as :CoderTransform
- :Coder transform-cursor - Same as :CoderTransformCursor

How it works:
1. Write /@ your prompt @/ anywhere in your code
2. Run :CoderTransform
3. The tag is replaced with generated code matching your file's style

Example:
  /@ create a function to validate email @/

  Becomes:
  function validateEmail(email) {
    return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email);
  }
This commit is contained in:
2026-01-11 15:38:41 -05:00
parent 8130a78ed5
commit d11a99ee61
3 changed files with 470 additions and 247 deletions

View File

@@ -4,6 +4,13 @@
local M = {}
/@
create a prompt to generate code based on user description
-- @usage M.create_function
-- @param description string Description of the code to generate
-- @return string Prompt template
@/
--- Prompt template for creating a new function
M.create_function = [[Create a function with the following requirements: