News
Content Exclusion Is Latest of Many New Visual Studio Copilot Features
With AI forever changing software development, software developers are using AI to develop software that uses AI to help other developers develop software ... and on and on.
GitHub Copilot started it all, and it's still going strong in Visual Studio 2022, which just shipped in v17.11.
For that edition, Microsoft explained how Copilot has quickly become an indispensable tool for many developers, now offering:
- AI-Generated Breakpoint Expressions: Automatically suggest breakpoints based on your code, helping you debug more efficiently.
- Understand Your Symbols: Improved symbol recognition to ensure you get the most accurate suggestions.
- Refined Suggestions: More precise and context-aware code completions, reducing the need for manual edits.
- GitHub Copilot is even more secure: GitHub Copilot Business customers to prevent specified files or repositories from being used to inform code completion suggestions made by GitHub Copilot.
The flagship IDE's dev team has clearly been focusing on AI, judging from the company's raft of related DevBlogs. The latest enhancement is detailed in last Thursday's post, "Copilot Content Exclusion Now Available in Visual Studio 2022 17.11."
Now, the ability for admins to configure Copilot to ignore specific files in repositories or organizations is available to GitHub Copilot for Business and Enterprise customers, working with repositories hosted on platforms like GitHub and Azure DevOps. Organization administrators or repository owners have control over which files or paths are excluded. While designed to enhance the Copilot experience, users are advised to "Please note that certain GitHub Copilot features in Visual Studio may be fully disabled if any file is excluded."
The dev team's focus on Copilot resulted in these recently published articles that mostly cover the previous version of Visual Studio:
- Demystify history with GitHub Copilot commit explanations: These generate concise summaries of code changes to enhance the readability of commit histories. The Commit Details window now provides side-by-side summaries alongside the actual code changes, making it easier for developers to understand and navigate their codebase.
[Click on image for larger view.] Unraveling Commit History (source: Microsoft).
- Let GitHub Copilot draft your pull request description: Visual Studio v17.10 introduced the ability to generate pull request descriptions in order to streamline collaboration and save time for developers. Copilot examines code changes and generates markdown summaries that developers can edit and customize, reportedly saving time and improving collaboration.
-
Visual Studio 2022 17.10 and GitHub Copilot: Your Coding Partner for Faster and Smarter Development: Published during Microsoft's //BUILD 2024 developer conference, this explained the IDE's significantly improved integration with Copilot that enhances productivity with smart code suggestions, debugging tools, and streamlined workflows. Developers can now use GitHub Copilot for tasks like scaffolding tests, summarizing commits, and providing intelligent code completions. The update also introduces new debugging features, including an AI-powered Exception Helper and deadlock detection.
Highlights of key features of the new integration are summarized in this list:
- Combined capabilities: GitHub Copilot's code completion and chat functions are merged into a single extension for easier use.
- Improved code suggestions: The AI model provides more accurate and relevant code completions based on the context of the code.
- Enhanced code understanding: Developers can ask GitHub Copilot to explain code, fix errors, or suggest improvements through a chat interface.
- Faster debugging: The AI assistant helps with troubleshooting by analyzing exceptions and suggesting solutions.
- Automated tasks: GitHub Copilot can generate unit tests and create informative pull request descriptions.
- Improve your code quality with GitHub Copilot in Visual Studio: This discusses the
/optimize
command, which allows developers to improve code quality by refactoring code snippets using simple text-based inputs. For example, devs can convert traditional for
loops into more readable foreach
loops. However, it's essential to validate Copilot's output to ensure no errors or regressions are introduced, with unit tests serving as a safety net.
-
Mastering Slash Commands with GitHub Copilot in Visual Studio: The
/opmitize
command is an example of slash commands, which are predefined actions within Copilot, accessible through the prompt interface. Along with /optimize
, key commands include:
- doc: Insert a documentation comment in the current cursor position.
- exp: Start a new conversation thread with a fresh context.
- explain: Provide an explanation for the selected code.
- fix: Suggest fixes for code errors and typos.
- generate: Generate new code snippets based on your input.
- tests: Create a unit test for the current code selection.
- help: Access help and support for Copilot.
-
Using GitHub Copilot as your Coding GPS: Part of a series of posts that delve into Copilot in Visual Studio to showcase how it aids coding, this post includes a video featuring Bruno Capuano titled "Harnessing GitHub Copilot as your Coding GPS" in which "Bruno says GitHub Copilot improves your coding in Visual Studio, not replaces developers. Microsoft agrees, saying AI should help humans, not replace them. CEO Satya Nadella says AI should boost productivity without replacing people." The post discusses using large language models (LLMs) for a new way of interaction with computers, using probabilities and lots of data to generate responses from natural-language prompts, making coding feel like a conversation.
"As AI becomes more common in industries, developers should adapt," Microsoft said. "Tools like GitHub Copilot can help by making coding more efficient and adaptable. To keep up, it's important to learn about AI tools, their strengths, and their limits."
Stay tuned to DevBlogs for more on Copilot in Visual Studio 2022.
About the Author
David Ramel is an editor and writer for Converge360.