coderAI is a Visual Studio Code extension designed to simplify the process of writing docstrings for python in the desired format for various programming languages. This tool leverages customizable prompts to ensure the generated docstrings meet your coding standards and project requirements.
Features
Generate Docstrings: Automatically generate docstrings in your preferred format tailored to the programming language you're working with.
Customizable Prompts: Define custom prompts per language to guide the docstring generation process.
Keyboard Shortcut: Trigger docstring generation quickly with a single command (cmd+h on macOS or ctrl+h on Windows/Linux).
AI Integration: Leverages an AI engine for intelligent docstring generation using API configuration settings.
Demo
Coming soon
Support for javascript
Example
Write consistent, professional docstrings effortlessly:
# Input
def add(a, b):
return a + b
# Output (using Python-specific prompt)
"""
Adds two numbers.
Args:
a (int): The first number.
b (int): The second number.
Returns:
int: The sum of the two numbers.
"""
Requirements
This extension depends on:
AI Engine: Ensure you have an AI service running and accessible via the configured URI and authentication settings.
This extension contributes the following settings:
**coder.aiEngineURI** (default: http://127.0.0.1:11434): Specify the URI of the AI engine API.
**coder.aiEngineAuthKey** (default: api-key): Set the API header key for authentication.
**coder.aiEngineAuthValue** (default: value): Set the API header value for authentication.
**coder.langPrompts**:
Define custom prompts for each language. Example:
[
{
"language": "python",
"prompt": "Adds two numbers together.\n\nArgs:\n a (int): The first number.\n b (int): The second number.\n\nReturns:\n int: The sum of the two numbers.\n\nRaises:\n ServiceUnavailable: If the request times out or the response code is not 2xx."
}
]
**coder.autoSave** (default: false): Controls if extension will autosave changes or not.
**coder.aiEngine** : Controls which AIENgine is being used.