Legacy Coding Assistant Configuration¶
These are configuration options that can still be applied to Sourcery, but are mainly focused on older elements of our IDE integration and are less applicable to the current code reviews.
Enabling/Disabling the Coding Assistant¶
In order to use Sourcery Chat or the Sourcery Coding Assistant you need to send relevant pieces of your code and your messages to third party model providers.
If you want to opt out completely, you can do so through your user-level
sourcery.yaml file.
To disable the Coding Assistant update this section of the file to:
coding_assistant:
enabled: False
Customising Recipes¶
You can customise the prompts for recipes by adding a recipe_prompts section
to your sourcery.yaml file. The custom prompts will be appended to the recipe
prompt when the recipe is called.
The available recipe names are:
generate_testsgenerate_diagramexplain_codegenerate_docstrings
coding_assistant:
recipe_prompts:
<recipe_name>: <custom_prompt>
Suggest AI Fixes¶
By default, in VS Code, Sourcery will suggest AI fixes for all problems in the
Problems pane. You can switch this feature on or off by setting the
suggestFixes setting to true or false in the VS Code settings. This can
also be accessed from the settings menu in the Sourcery sidebar.
Code Lens Configuration¶
Code Lenses are the Sourcery command shortcuts that appear above a section of
code (eg. Generate Tests) and trigger a response from the Coding Assistant. To
disable the Code Lenses go to the Sourcery extension/plugin settings in your IDE
and uncheck the Sourcery: Code Lens option.