Coding with JetBrains AI as a partner

I've spent some more time developing eVitabu, and thought I'd give JetBrains AI a try.

A man wearing a denim jacket & white shirt sat typing at a computer.Next to him in a translucent pale blue android hologram.
The human doesn't look a lot like me, and the hologram looks menacing. I've no idea why I can see the code on the back of the monitor either...

During my recent eVitabu dev week I purchased a month's subscription to JetBrains AI. This plugin uses cloud hosted "AI" large language models to help you with your code, either using your code for context as part of the prompt, or by using prompts via chat. I used the tool a lot over the week, and have used it a few times since, and figured now was a good time to share my experience.

Protecting your code

Before using an "AI" tool to help with development, it's worth checking the terms and conditions. In particular, make sure that your source code isn't going to be used to train the "AI" model, as you can leak proprietary code that way.

Also ensure that you're permitted to use the code the "AI" generates. In all the offerings I've reviewed, at the time I reviewed them, you were licenced to use the generated code in your products without additional payment. The terms did advise that you should make your own checks to ensure you weren't using copyrighted code that had been inadvertently returned by the model though.

In all cases, make sure you check the terms and conditions before signing up to use it, and if you're working for a company check your company policies permit "AI" tool use.

💡
Note that as of mid April 2025 (the release of PhpStorm 2025.1), JetBrains are making JetBrains AI available with a free-tier. Ensure you check the terms and conditions if you plan to use this.

Adding to the IDE

JetBrains AI is supported in a number of JetBrains IDEs [1], and importantly for me that meant I could use it in PhpStorm and Android Studio. After purchasing the subscription, I ensured I had the JetBrains AI Assistant plugin installed. After a restart, this plugin automatically detected I'd purchased a subscription and enabled my use of the tool.

Screenshot of the plugins screen.  At the top is a pink circle with a smaller grey circle inside it.  Inside the grey circle is a pink triangle.  This is the logo for the "Full Line Code Completion" plugin by JetBrains.  At the bottom there's a logo consisting of a purple swirl titled "JetBrains AI Assistant", which has a "purchased" label next to it.
Screenshot of the installed plugins.

In Android Studio I had to install the Full Line Code Completion plugin (this was already present in my PhpStorm setup). Back in March, that meant I had to downgrade Android Studio, as the plugin wasn't supported on the latest version. Hopefully that's fixed now.

Initial testing

To check the "AI" was working correctly, I asked it what framework was being used in one of my PHP projects - it gave me the correct answer. In my Android project, I asked the "AI" to tell me the program flow for a particular class, and it seemed to get the right too. I took this as a good sign.

Diving into the code

A combination of the full line code completion plugin and the "AI" I'm sure, but at PhpStorm started suggesting code that I wanted to write fairly early on. I'd noticed this previously, before I added JetBrains AI, where PhpStorm would detect a pattern in what I was writing (e.g. defining an array) and offer to write the next lines. I'm pretty certain the complexity of the suggestions increased once the JetBrains AI plugin was enabled and licenced, but perhaps I imagined that.

One of the first things I needed to do for push notifications was to add some columns to the announcement database table. In Yii2, this is a case of creating a migration (a set of instructions to perform) that you run as part of upgrading your application. I created a migration called alter_announcement_add_countryid_sendpush, and on going to manually type the instructions the "AI" immediately made an almost completely accurate suggestion. In the screenshot below I'd typed $this and the "AI" suggested the correct addColumn method, table, column name I would have chosen, and data type. As I commented to Adam, the only thing wrong was there isn't a column called country to put the county_id column after.

Screenshot showing some code.  There is slightly paler text which shows the code suggested by the "AI".
It's not too easy to tell with my colour scheme, but the slightly paler text is the "AI" provided suggestion.

After I'd added the relevant columns, I needed to include a library [2] that allowed me to talk to the Firebase Cloud Messaging APIs. Having done some research on this already I had some knowledge of what I needed to do, so I was pleased to see the "AI" provided instructions that matched my expectations. I followed its instructions to add the Firebase PHP SDK library to my project.

Getting advice

Once the library was included, I needed to know how to use it. JetBrains AI had provided examples in response to my earlier query, so I was able to use those. The "AI" was also useful when I encountered a problem - I threw the error message or a description of the issue at the "AI" and it gave me suggestions to follow in order to fix the issue.

Usually I'd have asked Adam, but he has his own job to do. While I'd still rather speak to a friend of mine and discuss the problems, the "AI" was useful for getting real-time advice without feeling guilty that I was disturbing someone else.

The AI is not always right

If you've done any work with large language models (LLM) and "AI", you'll know they're not always correct. These errors can range from simple incorrect assumptions (like in my migration example above) to full hallucinations where the "AI" makes something up [3].

I didn't receive any "AI" hallucinations while working, but it did give some incorrect information at times. Amusingly, it was while trying to use one of its examples that I asked it to review its own incorrect code. The tool happily told me what change I needed to make, but didn't notice it had made the mistake initially.

Model selection

During my dev week in March 2025, by default, JetBrains AI used the GPT-4o model from OpenAI and that seemed to work very well. After up-dating to PhpStorm 2025.1 , I noticed the default model had changed to Claude 3.5 Sonnet. Changing the model you're using is simply a case of selecting your desired option from a drop-down menu in the chat window.

Screenshot of the "AI chat" window.  A menu titled "model" is open, and includes options such as "Claude 3.5 Sonnet", "GPT-4o", "o1", "o1-mini", "Gemini 1.5 Pro".

I've not tried the other models yet, but I'll give Claude 3.5 Sonnet a go in my next development session - I've heard good things about it.

Chat history

JetBrains AI seemed to preserve my chat history during the dev week, but checking today I can see that history is no longer present. I've not tested to see how long history is preserved for, but bear this in mind if you think you'll want to go back to a conversation later - make your own notes!

Usage for education

Not my intended use case, but this happened anyway. My daughter was working on some Python as part of her homework, and needed a hand. Python isn't a language I know, although I did write some for work back in 2018 and wrote some for a temperature sensor in 2020. I find I can largely read and understand Python, but writing it from scratch isn't something I'd be confident to do.

I took the assignment and asked JetBrains AI to give me some example solutions and explanations so I knew how to help. It was useful having the "AI" available to essentially teach me, so I could teach my daughter. Once I'd got the Python examples I could explain functions to her (what her teacher was calling "sub-programs"), and I think she learned something through the encounter too.

Conclusion

Having had the "AI's" help and found it useful, I certainly plan to use it more often. I'm confident that using JetBrains AI saved me time, and sped up my development activities, so there's a discernable benefit to me. What I cannot do is provide a percentage (for example "developers see 33% time savings") to quantify that.

There's still definitely a need for a human in the process though. The code provided to me by JetBrains AI wasn't always correct, and wouldn't have worked in all my use cases. Obviously there are other tools out there (GitHub Copilot, Amazon Q, etc.) so you may have different results with them.

I need to review the terms for JetBrains AI's free tier, in case that's changed from the terms I read in March. If the free tier works successfully and sufficiently then I won't need that monthly cost.


Banner image: Cropped & flipped image generated by Microsoft Copilot from the prompt "Please draw me an image of a developer working alongside an AI.".

[1] Integrated Development Environments

[2] A library is re-usable code, written either by you or someone else, that you utilise in your project. This saves time as you don't have to "re-invent the wheel", but also introduces some risk - the other person's code may have vulnerabilities that you're unaware of.

[3] I wrote about how Google Bard, now Google Gemini, hallucinated an entire Rapid7 module, and also provided a broken script, in a previous blog post.