Pieces Copilot
The Pieces Copilot in the Pieces for Visual Studio Extension brings advanced AI features into your coding workflow, such as interchangeable LLMs for adding code comments, generating extra code, debugging, and more.
With the Pieces Copilot, you can create smart code comments, use AI Quick Actions, and ask coding questions with variable context, all without leaving Visual Studio.
Generative AI Conversations
Facing an issue or not sure how to tackle a coding challenge? You can ask the Pieces Copilot specific coding questions directly in Visual Studio using Pieces Copilot in the Solution Explorer
.
You can either ask any question that doesn’t require context, such as “What is the basic format for a .JSON object?” to more in-depth questions where the Pieces Copilot needs context from your active code.
Adding Conversation Context
Contextual awareness enables the Pieces Copilot to help you solve problems more quickly by providing answers that are truly relevant to the issue you're dealing with and your code.
You can add context in the form of specific lines of code, or entire files, right from your active file.
Start by right-clicking some selected code and select one of the following options from the tool menu:
-
Ask Copilot About Selection
: Includes the active selected code with the conversation. -
Ask Copilot About Active File
: Includes the entire active file with the conversation for a broader range of context.
To use this feature, include details like error messages or file context for more accurate responses from the LLM conversation.
You can also add multiple files and other items as context to your prompt, giving the Pieces Copilot comprehensive information to assist you in troubleshooting.
Pieces Copilot Tools
Explore the powerful AI tools and features in the Pieces for Visual Studio Extension.
Documenting Code
Easily generate insightful code comments with Pieces for Visual Studio Extension. Pieces Copilot understands your code’s structure and function, creating clear and useful comments to improve readability and simplify maintenance.
To add documentation and comments to your code, select the code snippet, right-click, hover over Pieces
, and click Comment Selection with Copilot
.
This opens Pieces Copilot in the Visual Studio sidebar, which starts adding documentation to the highlighted snippet. You can then select one of the Insert at Cursor
or Accept Changes
options to add the comments to your code.
You can also click Pieces > Comment
, which is an AI Quick Action that lives above accessible functions within your code.
Use this feature to maintain consistency in documentation and simplify handoffs for collaborative projects.
Generate & Update Code
With the Pieces for Visual Studio extension, you can easily change code to adapt to new requirements or insert quick fixes with two powerful Pieces Copilot commands:
-
Modify Selection with Copilot
: Edit or transform the selected code snippet to improve readability, optimize performance, or adapt it for specific needs. -
Explain Selection with Copilot
: Get a clear explanation of what the selected code does, making it easier to understand and document.
Selecting Your Pieces Copilot Runtime
Choose between different LLMs directly within Visual Studio by accessing the sidebar and selecting your preferred model by clicking the currently-utilized LLM under Active Model
.
Options include lightweight models for simple queries, advanced models for in-depth analysis, and both local and cloud-based LLMs.
This flexibility lets you customize Pieces Copilot to fit your development needs, focusing on either speed or accuracy.
Read more about what LLMs are available for use within the Pieces for Visual Studio Extension.
Pieces Copilot As a Daily Driver
The Pieces Copilot is a powerful, adaptable tool that grows with you as you use it—so use it!
Download the Pieces for Visual Studio Extension today!