Within this tutorial, you will learn which is the current, reigning, defending ChatGPT marketplace extension for Visual Studio 2022. ChatGPT is definitely the talk of the town, being able to ask AI questions and get a response written in understandable English is genius.

Currently, there are three ChatGPT extensions for Visual Studio, AskChatGPT, VisualChatGPTStudio, and ChatGPT. All three of these extensions offer to give you some level of AI capability within Visual Studio. Having an AI tool that can help you write code more quickly could potentially help to boost your productivity, however, today we want to test this theory out. By the end of this article, you will know if any of these extensions will actually help improve your coding capabilities. Stick around to the end to find out which extension is the best 🔥🔥🔥

Before we get to the good stuff, let us start with the prerequisites. In order to use any of these extensions, you will need an OpenAI account and you will need a valid API key. To get these things, head over to the OpenAI website at https://platform.openai.com/account/api-keys.

AskChatGPT

Out of this list, AskChatGPT has been downloaded the least amount of times. Weighing in with just over 900 downloads at the time of recording. AskChatGPT will provide you with a simple panel that will allow you can ask ChatGPT to refactor your code. While it works in the background, you can get on with your coding. Sadly, I would say that the extension seems to fail a lot. I found that about 1 in 3 requests ended in an error rather than a recommendation 😞

AskChatGPT

⬇️⬇️⬇️ You can learn more about the extension here

Visual ChatGPT Studio

Downloaded over 12 thousand times, this is the most popular and feature-rich extension out of the three. After you install Visual ChatGPT Studio, you will get access to some context menu goodness:

Visual ChatGPT Studio

The extension will give you the ability to run all these commands on your code:

  • Complete
  • Add Tests
  • Find bugs
  • Optimize
  • Explain
  • Add Comments
  • Add summary
  • Ask anything

I found that having the ability to be able to highlight any bit of code that I wanted to send to ChatGPt and then being able to define the corresponding action all from the context menu a lot easier than needing to worry about messing around with a side panel. Oddly even though this extension uses the same authentication process, this extension does not timeout half as often as the other options.

Based on the response, the create unit tests and then creating a summary definitely stand out as useful tools I would use daily.

⬇️⬇️⬇️ You can learn more about the extension here.

ChatGPT

Downloaded over 5 thousand times, this extension gives you the ability to query the ChatGPT server and then the extension will automatically update your code.

To set the OpenAPI key for the extension go to Tools -> Options -> Chat GPT - Iguana ->Open AI APIKEY. After doing this you need to enable the toolbox window which you can do fromExtensions->Chat GPT-Iguana`.

The biggest issue with using this extension is the editor-blocking aspect. When you ask ChatGTP a query, your whole VS gets locked until it responds. Sometimes the extension might take over a minute to get any response. This limitation means you can't simply fire a request and get on with work. Just like AskChatGPT, roughly 1 in every 3 requests timed out and didn't return the expected refactorings. This meant that my productivity dropped a lot while using this extension. When you combine this with the rendering blocking aspect, it made this extension unusable for me.

On top of these blocking issues, I was not too impressed with this extension's UI. In the dialogue, you can have the option of setting the OpenAPI code to completion or editing. You can also set the command scope can be either file, selection, or cursor. Finally, you can define some keywords to ensure the recommendations are made within the language that you are currently working within. having to toggle between these options rather than being able to select stuff from the context menu is definitely a faff.

⬇️⬇️⬇️ You can learn more about the extension here

Conclusion

You might be asking which one is the winner, for me personally the only extension that I am going to leave installed on my machine is Visual ChatGPT Studio. As ChatGPT blocked my editor when using it, this immediately ruled it out for me. AskChatGPT worked OK, it's just Visual ChatGPT Studio offered all the same features and more. As these tools are free, then there is no harm in trying them out for you.

Happy Coding 🤘