Microsoft has been adding several new diagnostics features to Copilot in Visual Studio for .NET to make the debugging process easier.

“The same tools you rely on are now able to keep up with you, identify issues more quickly, offer context-smart fixes, and help you move from asking ‘why is this broken?’ to ‘oh, I see and here’s the fix’ in a fraction of the time,” Harshada Hole, senior product manager for Visual Studio Debugging, Profiling, and Diagnostics, wrote in a blog post.

Copilot can now suggest appropriate locations for breakpoints and tracepoints based on current context. Similarly, it can troubleshoot non-binding breakpoints and walk developers through the potential cause, such as mismatched symbols or incorrect build configurations.

Another new feature is the ability to generate LINQ queries on massive collections in the IEnumerable Visualizer, which renders data into a sortable, filterable tabular view. For example, a developer could ask for a LINQ query that will surface problematic rows causing a filter issue. Additionally, developers can hover over any LINQ statement and get an explanation from Copilot on what it’s doing, evaluate it in context, and highlight potential inefficiencies.

Copilot can also now help developers deal with exceptions by summarizing the error, identifying potential causes, and offering targeted code fix suggestions.

Additionally, to help developers resolve performance issues, Microsoft introduced Auto Insights, which shows where the application is using the most CPU and offers suggestions on how to fix those bottlenecks. A similar feature is available in the Instrumentation tool and .NET Allocation tool to identify zero-length array allocations.

Other new Copilot-powered debugging features include the ability to hover over a variable in DataTips, Autos, or Locals to get potential causes of unexpected results; return value analysis; and generation of thread summaries for each stack when working in Parallel Stacks.

“This isn’t about replacing your debugging skills, it’s about cutting out the repetitive, tedious work so you can focus on what really matters: solving problems and shipping features. Copilot surfaces the right information in context, exactly when you need it. Think of it as having a knowledgeable pair programmer inside your Visual Studio that helps you move faster, understand code more clearly, and catch issues before they slow you down,” Hole wrote.