How to disable new AI-based IntelliCode in VS 2022?

18k Views Asked by At

On the surface the new AI-based IntelliCode for Visual Studio 2022 seems cool. So when I installed VS2022 and it asked if I wanted to allow training models on my code, I said sure because I wanted to see how it improved the developer experience.

But now that I've been coding with VS2022 for a week, I find that working with my 300K lines codebase constantly feels slow in the editor compared to VS2019. And I've even seen weird stuff where I'm sure I keyed one thing but the code got butchered to something totally different, sometimes several lines of code above where I was working. Somehow the VS2022 editor and I are not in sync. Also, while using the editor I've been hearing the fan on my machine kick in at high speeds indicating my machine is working very hard. I don't ever remember this being the case in VS2019. So my first thought to fix all this is to get back to more of a VS 2019 IntelliCode experience in VS2022.

So I went into Tools > Options > IntelliCode > General to turn of the new capabilities. I'd still like to have IntelliCode like it worked in VS2019 but I'd like to turn off the new AI powered models that are (theoretically) slowing down my editor experience. When looking at the settings, it's not clear which ones to change. Worse, it's not even clear when ones are enabled or disabled. They all show Default.

enter image description here

Taking a look at the Microsoft Docs doesn't help much either. It doesn't provide any info about which of these Default options are enabled by default or disabled by default.

I can guess that I probably want to disable Automatic model training and maybe C# deep-learning base model for completions. But should I be disabling others? And if I do turn off C# deep-learning base model for completions will I be disabling functionality I want that was in VS2019? I fired up VS2019 to check it's IntelliCode options and alas all the setting there are set to Default as well. So I neither know what was enabled before or what is enabled now. I only know my editor experience isn't making me happy.

Can anyone shed some light on how to configure these settings so that I have the kind of intelliCode experience I enjoyed in VS2019 without all the overhead of the additional AI IntelliCode features added in VS2022?

4

There are 4 best solutions below

4
RonC On

The solution I present below no longer works as of Version 17.5 of VS2022, May 2023.
Thank you @ceramic-pot for pointing this out. I have confirmed that the options have changed. I will leave the original answer below as it will likely be of use to people using an earlier version of VS2022.

Original Answer:

So this is what worked for me. I went to Tools > Options > IntelliCode > General and selected `Disabled' for the following:

  1. "Apply completions for whole lines on right arrow"
  2. "Show completions for whole lines of code"
  3. "C# team models for completions"
  4. "Automatic model training," and
  5. "C# deep-learning bas model for completions"

The above are the new IntelliCode setting as best I can tell from comparing the settings to VS 2019. Once these were Disabled, the performance of my machine while in the VS2022 editor returned to normal. My editor experience now feels similar to what I had is VS2019. I'm back to being a happy camper.

enter image description here

3
RMcfarlane On

I see a purple bulb spanner Icon at the bottom of the editor in version 17.6.2

enter image description here

You have a few options to turn it off I believe

enter image description here

0
Impeccable Explanation On

I made an account just to say that I may have found a way to do it even past 17.5 when the options disappeared:

  1. Go to Tools > Options > Intellicode and turn everything off.
  2. Close Visual Studio.
  3. Go to your .vssettings file (%APPDATA%/Local/Microsoft/VisualStudio/17.[version]/Settings/CurrentSettings.vssettings)
  4. You will see an XML file with many settings. Find IntelliSense-related options (EnableTemplateIntelliSense, EnableSingleFileISense, DisableSharedIntelliSense, DisableIntelliSenseUpdating and DisableIntelliSense) and turn them on or off, depending on context. If it doesn't work, try disabling more IntelliSense/IntelliTrace options (I also lowered IntelliSenseProcessMemoryLimit, just in case).

Proof when it works:

  1. The "Loading IntelliSense" background task (bubble button in bottom left corner) loads faster. Before, it was one of the last tasks to load, now it's one of the first.
  2. IntelliCode button (purple lightbulb next to the zoom button in bottom left corner) shows only 1 option instead of 3.
  3. It runs faster. I have C# files with 1000+ lines of code that made VS freeze every 5 seconds, now they run smoothly.

Please don't report it to Microsoft so they don't remove it.

0
Alberto On

Click on the small icon with a wrench and a light bulb at the bottom left of the window and deselect "Show completions for lines of code."

enter image description here