AI Lens is a powerful Visual Studio Code extension designed to enhance your coding experience with advanced artificial intelligence capabilities. This all-in-one coding assistant provides features such as code refactoring, bug fixing, unit test case generation, code optimization, explanation assistance, and general support.
Features
Code Refactoring: Improve code readability and maintainability effortlessly with intelligent refactoring suggestions.
Bug Fixing: Identify and resolve bugs with precision using static code analysis and machine learning algorithms.
Unit Test Case Generation: Increase test coverage by automatically generating unit test cases for your code.
Code Optimization: Optimize your code for improved performance and resource utilization.
Explanation Assistance: Receive detailed explanations for complex code segments, algorithms, and logic.
General Assistance: Access context-aware assistance, syntax references, API documentation, and coding best practices.
Installation
Open Visual Studio Code.
Navigate to Extensions (or press Ctrl + Shift + X).
Search for "AI Lens" and click "Install" on the official extension.
API Key
To use our assistant, you need to obtain an API key from Google's AI platform at https://ai.google.dev/.
Usage
Activate AI Lens:
Use the command palette (Ctrl + Shift + P on Windows, Cmd + Shift + P on Mac) and type "AI Lens: Add Gemini API Key. then Reload VS Code"
Code Refactoring:
Open a code file, select the code you want to refactor, right-click, and choose "AI Lens: Refactor Code" from menu.
Bug Fixing:
Detect and fix bugs by right-clicking and selecting "AI Lens: Find Bug Code" from the menu.
Unit Test Case Generation:
Trigger unit test case generation to enhance test coverage by selecting "AI Lens: Write unit test case" from the menu.
Code Optimization:
Optimize your code for performance by applying suggested improvements by selecting "AI Lens: Optimize code" from the menu.
Explanation Assistance:
Hover over code segments to receive detailed explanations by selecting "AI Lens: Explain code" from the menu.
General Assistance:
Access general assistance through by selecting "AI Lens: Ask your friend" from the menu.
Issues
Encountered a bug or have a feature request? Reach out to me via Email or LinkedIn.
If you find AI Lens helpful and want to support its development, consider buying me a coffee! Your contribution goes a long way in keeping this project actively maintained and improving.