A VSCode extension that uses LLM-powered code completion to help developers write code more efficiently. This extension leverages the Ollama API to generate contextually relevant code suggestions based on your current code.
This extension provides intelligent code completion using a local LLM through Ollama:
- Context-Aware Completions: The extension analyzes your code context to provide relevant suggestions
- Right-Click to Complete Code: Simply right-click in your editor and select "Complete code" from the context menu
- Progress Notification: A notification shows the progress while the LLM generates your code completion
- Ollama must be installed and running locally
- The
qwen2.5-coder:7bmodel should be pulled in Ollama (or modify the model in the source code)
- Clone this repository
- Run
npm installto install dependencies - Run
npm run compileto compile the TypeScript code - Press F5 in VSCode to launch the extension in debug mode
- Open any code file in VSCode
- Position your cursor where you want to insert code
- Right-click and select "Complete code" from the context menu
- Wait for the LLM to generate a completion (a notification will show progress)
- The generated code will appear in a VSCode Webview
- You can copy the code or insert it at your cursor position
The extension uses the following components:
- ReviewProvider: Interfaces with the Ollama API to generate code completions
- Context Menu Integration: Provides a right-click option to trigger code completion
- Code Context Analysis: Extracts relevant code context from your current file
The extension is built with:
- TypeScript
- VSCode Extension API
- LangChain.js for Ollama integration
- Ollama for local LLM inference
- The extension requires Ollama to be running locally
- Large code completions may take some time to generate depending on your hardware
- The extension currently uses a fixed number of lines for context (6 lines)
- Add configuration options for model selection
- Implement customizable context window size
- Add support for more advanced code generation features
- Improve error handling and user feedback
Users appreciate release notes as you update your extension.
Initial release of ...
Fixed issue #.
Added features X, Y, and Z.
Ensure that you've read through the extensions guidelines and follow the best practices for creating your extension.
You can author your README using Visual Studio Code. Here are some useful editor keyboard shortcuts:
- Split the editor (
Cmd+\on macOS orCtrl+\on Windows and Linux). - Toggle preview (
Shift+Cmd+Von macOS orShift+Ctrl+Von Windows and Linux). - Press
Ctrl+Space(Windows, Linux, macOS) to see a list of Markdown snippets.
Enjoy!