Inputting a request in SourceCraft Code Assistant
Warning
This feature is only available in Visual Studio Code.
Code Assistant is designed to understand natural language. You do not have to use any special commands or syntax to communicate with it. Simply enter your request in any language as if you were talking to a developer.
Effective request strategies
Put clearly what you want Code Assistant to do. Avoid vague or ambiguous phrasing.
| Strategy | Implementation |
|---|---|
| Be specific | Write: Fix the calculateTotal error which returns incorrect results instead of: Fix my code. |
| Provide context | Use context references @ for links to files and code. |
| Break tasks down | Split complex tasks into smaller, manageable steps. |
| Include examples | Provide code examples if you need a specific format or style. |
Request examples
create a new file named `utils.py` and add a function named `add` that takes two numbers as arguments and returns their sum value
in @src/components/Button.tsx, change the button color to blue
find all instances of the `oldValue` variable in @/src/App.js and replace them with `newValue`
run the `npm install` command in the terminal
explain the `calculateTotal` function in @/src/utils.ts
@problems fix all detected issues
Common mistakes to avoid
| Bad | Good |
|---|---|
| Vague requests | Specify exactly what needs to be done. |
| Assuming context | Explicitly state files and functions. |
| Excessive technical jargon | Use clear, straightforward language. |
| Multiple unrelated tasks | Send one focused request at a time. |
| Continuing without confirmation | Check the code to make sure it is complete. |
Was the article helpful?
Previous
Next