Module io.quarkus.qute.debug
Class BreakpointsRegistry
java.lang.Object
io.quarkus.qute.debug.agent.breakpoints.BreakpointsRegistry
Registry for managing Qute template breakpoints during a debugging session.
This class maintains a thread-safe mapping between template URIs and their
associated RemoteBreakpoints, allowing the debug agent to quickly
resolve breakpoints by URI, template ID, or line number.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns all URIs currently associated with breakpoints.voidreset()Clears all registered breakpoints.resolveBreakpoint(URI sourceUri, String templateId, int line, SourceTemplateRegistry sourceTemplateRegistry) Resolves aRemoteBreakpointfor the given template and line number.org.eclipse.lsp4j.debug.Breakpoint[]setBreakpoints(org.eclipse.lsp4j.debug.SourceBreakpoint[] sourceBreakpoints, org.eclipse.lsp4j.debug.Source source) Sets (or replaces) the list of breakpoints for the given source.
-
Constructor Details
-
BreakpointsRegistry
public BreakpointsRegistry()Creates an empty breakpoint registry.
-
-
Method Details
-
setBreakpoints
public org.eclipse.lsp4j.debug.Breakpoint[] setBreakpoints(org.eclipse.lsp4j.debug.SourceBreakpoint[] sourceBreakpoints, org.eclipse.lsp4j.debug.Source source) Sets (or replaces) the list of breakpoints for the given source.This method is typically called in response to the DAP
setBreakpointsrequest. Existing breakpoints for the given source are cleared and replaced with the provided ones.- Parameters:
sourceBreakpoints- the array of source breakpoints received from the clientsource- the DAPSourcethat identifies the template- Returns:
- an array of verified
Breakpoints to return to the client
-
getSourceUris
Returns all URIs currently associated with breakpoints.- Returns:
- a set of source URIs that have at least one breakpoint
-
resolveBreakpoint
public RemoteBreakpoint resolveBreakpoint(URI sourceUri, String templateId, int line, SourceTemplateRegistry sourceTemplateRegistry) Resolves aRemoteBreakpointfor the given template and line number.This method first attempts to find a breakpoint by URI. If no URI is available, it falls back to resolving the template URI from its ID using the provided
SourceTemplateRegistry.- Parameters:
sourceUri- the URI of the template, ornullif unknowntemplateId- the template ID (used as a fallback whensourceUriis null)line- the line number in the templatesourceTemplateRegistry- the registry used to resolve template sources- Returns:
- the matching
RemoteBreakpoint, ornullif none exists
-
reset
public void reset()Clears all registered breakpoints.Typically called when a debug session is terminated or reset.
-