Main image of article Exploring Modern AI-Equipped IDEs

With AI continuing to reach into many parts of our lives, it was inevitable that it would do the same with software development. At first, it was just a matter of copying and pasting AI-generated code from a browser session. But now, AI has become an integral part of our tools and is included in IDEs.

The typical IDE provides tools to navigate through code, refactor by renaming variables, functions, or classes in one or more files, as well as compile and debug code (for compiled languages) or run interpreters for others. These aren’t AI features, so what does AI offer?

Code completion was one of the first AI features. In Visual Studio on Windows, it seemed like a mind reader. I typed in Class Dog { and it suggested Name and Age properties and a method called Bark().

When reading a record from a database into an object, after typing the first line in the while loop, every subsequent line (shown in bold) was suggested by the AI code completion—including the field name, the getter type, and incrementing the index. Seeing this happen for the first time felt like magic:

string dataQuery = "SELECT iddog, daynumber, idpart, idclass, drawpos FROM dogspartclass WHERE iddog =" + index.ToString();

SqlDataReader r = db.GetData(dataQuery);

while (r.Read())
{
    int entrydog = r.GetInt32(0);
    int entryday = r.GetInt32(1);
    int entrypart = r.GetInt32(2);
    int entryclass = r.GetInt32(3);
    int entrydraw = r.GetInt32(4);
    int entrydpref = r.GetInt32(5);
    count++;
}

Code generation goes far beyond completion. Since I started using AI, it has definitely made me a bit lazy. Why spend two or three hours writing a function when a well-written prompt can generate it in a minute or two? Sure, you still have to test it, and I like to step through every line in a debugger at least once. It's especially useful when you’re tired, it's near the end of the day, and a tricky bit of code just won't work. Normally, I’d leave it until the next morning with a fresh mind, but now I don’t need to.

No surprise, then, that in the 2024 Stack Overflow Developer Survey of 60,000 developers, over 76% plan to use AI tools while developing.

The current crop of AI editors can go further. In Cursor, for example, you can select some code, press Ctrl+K to pop up a prompt, click Quick Edit, and create entirely new code after describing what you'd like it to do or modify.

In Figure 1, I asked it to fix the formatting code. This was part of a calculator Cursor generated. It had a bug where it formatted 150.0000 as 15. I selected the faulty code (highlighted in red), typed in this prompt, and clicked Quick Edit:

This code is incorrect. It formats 150 as 15. Please fix.

It suggested the corrected code in gray. After clicking Accept, it replaced the faulty code.

Cursor also claims its AI understands your code and can answer questions. I tested this by explaining that the 10^x button wasn’t working correctly. It went through an extraordinary set of tests, including the pow() function. Out of curiosity, I exported the dialog text at the end—it was over 800 lines long, almost 4,000 words!

Writing unit tests can be tedious, especially for older code bases. Here, AI excels. While new code should include unit tests as it’s written, older projects often lack them. On a codebase of nearly two million lines, I’ve already added 11,000 lines of unit tests, with more to come.

Developers often commit code to version control systems like Git, along with a helpful commit message. The quality of these messages varies, so having AI write them is a useful feature.

Some IDEs like Visual Studio and Visual Studio Code offer AI-powered extensions such as Microsoft IntelliCode and GitHub Copilot. Copilot also works with Xcode on Mac and JetBrains IDEs, the latter now featuring an AI Assistant (just click the spiral symbol). There's also Tabnine, the only option that works in air-gapped or offline environments, useful when data privacy is essential.

Then there are dedicated AI IDEs, including Cursor and Windsurf (formerly Codeium), which was recently acquired by Google. Both are based on forks of VS Code.

Other AI editors include Trae (also built on VS Code) and the open-source Zed, which is not.

Microsoft must be proud of VS Code, which underpins many AI editors except Zed and JetBrains. This space is very active, and I expect more players will enter before the field inevitably narrows. AI tools are expensive to run, so consolidation seems likely. Meanwhile, we programmers have never had it so good!