Class BreakpointsRegistry

java.lang.Object
io.quarkus.qute.debug.agent.breakpoints.BreakpointsRegistry

public class BreakpointsRegistry extends Object
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 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 setBreakpoints request. Existing breakpoints for the given source are cleared and replaced with the provided ones.

      Parameters:
      sourceBreakpoints - the array of source breakpoints received from the client
      source - the DAP Source that identifies the template
      Returns:
      an array of verified Breakpoints to return to the client
    • getSourceUris

      public Set<URI> 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 a RemoteBreakpoint for 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, or null if unknown
      templateId - the template ID (used as a fallback when sourceUri is null)
      line - the line number in the template
      sourceTemplateRegistry - the registry used to resolve template sources
      Returns:
      the matching RemoteBreakpoint, or null if none exists
    • reset

      public void reset()
      Clears all registered breakpoints.

      Typically called when a debug session is terminated or reset.