Skip to content

Commit

Permalink
A recap of Quarkus Tools for IntelliJ's latest improvements
Browse files Browse the repository at this point in the history
Signed-off-by: Fred Bricon <[email protected]>
  • Loading branch information
fbricon committed Oct 5, 2023
1 parent 6360c8b commit 1e47d25
Show file tree
Hide file tree
Showing 28 changed files with 198 additions and 0 deletions.
7 changes: 7 additions & 0 deletions _data/authors.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -486,3 +486,10 @@ adietish:
emailhash: "7c51d8659ec615ece71062bbe956470d"
job_title: "Senior Software Engineer"
bio: "Software Engineer, working at Red Hat on Jetbrains IDEA plugins."
fbricon:
name: "Fred Bricon"
email: "[email protected]"
emailhash: "a66008162ccd0fdceaa95ed82f4fef65"
job_title: "Principal Software Engineer"
twitter: "fbricon"
bio: "Fred has been working in the Dev Tools team at Red Hat, since 2011, where he develops IDE extensions for Eclipse, VS Code and IntelliJ IDEA."
191 changes: 191 additions & 0 deletions _posts/2023-10-10-intellij-quarkus-recap.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,191 @@
---
layout: post
title: A recap of Quarkus Tools for IntelliJ's latest improvements
date: 2023-10-10
tags: intellij ide
synopsis: Over the past five months, we’ve been really hard at work to improve Quarkus Tools in every possible way. So let’s look in more details at what was accomplished.
author: fbricon
---
:imagesdir: /assets/images/posts/intellij-quarkus-tools-oct23

https://plugins.jetbrains.com/plugin/13234-quarkus-tools[Quarkus Tools for IntelliJ] is a free and open source extension, helping users develop Quarkus applications by providing content-assist, validation, run configurations and many other features right from their favourite IDE.

This extension is based on the https://github.com/eclipse/lsp4mp[LSP4MP] (i.e. MicroProfile) and its https://github.com/redhat-developer/quarkus-ls/tree/master/quarkus.ls.ext[Quarkus] add-on, and the https://github.com/redhat-developer/quarkus-ls/tree/master/qute.ls[Qute language server]. These are all used in our popular https://marketplace.visualstudio.com/items?itemName=redhat.vscode-quarkus[Quarkus Tools extension] for Visual Studio Code.

Over the past five months, we've been *really* hard at work to improve Quarkus Tools in every possible way, averaging about one release every two weeks.

We've been focusing on performance improvements, Quarkus 3.x with JakartaEE namespace support, Qute templating support, and generally trying to keep Quarkus Tools out of your way. So let's look in more details at what was accomplished.

== Increased stability and performance
We've addressed various critical issues in our custom Language Server client (LSP4IJ), that previously caused Language Servers to freeze IntelliJ IDEA. Improvements include:

- Waiting until indexing is finished before launching the language servers.
- Language server requests no longer blocking the editor.
- Debouncing some requests to minimize heavy processing
- New request cancellation support to avoid unnecessary processing.
- Faster validation and lazy loading of quick fixes.
- Reduced quarkus properties completion payload size.

- Pre-emptively fetching Quarkus data in the Quarkus project wizard, in order to avoid waiting after clicking on the `Next` button.

These fixes contribute to a smoother coding experience, better overall performance, and, dare I say it, "developer joy".


== Language Server client improvements

=== Language Servers console
Although not directly useful to users in most cases, the new Language Server console view is extremely important when we need to troubleshoot issues with the language servers.

The state of the servers is visible, stop and restart is available with a right-click, and you can enable different levels of tracing:

image:lsp-console-config.png[Language server configuration]

The communication details between the IDE and the language servers are seen in the "LSP consoles" pane. In `verbose` mode, the messages can be expanded for more details:

image:lsp-console-traces.png[Language server traces]

This feature has proven invaluable in assisting us in diagnosing performance issues with the extension. It will enable users to provide valuable troubleshooting information in case any issues arise.

=== Language Servers preferences
A preference page is now available, under `Preferences | Languages & Frameworks | Language Servers`, allowing power users to configure language servers debugging and tracing:
image:lsp-settings.png[Language servers preferences]


== Application properties support

=== Completion improvements
Properties completion in `application.properties` files now displays icons and documentation (provided `Preferences | Editor | General | Code Completion | Show the documentation popup` is enabled):
image:properties-completion.png[Quarkus properties completion]

Completion is also available for enum values:
image:properties-completion-enum.png[Quarkus properties enum completion]

=== Inlay hints
Properties using expression values are now resolved as inlay hints:
image:properties-inlay-hint.png[Resolved property expression as inlay hint]

Inlay hints can be disabled in `Preferences | Languages & Frameworks | MicroProfile | Properties`

== Java editing improvements

=== New codelens for Vert.x reactive routes
Vert.x reactive routes now show a clickable codelens, that will open the browser to the configured URL, similar to JAX-RS endpoints:

image:reactive-routes.png[Reactive routes]

== Qute improvements
We've spent significant effort on making the best Qute support around.

=== New syntax coloration
The Qute parser has been rewritten to allow for proper syntax coloration:

[frame=none, grid=none]
|===
|image:qute-syntax-coloration-light.png[Qute Syntax coloration - light theme] |image:qute-syntax-coloration-dark.png[Qute Syntax coloration - dark theme]
|===

Coloration settings are available at `Preferences | Editor | Color Scheme | Qute`.

