Helidon Extension for Visual Studio Code

Andrey Serkes
Helidon
Published in
5 min readJun 8, 2021

The Helidon development team has decided to contribute to and support Java technologies in Visual Studio Code by creating an extension for Helidon. This extension will help users generate, develop and run a Helidon project.

Visual Studio Code (VS Code) is a free IDE made by Microsoft. Its popular among front-end developers due to its flexibility, ease of customization and free use, but it also has great support for web development. This IDE is very extensible and support for additional languages and features can be provided by freely-available extensions on the VS Code Marketplace or you can write your own extension.

VS Code already has a set of very useful and popular extensions for Java, including support for Java language, debugger, maven and gradle support, and other technologies that are needed during the development.

Now we’ll look at the Helidon VS Code extension, explain what it can do and show how it works. Note that this is the first version of the extension and we will be adding new features in the future.

Where can I find the new extension?

The Helidon VS Code extension is available from our official GitHub repository. You will need to download the vscode-helidon.vsix file and install it in VS Code.

Prerequisites

This extension requires some preconditions to be met :

After all preconditions are satisfied it is time to create our first Helidon project.

Create a Helidon Project in Visual Studio Code

Many IDEs offer wizards to create a new project of one type or another. Our extension uses Maven for this and it supports all archetypes that are available for Helidon. So, to create a new project, we just have to go through a few simple steps :

1. Open Command Palette by shortcut you are using (default: Ctrl+Shift+P) or choose in menu View > Command Palette…

You will see an interactive window where you can type your commands.

2. Start typing Helidon :

3. Choose Helidon: Generate a Helidon project. After this step we start wizard that collect all required data to generate Helidon project.

4. Choose which type of Helidon project you want to create from the list of available projects:

5. Follow the generator until the end and provide all the necessary information that will help the extension create a maven project for you (group Id, project artifact Id, root project package name for your project, and so on).

6. You will receive messages during the process, and a request asking where you want to open the project:

After these steps your new project is generated and Visual Studio Code will open it for you.

You receive a template of the project that contains all that you need to run the project even without writing any code.

You can add new classes, write tests, add dependencies that you need and implement all the ideas that you have.

During the development cycle you may need to check some details on a running application. Helidon has great feature for this called Helidon CLI. It performs continuous compilation and application restart, so you can easily iterate over source code changes.

Start Helidon CLI in VS Code

1) Open Command Palette (Ctrl+Shift+P or throug the menu)

2) Start typing Helidon

3) Choose Helidon: Start Helidon dev

4) If workspace contains only one Helidon project, Helidon CLI starts automatically. If workspace contains more than one helidon project, you will be asked to choose a directory that contains the project for which you want to start Helidon CLI :

5) If you need to run another Helidon application, you have to go through steps 1–4 again for the other project. There are no limits on how many Helidon applications can be run.

You will find the server logs in the bottom panel in the Output tab. You can select a server to show the logs by selecting the project directory in the drop-down list.

Stop Helidon CLI in VSCode

If you want to stop the running application, you have to go through similar steps:

1. Open Command Palette

2. Start typing Helidon

3. Choose Helidon: Stop Helidon dev

4. If workspace contains only one running Helidon application, Helidon CLI stops automatically. If workspace contains more than one running Helidon project, you will be asked to choose a directory to stop Helidon application.

Conclusion

At the moment this is all the functionality that our extension has, but as I mentioned before, it is developing and new features will be available soon.

The project is open for changes, so if you want to collaborate you can make you pull requests on the page https://github.com/oracle/helidon-build-tools/pulls”>helidon-build-tools.

The sources of the project can be found in the official Helidon repository in the module ide-support. You can find all the information on how to build and test the extension in our documentation.

If you have any suggestions on how to improve the extension, or if you need help using it, let us know on our Slack channel or report an issue on our issue tracker .

--

--