CodeBuddy is a powerful Visual Studio Code extension that integrates various generative AI models to enhance your coding workflow and productivity.
This extension provides a wide range of AI-powered features to assist developers in their daily coding tasks, from code generation and refactoring and to unit test creation.
https://marketplace.visualstudio.com/items?itemName=fiatinnovations.ola-code-buddy
- Local codebase indexing. Perform retrieval-augmented generation (RAG) on the codebase.
- Context Pinning. Pin directories, and files, (functions, classes, etc.) as persistent context. AI Models to reference these items for every suggestion, across Chat and Commands.
- Persistent Context. AI model to use certain context throughout a conversation and across different conversations by configuring the Context.
- Create Code base Documentation.
- Orchestrator. Coordinate AI model activities with Agent capabilities, through tools and function calling.
- Access to real-time data.
- Support for local LLMs such as Ollama
- Code search. Search code across the entire codebase
.
├── src/
│ ├── events/
│ ├── providers/
│ ├── services/
│ ├── test/
│ ├── webview/
│ ├── constant.ts
│ ├── extension.ts
│ └── utils.ts
├── CHANGELOG.md
├── CONTRIBUTING.md
├── package.json
├── README.md
└── tsconfig.json
Key Files:
src/extension.ts
: Main entry point for the extensionsrc/events/
: Contains event handlers for various CodeBuddy featuressrc/providers/
: Implements providers for different AI models and webviewssrc/services/
: Contains service classes for chat management and AI model integrationpackage.json
: Defines extension metadata, dependencies, and configuration
- Ensure you have Visual Studio Code version 1.78.0 or higher installed.
- Install the CodeBuddy extension from the Visual Studio Code Marketplace.
- Open VS Code settings (File > Preferences > Settings).
- Search for "CodeBuddy" in the settings search bar.
- Configure the following settings:
- Select the Generative AI model (Gemini, Groq, Anthropic, or XGrok)
- Enter the API key for your chosen model
- Choose your preferred font family and chat view theme
- Open a Vscode workspace/file containing some code
- Right-click on the selected code to access CodeBuddy features in the context menu.
- Access the chat interface via the CodeBuddy panel in the Activity Bar.
- Code Comments: Generate meaningful comments for your code.
- Code Review: Get AI-powered code reviews and suggestions.
- Code Refactoring: Automatically refactor selected code.
- Code Optimization: Optimize your code for better performance.
- Code Explanation: Get detailed explanations of complex code snippets.
- Commit Message Generation: Create meaningful commit messages based on your changes.
- Inline chat for a quick conversation with the Codebuddy
- Code Chart Generation: Create visual representations of your code structure.
-
API Key Issues:
- Problem: "Failed to generate content" error message.
- Solution: Double-check your API key in the CodeBuddy settings.
-
Model Selection:
- Problem: Features not working as expected.
- Solution: Ensure you've selected the correct AI model in the settings.
-
Performance Issues:
- Problem: Slow response times from CodeBuddy.
- Solution: Check your internet connection and consider switching to a faster AI model.
To enable debug mode:
- Open the Output panel in VS Code (View > Output).
- Select "CodeBuddy" from the dropdown menu.
- Look for debug information and error messages in the output.
When a user interacts with CodeBuddy, the following data flow occurs:
- User Input: The user selects a code or enters a query in the CodeBuddy chat panel.
- Extension Processing: The
extension.ts
file manages the user's action and directs it to the appropriate event handler in theevents/
directory. - AI Model Integration: The chosen AI model (Gemini, Groq, Anthropic, or XGrok) is activated through the respective provider in the
providers/
directory. - API Request: The provider requests the AI service's API using the user's input and any necessary context.
- Response Processing: The provider receives and processes the AI service's response.
- User Interface Update: The processed response is relayed back to the user interface, updating either the code editor or the chat panel.
[User Input] -> [Extension] -> [Event Handler] -> [AI Provider] -> [AI API]
|
[User Interface] <- [Extension] <- [Event Handler] <- [AI Provider] <-'
Note: The chat history and other session data are managed by the ChatManager
service to maintain context across interactions.
N/A - This is a Visual Studio Code extension and does not require separate deployment.
N/A - This project does not have a dedicated infrastructure stack.