=== Completion redux
Editing Qute templates is now better than ever, with new brackets autoclose, improved HTML integration, new completion icons. In particular, the enhanced snippet completion, that behaves like IntelliJ's live templates, available for different Qute sections:

image:qute-completion-snippets.gif[Qute snippet completion]

Section `{#}` completion now displays user tags contributed by dependencies, like Renarde or Web Bundler:
image:qute-renarde-tags-completion.png[Renarde tags completion]


=== Improved {#insert} and {#include} support
The `{#insert}` and `{#include}` sections can be used to specify the extended template to include in the current template. This release extends the support for these sections with validation, document link, completion, and code lens.

=== Navigation between templates/code
You can navigate by `Ctrl+click` (`Cmd+click` on Mac), from one template to another (referenced as user tags, via `{#include}` or `{#insert}`), or from a template definition from a java file to the actual file:
image:qute-template-navigation.gif[Qute navigation]

=== New template fragment support
Fragment sections define a part of the template that can be treated and rendered as a separate template. Support for fragments includes snippet completion, hover and validation.
In a java class, you can navigate to a referenced `#fragment` via code lens and document link
image:qute-fragment-support.gif[]

=== Renarde support

Quarkus Tools now provides support for the https://docs.quarkiverse.io/quarkus-renarde/dev/index.html[Renarde] web framework:

- Public methods of sub-classes of a Renarde `Controller` automatically show a clickable codelens, even though they're lacking a HTTP method annotation, as they're treated as valid JAX-RS endpoints:
image:qute-renarde-codelens.png[Renarde endpoint codelens]

- Completion on the Renarde `uri` and `uriabs` namespaces lists available Renarde controllers:
image:qute-renarde-completion.png[Renarde uri completion]

- Quick-fix is available to add missing input fields to a `{#form}` section:
image:qute-renarde-form-quickfix.gif[Renarde form quickfix]


=== Type-Safe Message Bundles partial support

We have introduced partial support for Qute type-safe message bundles. If you defined `@MessageBundle` classes in your code, you'll automatically get autocompletion for those messages in your Qute templates, with the messages rendered as inlay hints:

image:qute-message-bundles.png[Message bundle support for Qute templates]

Rendering messages from properties files is not yet supported.

== Validation

=== Java files
Validation has been enhanced with the following features:

- GraphQL `void` operations are now allowed in Quarkus 3.1 and higher and the correct placement of GraphQL directives is now checked:
image:java-validation-graphql-directives.png[GraphQL directives placement validation]

- Quarkus `BuildItem` subclasses are checked whether they're `final` or `abstract`:
image:java-builditem-validation.png[BuildItem validation]

=== Severity mappings
We've tried to bind some Microprofile and Qute diagnostics reported by the language servers to IntelliJ's Inspections settings, as it felt more natural than having specialized preference pages. But, since this is a bit of a hack, the inspections settings are mostly ignored, except for a couple severity settings. The limitations are described in each inspection description:

image:inspections-severity-mapping.png[Inspection severity mapping]

In most cases:

- Scope: values are ignored
- Severity: only Error and (Weak) Warning are respected. Other values mean no errors will be reported
- Highlighting in Editor: values are ignored

=== Quick-fixes updating settings

We've introduced quick fixes that allow you to disable validation for certain errors. Useful, for instance, when you find false-positive errors add too much noise to your development workflow.

Unassigned `@ConfigProperty` properties (i.e not declared in `application.properties`) in java files, or unknown properties (seemingly unused) declared in `application.properties` can now be excluded from validation via a quick-fix, e.g:

image:exclusions-quickfix.png[Quick-fix to exclude property from validation]

You can then update those exclusions in `Preferences | Editor | Inspections | MicroProfile | Java files | Unassigned properties` or `Preferences | Editor | Inspections | MicroProfile | Properties files | Unassigned properties`

image:exclusions-settings.png[Inspections settings]


Similarly you can exclude a particular Qute template from validation, or its entire module

image:exclude-qute-validation.png[Exclude Qute template from validation]

You can then head over to `Preferences | Editor | Inspections | Qute | Templates | Validation`,

image:qute-validation-settings.png[Qute validation settings]


== Miscellaneous improvements
- The Quarkus project wizard, on top of being super snappy, now offers easy (de)selection of extensions by double-clicking on them.
- Projects in WSL2 are now supported.
- Run configurations have been renamed to `Quarkus Dev Mode`, to minimize confusion with IntelliJ Ultimate's built-in Quarkus support.
- Vert.x reactive routes, JAX-RS and Renarde endpoints are now shown as implicitly used, as well as Quarkus `@BuildStep`-annotated classes and `@Observer`-annotated methods.


== Looking forward

Quarkus' "developer joy" mantra obviously applies to your time spent in the IDE and that's what the Red Hat Developer team is vying for. As we reflect on the past five months of releases, we're pretty excited about the progress we've made on the Quarkus development experience, in IntelliJ IDEA.

And we're not going to stop here, so stay tuned for more performance improvements and exciting new features in the coming weeks. We're actually planning to make it easier for you to get those new bits as soon as possible, by publishing updates to the EAP release channel.

Finally, if you haven't done it already, please https://plugins.jetbrains.com/plugin/13234-quarkus-tools[add your review to the JetBrains marketplace]. Your feedback matters!

In case you find bugs or have ideas for some great new features, don't hesitate to head over to our https://github.com/redhat-developer/intellij-quarkus/issues[Github repository] and open a ticket.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 1e47d25

Please sign in to comment.