Class RemoteScope

java.lang.Object
org.eclipse.lsp4j.debug.Scope
io.quarkus.qute.debug.agent.scopes.RemoteScope
All Implemented Interfaces:
VariablesProvider
Direct Known Subclasses:
GlobalsScope, LocalsScope, NamespaceResolversScope

public abstract class RemoteScope extends org.eclipse.lsp4j.debug.Scope implements VariablesProvider
Represents a scope in the Qute debugger (e.g., locals, globals, namespace resolvers).

A RemoteScope wraps a RemoteStackFrame and exposes its variables. The variables are lazily computed and cached.

Subclasses must implement createVariables() to define how variables are collected from the underlying context (locals, globals, or other resolvers).

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final org.eclipse.lsp4j.debug.Scope[]
    Empty scope array constant for convenience.
  • Constructor Summary

    Constructors
    Constructor
    Description
    RemoteScope(String name, RemoteStackFrame frame, VariablesRegistry variablesRegistry)
    Creates a new remote scope.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected abstract Collection<org.eclipse.lsp4j.debug.Variable>
    Subclasses must implement this method to create the list of variables for the scope.
    protected static void
    fillVariables(RemoteStackFrame frame, io.quarkus.qute.ResolutionContext context, Collection<org.eclipse.lsp4j.debug.Variable> variables, VariablesRegistry variablesRegistry)
    Helper to fill a collection of variables from a ResolutionContext.
    Returns the stack frame associated with this scope.
    Collection<org.eclipse.lsp4j.debug.Variable>
    Returns the variables contained in this scope.
    Returns the registry used to manage variables in this scope.

    Methods inherited from class org.eclipse.lsp4j.debug.Scope

    equals, getColumn, getEndColumn, getEndLine, getIndexedVariables, getLine, getName, getNamedVariables, getPresentationHint, getSource, getVariablesReference, hashCode, isExpensive, setColumn, setEndColumn, setEndLine, setExpensive, setIndexedVariables, setLine, setName, setNamedVariables, setPresentationHint, setSource, setVariablesReference, toString

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface io.quarkus.qute.debug.agent.variables.VariablesProvider

    getVariablesReference, setVariablesReference
  • Field Details

    • EMPTY_SCOPES

      public static final org.eclipse.lsp4j.debug.Scope[] EMPTY_SCOPES
      Empty scope array constant for convenience.
  • Constructor Details

    • RemoteScope

      public RemoteScope(String name, RemoteStackFrame frame, VariablesRegistry variablesRegistry)
      Creates a new remote scope.
      Parameters:
      name - the name of the scope (e.g., "Locals", "Globals")
      frame - the stack frame associated with this scope
      variablesRegistry - the registry that manages all debugger variables
  • Method Details

    • getVariables

      public Collection<org.eclipse.lsp4j.debug.Variable> getVariables()
      Returns the variables contained in this scope.

      Variables are lazily created via createVariables() and cached.

      Specified by:
      getVariables in interface VariablesProvider
      Returns:
      a collection of Variable objects
    • createVariables

      protected abstract Collection<org.eclipse.lsp4j.debug.Variable> createVariables()
      Subclasses must implement this method to create the list of variables for the scope.
      Returns:
      a collection of Variable objects
    • fillVariables

      protected static void fillVariables(RemoteStackFrame frame, io.quarkus.qute.ResolutionContext context, Collection<org.eclipse.lsp4j.debug.Variable> variables, VariablesRegistry variablesRegistry)
      Helper to fill a collection of variables from a ResolutionContext.

      Supports Map and Mapper data sources. Each entry is converted into a Variable using

      invalid reference
      VariablesHelper#fillVariable
      .

      Parameters:
      frame - the stack frame
      context - the resolution context containing the data
      variables - the collection to fill
      variablesRegistry - the registry managing variables
    • getVariablesRegistry

      public VariablesRegistry getVariablesRegistry()
      Returns the registry used to manage variables in this scope.
    • getStackFrame

      public RemoteStackFrame getStackFrame()
      Returns the stack frame associated with this scope.