New features in Quarkus Tools for Visual Studio Code 1.2.0
We are proud to present the new release of Quarkus Tools for Visual Studio Code, providing a feature-rich development experience in VS Code for Quarkus application development. This release focused on introducing tooling support for Gradle projects, as well as adding new
application.properties language features.
Watch a demo of the new features:
- Gradle — Generate new Quarkus project
- Gradle — Debug Quarkus project
- Gradle — Add extensions to a Quarkus project
- Quick fix for unknown property name
- Quick fix for invalid enum value
- Quick fix for missing required properties
- Add a glob pattern for excluding unknown property validation
- Language feature support for logging level values
- Documentation for default profiles
- Improved input validation when generating a new Quarkus project
Everything you need to grow your career.
With your free Red Hat Developer program membership, unlock our library of cheat sheets and ebooks on next-generation application development.SIGN UP
So far, Quarkus Tools for Visual Studio Code was geared towards Maven Quarkus projects. This release finally brings support to Gradle Quarkus projects. Moving forward, new features will be implemented with both Maven and Gradle in mind.
Gradle — Generate new Quarkus project
The project generation wizard now provides the option to choose between creating a Maven or a Gradle project. The rest of the wizard is the same as before. After going through the wizard, your new Maven or Gradle project will download and open automatically.
To open the project generation wizard, open the VS Code command palette and call the
Quarkus: Generate a Quarkus project command.
Gradle — Debug Quarkus project
The debug command will now detect whether your currently opened Quarkus project is a Maven or Gradle project, and will start the application by running the Quarkus Dev command (
mvn quarkus:dev for Maven,
gradle quarkusDev for Gradle). Once the application is running, the debugger will attach.
To run the debug command, open the VS Code command palette and call the
Quarkus: Debug current Quarkus project command.
Gradle — Add extensions to a Quarkus project
The add extensions wizard now supports adding Quarkus extensions to Gradle projects.
To view the list of extensions to add, open the VS Code command palette and call the
Quarkus: Add extensions to current project command.
Here, the Eclipse Vert.x extension was added:
Since Eclipse Vert.x was selected, the
./gradlew addExtension --extensions="quarkus-vertx" command will run in the integrated terminal to add the extension:
In short, the project generation wizard can now generate Gradle projects, and the
Quarkus: Add extensions to current project and
Quarkus: Debug current Quarkus project commands work for both Gradle and Maven projects.
Quick fix for unknown property name
The validation support provided by Quarkus Tools for Visual Studio Code checks for unknown property keys in your
application.properties file. This release brings a new Quick fix that suggests known properties for your unknown properties. This feature is kind of like autocorrect or “spellcheck” for your property keys.
To perform the Quick fix, hover over an unknown property and click Quick Fix to see the proposed suggestions. Please note, the Quick fix suggestions only appear if your unknown property has a similar name to a known property.
Quick fix for invalid enum value
Similarly, there is also a new Quick fix that suggests valid enum values. The Quick fix will either suggest all valid enum values or, if the invalid enum value is similar to a valid enum value, only the similar enum value(s) will be suggested.
Quick fix for missing required properties
The last new Quick fix is a Quick fix that adds all missing required properties to the
application.properties file. To use this feature, the required properties validation needs to be enabled, as it is disabled by default. To do so, open VS Code settings and set the Quarkus > Tools > Validation > Required > Severity setting to either Warning or Error.
application.properties file is open, there will be a “Missing required property” warning or error message. The corresponding Quick fix will add all missing required properties to the
Add a glob pattern for excluding unknown property validation
This release also allows you to exclude certain properties from unknown property validation. To do this, go to VS Code settings and add a new glob pattern to the Quarkus > Tools > Validation > Unknown > Excluded setting.
This only excludes properties matching the glob pattern from unknown property validation. Other validation such as missing equal sign validation will continue to work.
A good use case for this feature is to ignore certain MicroProfile Config annotated properties (see quarkus-ls#135), which Quarkus Tools for Visual Studio Code does not recognize for the time being.
Language feature support for logging level values
Moving on, there is now autocompletion, documentation, validation and hover support for
java.util.logging.Level values. Autocompletion will provide all possible values alongside their documentation. Providing an incorrect logging level causes a validation error.
Documentation for default profiles
Currently, there are three default profiles for the
%test. Hovering over a default property or invoking completion after a
% sign will now provide relevant documentation:
Validating user input for a new project
Last but not least, when generating a new project in using the wizard, the input validation messages are now more helpful. There are different naming restrictions for the groupId, artifactId, package name, etc. which the validation messages now describe:
This wraps up the new features for this release. We would be ecstatic to hear any feedback and suggestions, as we take them very seriously. Thank you for reading, and stay tuned for the next release!
VS Code Marketplace: https://marketplace.visualstudio.com/items?itemName=redhat.vscode-quarkus
GitHub repository: https://github.com/redhat-developer/vscode-quarkus
Open a GitHub issue: https://github.com/redhat-developer/vscode-quarkus/issues
Quarkus Tools for Visual Studio Code 1.0.0 release: https://quarkus.io/blog/quarkus-developer-joy-for-vs-code/