From Eclipse’s Clutches to VS Code’s Grasp: Embracing GitHub Copilot Chat!” 🚀

Tyson Lawrie
4 min readOct 16, 2023

Picture this: I’ve been using GitHub Copilot and Copilot Chat for all my React/Remix projects, and it’s been a game-changer. But there was a hiccup in my coding journey — my trusty Eclipse IDE didn’t quite play well with my newfound coding pal. The time has come to embrace VSCode for Java development. So, come along with me on this adventure as we explore the ins and outs of this transition.

Before we dive in, let me make one thing clear: I’m not trying to replicate what I did in Eclipse. My goal is to mimick the familiarity in the Eclipse setup and retrain some of those muscle memory actions. Let’s get started.

The Prep

First things first, getting VS Code up to speed for Java development. This means installing two extension packs:
1. Java Extension pack
2. Sprint Boot Extension pack

Profiles. Profiles. Profiles.

To run with a specific profile in the Spring Boot dashboard, you can easily right click ‘Run With Profile’. For those of us dealing with multiple Spring profiles that can be a bit of a chore.

Solution: add the profile to the launch args or vmArgs in .vscode/launch.json

VSCode launch config

Linting

You know how we all have our favorite code styles? I’ve been using Google styles in Eclipse and have no intention of changing. In VS Code, you can stick with what you know and love by adding your preferred code styles.

Solution: Add the styles in .vscode/settings.json.

GitHub Copilot Chat

The moment we’ve all been waiting for — the introduction of GitHub Copilot Chat.

I open the Chat app and receive a descriptive welcome messageand then click ‘Generate Unit Tests for my Code’.

GitHub Copilot Chat Welcome Message
GitHub Copilot Chat Generated Test Class

Personally, I love solving problems and tend to skip over testing. Copilot, on the other hand, is the perfect partner in crime. It takes care of the boilerplate test code and the “where to start” question — I end up with an excellent starting point.

Note: all the test data and samples provided by Copilot weren’t fantastic, a little bit of data clean up is necessary. I wonder if there is a way to annotate the Models so that it knows what data to use in the future.

Points for Creativity

When I saved the generated tests as a Java test class, I noticed Copilot gets creative — the new TaskRun(…) constructor and also the taskRunRepository.findByCreationDateBetweenAndLabelsContainingIgnoreCaseAndStatusContainingIgnoreCaseAndPhaseContainingIgnoreCase() were made up and don’t exist in my code.

I need to dig deeper and determine why this happened. Unless anyone can let me know?

Improvements

I then asked Copilot to help me fix any bugs, and it suggested a bunch of fixes to the test it had just generated. It’s like having your very own code critique partner. However, it could’ve used some of these suggestions during the initial generation.

GitHub Copilot Chat response
GitHub Copilot Code

Running the service

When starting the service, i encountered compilation errors (from those new tests) that stopped the service from starting. You have to select ‘Run Always’ and the service will go ahead and start.

This is different to the default in Eclipse, where I believe it starts and switches to the terminal every time.

Refactoring

I frequently find myself renaming files and generating getters and setters, so its fantastic to see all this readily available in VSCode, check out this link. If only I could generate them with a single hot key.

Will I embrace VS Code?

The ultimate verdict on embracing VS Code is still a work in progress, but so far, I’m excited about the possibilities.

For more detailed information and helpful resources on Java development with VS Code, check out this link.

Show your support

Thanks for reading! If you made it this far, show your support if this helped you:
- 💬 Follow me on Twitter
- 🙏 Join the Boomerang open-source project and help contribute

--

--

Tyson Lawrie

A software engineer and automation enthusiast, made in Australia, Ex New Yorker. Building flowabl.io and userprofiles.io. Maintaining useboomerang.io