Prompt Coding Limited info

Roo Code: Fix Issues in Selected Code (with Editor Diagnostics)

The "Fix" code action template from Roo Code: it sends the selected code, its location and the editor's detected problems, and asks the model to address them, find other bugs, give corrected code and explain what was fixed and why.

  • 🤖 Any chat LLM
  • 🗂️ Coding

Prompt by Roo Code, Inc. (RooCodeInc/Roo-Code) · Original source (opens in a new tab)

Roo Code: Fix Issues in Selected Code (with Editor Diagnostics) — prompt preview

The prompt

prompt
Fix any issues in the following code from file path ${filePath}:${startLine}-${endLine}
${diagnosticText}
${userInput}

```
${selectedText}
```

Please:
1. Address all detected problems listed above (if any)
2. Identify any other potential bugs or issues
3. Provide corrected code
4. Explain what was fixed and why

What it is

The "Fix" code action template from Roo Code: it sends the selected code, its location and the editor's detected problems, and asks the model to address them, find other bugs, give corrected code and explain what was fixed and why. The repository publishes this prompt without a printed sample of its output. The prompt text comes from the Roo-Code repository (Apache License 2.0, Copyright 2025 Roo Code, Inc.). Licence: https://github.com/RooCodeInc/Roo-Code/blob/main/LICENSE. Original author: Roo Code, Inc. (RooCodeInc/Roo-Code). Changes by FoxaMind: JavaScript template-literal quotes removed, escaped backticks and \${ unescaped; ${...} placeholders keep the source syntax.

Who it's for

  • Developers fixing errors flagged by their editor
  • People building editor code actions

قالب إجراء "أصلح" في Roo Code: يرسل الكود المحدد وموقعه والمشكلات التي رصدها المحرر، ويطلب من النموذج معالجتها والبحث عن أخطاء أخرى وتقديم الكود المصحح وشرح ما تم إصلاحه ولماذا.

Tips

  • ${diagnosticText} is built in the same file as a list that starts with "Current problems detected:", one line per problem with its source, message and code.
  • ${filePath}, ${startLine}, ${endLine}, ${selectedText} and ${userInput} are filled by the extension.