The Visual Studio family leverages AI to help you stay focused on the creative tasks that get the core logic of your application built.
For Visual Studio and VS Code, IntelliCode is free and assists with writing, editing and understanding code in popular languages. With IntelliCode, models run locally, meaning that none of your code leaves your machine. This blogpost will focus on IntelliCode.
For users desiring even more AI capabilities, Copilot and Copilot for Business are also supported by Visual Studio and VS Code. Copilot’s models are cloud based.
Tips, tricks, and engineering story behind IntelliCode.
Whether you’re a newer developer or experienced, consider this blogpost your jumping off point to get the most from IntelliCode. The team is excited to share tips, tricks and engineering stories that we’ll link to below – content to come soon!
Writing code
- IntelliSense list: Instead of exploring an unsorted list of methods and members, IntelliCode uses AI to place what we believe is most relevant to your code context at the top and places a ⭐ symbol next to item.
- Gray text: To help increase productivity and reduce errors, IntelliCode can suggest up to a whole line of code in grey text. Your code context and code style are used to help generate these suggestions.
Editing code
- Repeated edits: Making several similar but slightly different edits? IntelliCode can detect the pattern and apply the change to other locations – saving you keystrokes and navigation.
- Intent Detection: IntelliCode has learned to assist with common edit patterns such as creating a constructor after creating parameters, or even with editing code that’s just been pasted.
Navigating code
- API Usage Example: Making a round trip to the browser and fiddling with search to figure out how to use an API is a common workflow. This feature can save you from that by presenting examples of how an API is commonly used.
Navigating Packages
- Most Common NuGet Packages: This feature helps you find and use the most used NuGet packages, streamlining the process of finding and adding packages to your projects.
Reviewing code
- The Visual Studio family is excited to explore AI-assistance for workflows that start with preparing a pull request and end with a successful merge.
The IntelliCode team is not only excited to help improve your productivity, but also to learn about your scenarios that could be improved with AI.
For me, this sort of assistance has now reached the point where it's just trying too hard and I now spend more time undoing what it does, than I would have spent had it not inserted anything at all.
I'm getting increasing frustrated lately just making corrections to some of the auto-suggest things that the editor is adding as I'm typing; for example, if I'm entering a ")" and the editor can't figure out where the matching "(" is, it'll insert it where my cursor is (the "(" it couldn't find, that is, not the ")" I just typed), shuffle some...
That sounds really frustrating. There should be a purple lightbulb in the bottom left of your editor window that should make it easily to temporarily disable the feature. There’s also an option to wait for pauses in typing before showing a completion that should help you with the bouncing suggestions as you type.
1. In a .NET 7 Blazor project, the AI is prioritizing deprecated features with stars pretty consistently.
2. In a .NET 7 Blazor project, the AI needs a higher repetition penalty because it's suggesting the previously typed line of code more often than not, particularly in the builder.Services.Add section of program.cs (this happens with Generic Host applications as well)
3. When adding Entity Framework, it will never suggest data annotations.
4. When defining POCO's, it will suggest the same handful of properties - which are often irrelevant to the specific class being defined, but common in Microsoft demonstration code.
5....
Hi Dave,
I'm hearing a couple things:
1) That we should improve our performance for .NET 7 Blazor / EntityFramework; hang tight here - we're working on it.
Other than .NET7 Blazor / EntityFramework (web app work) is there any other type of code that you write?
Curious what kinds of scenarios we're doing poorly in (we know niche codebases to be more problematic).
2) That you're running into repetition - we've done a fair bit of work here... but helpful to hear that it's still occurring to you in the real world for ya :( You're always welcome to tweet me or...
Despite the negativity surrounding IntelliCode, I think it does more help than harm. Sometimes I'll get a brain fart and the AI suggestion will help jog my memory. Often it has saved me a huge amount of time - main examples are when I've written properties and then it suggests a fully-formed constructor. Another example is changing references from one property/variable to another - navigate to the variable, change it once, and then every time you go to the next change it will automatically suggest it. Once in a while it comes up with a solution that was even more...
Zak,
Thanks for taking the time to leave a comment, glad we’re of help.
Two trains of thought here:
1) RE: navigating to the next variable & changing it, we’re working on a new experience that makes it easier to navigate to next location & apply (i.e. tab to go to next location, tab to apply, etc.)
2) RE: goofy suggestions, feel free to tweet the bad (and the good) to me @aaronyim. Love hearing how we can better help.
Hi Peter,
I appreciate the work MS is continuing to do to enhance the Intellisense and developer experience in Visual Studio. However, I am at the point where I think MS' experiment with using AI in VS may require rethinking. To date, I have not had any positive experiences with Intellicode versus using JetBrains' famous extension.
I will have to echo the feedback provided by Chuck Ryan, Henry B and Andreas S. Franci Gonçalves. And to add to their lists of problems I have with Intellicode, it also causes a lot of intermittent errors in Visual Studio. I tried to be...
Hey Stevie, thanks for taking the time to leave a comment.
I hear you! Although we do careful user research studies/sensemaking, it’s a fine line between being useful and being disruptive. We’re excited about improvements to stability and being in the user's flow in version 17.5 of VS (more refinement to come in version 17.6 - available for Public Preview here).
Thanks for your patience while we pioneer new ways of using an IDE… and feel free to tweet me @aaronyim or email us at aayim at microsoft dot com with more detail/examples… love hearing about where we can do better.
Appreciate...