News

GitHub Copilot Makes Nice with Visual Studio IntelliSense

After a years-long problematic relationship, AI-powered coding assistant tools from Microsoft and GitHub are working together better.

Specifically, Microsoft this month announced "Visual Studio's IntelliSense list can now steer GitHub Copilot code completions."

"GitHub Copilot and Visual Studio's built-in AI assistance features are now better together," Microsoft said. "With the latest version of GitHub Copilot, changing your selection in Visual Studio's IntelliSense list steers the GitHub Copilot with additional context about your code, so you can easily explore the single and multi-line code completions to get just the code you need."

[Click on image for larger view.] Choosing a Different IntelliSense Option (left) Changes Copilot Suggestions (right) (source: Microsoft).

Getting just the code you need proved to be difficult if not impossible for joint users of Visual Studio 2022's built-in IntelliSense and the external Copilot "AI pair programmer" extension from Microsoft-owned GitHub.

It wasn't long after GitHub Copilot debuted in June 2021 that problems between the two AI constructs were reported, as detailed in the February article, "Devs Cite Problems with GitHub Copilot and IntelliSense Working Together." The article revealed that even though the IntelliSense/Copilot interactivity problem had been known for years, it was still being reported by various developers, even in other IDEs.

[Click on image for larger view.] Just Some of the Reported Issues (source: Microsoft).

While a raft of problems of many different kinds were reported, the basic gist of many complaints was that the autocomplete functionality of the two tools clashed with one another.

GitHub provided a response about the issues to Visual Studio Magazine that in part said: "One of the great things about modern IDEs is that they are nearly infinitely extensible. Many developers have tens of extensions installed to customize their environment and make their work easier. Because each developer's dev environment contains a different combination of extensions, there's rarely any testing to see how the extensions behave when combined. That means unexpected interoperability issues can sometimes appear. To seek out feedback, we've created Community Forums to engage with developers."

Microsoft this month explained how the two tools work better together as of GitHub Copilot 1.84.

"Copilot predictions are not only visible when the IntelliSense list when the IntelliSense is open, but your IntelliSense selection also steers the prediction offered by Copilot," the company said. "This helps you explore and get just the code completion you're looking for. It's particularly helpful in combination with the starred completions that Visual Studio's build-in IntelliCode AI provides with member ranking in the IntelliSense list.

"Prior to this release, users of Copilot in Visual Studio had to choose between accepting a Copilot completion or opening the IntelliSense list, at which point the Copilot prediction would no longer show."

So developers can now press the Left CTRL key to hide the IntelliSense list or accept the prediction to understand the code with syntax highlighting/IntelliSense. Before deciding whether or not to accept a prediction, developers can preview it in two ways:

  1. Press the Left CTRL button to hide the IntelliSense menu if they want to peek at a multi-line prediction
  2. Accept the prediction to understand the proposed code with the help of syntax highlighting and tooltip that appears when hovering on a symbol

Developers, specifically those using Copilot 1.77 or earlier versions, might need to update their tool manually as automatic updates to v1.84 reportedly won't work.

A short YouTube video demonstrates how a developer typing in code brings up IntelliSense code-completion options along with Copilot suggestions. When a different IntelliSense option is selected, the corresponding Copilot suggestion list changes also, which is what Microsoft refers to as IntelliSense "steering" the Copilot suggestions.

About the Author

David Ramel is an editor and writer for Converge360.

comments powered by Disqus

Featured

Subscribe on YouTube