independent-projects/qute/debug/README.md
Since Quarkus 3.29, Qute Debugger allows you to debug Qute templates using breakpoints in any IDE or editor that supports the Debug Adapter Protocol (DAP).
It works seamlessly with:
You can use it with a simple Java main class or directly inside a Quarkus application.
The Qute Debugger consists of two parts:
DAP Server (server side)
Runs inside your Java application or Quarkus app.
It opens a ServerSocket on a specified port.
DAP Client (client side)
Your IDE/editor connects to this socket using the DAP attach mode and communicates with the Qute Debugger.
io.quarkus.qute.debug.adapter.RegisterDebugServerAdapter class.io.quarkus.qute.EngineBuilder$EngineListener to track the Qute Engine instance.-DquteDebugPort system property is set, a ServerSocket is created on that port.Qute Debugger can be integrated into any IDE or editor that supports the Debug Adapter Protocol.
Currently, two main integrations exist:
The vscode-quarkus extension registers a custom debug type called "qute".
In your .vscode/launch.json:
{
"version": "0.2.0",
"configurations": [
{
"name": "Debugging Qute Templates",
"type": "qute",
"request": "attach",
"port": 4971
}
]
}
The Quarkus Tools for IntelliJ plugin is built on top of LSP4IJ, which provides DAP support.
When you start a Quarkus application in Dev Mode, IntelliJ automatically detects the Qute Debugger startup message:
Qute debugger server listening on port 4971
It then creates a Remote Qute Debug run configuration automatically, which you can launch directly:
To enable debugging, register the Qute Debugger in your Engine configuration:
Engine engine = Engine.builder()
.enableTracing(true) // Enable tracing, required for debugging
.addEngineListener(new RegisterDebugServerAdapter()) // Attach Qute Debugger
.build();
Start your application and specify a debug port:
-DquteDebugPort=12345
The DAP client (e.g., your IDE) must then connect to port 12345.
application.propertiesThe Qute debugger is enabled by default. Disable it by adding (if you need):
quarkus.qute.debug.enabled=false
When starting Quarkus, define both:
-Ddebug)-DquteDebugPort)Example:
./mvnw -Ddebug=4972 -DquteDebugPort=4971 quarkus:dev
Your IDE should then connect to the Qute debug port (4971 in this example).
Pause template execution at specific locations.
Pause only when certain conditions are met.
Hover
Evaluate expressions on the fly while debugging templates.
Get suggestions while debugging.
Inspect the current context and variables in real-time.
Since Quarkus 3.31 ...