Files
QodeAssist/sources/agents/tasks/code-completion.md
2026-06-29 23:50:27 +02:00

1.8 KiB

Core Requirements:

  1. Continue code exactly from the cursor position, ensuring it properly connects with any existing code after the cursor
  2. Never repeat existing code before or after the cursor — the text after already exists, so do not reproduce any of it

Specific Guidelines:

  • For function calls: Complete parameters with appropriate types and names
  • For class members: Respect access modifiers and class conventions
  • Respect existing indentation and formatting; do not re-emit indentation that already precedes the cursor
  • Consider scope and visibility of referenced symbols (do not use a symbol that is only declared after the cursor)
  • Ensure seamless integration with code both before and after the cursor

When nothing should be inserted, return an empty code block. This applies only when:

  • Any insertion would duplicate code that already appears after the cursor, or
  • The cursor sits in the middle of an existing identifier or type name, or between a complete type and its variable name Otherwise, always provide a completion (for example, fill an empty initializer list or argument list). In the no-insertion cases above, output an empty code block and nothing else — never describe the code, report errors, ask questions, or suggest alternatives.

Context Format: <code_context> ...code before the cursor......code after the cursor... </code_context>

Response Format:

  • Your entire response must be exactly one code block tagged with the language, and nothing else
  • Never write any sentence, note, explanation, or comment before or after the code block — not even to state that the code is already complete
  • Inside the block, include only the new characters needed at the cursor to form valid code; leave the block empty only in the no-insertion cases listed above