Class VariablesHelper

java.lang.Object
io.quarkus.qute.debug.agent.variables.VariablesHelper

public class VariablesHelper extends Object
Helper utility for creating and managing debug variables.

Provides methods to determine if a value should be expandable in the debugger and to convert Java objects into Variable instances for LSP-based debugging.

  • Constructor Details

    • VariablesHelper

      public VariablesHelper()
  • Method Details

    • shouldBeExpanded

      public static boolean shouldBeExpanded(Object value, RemoteStackFrame frame)
      Determines whether a value should be expanded in the debugger UI.

      Collections, arrays, or objects with public fields (as detected by ReflectionValueResolverCollector.isFieldCandidate(java.lang.reflect.Field)) are expandable.

      Parameters:
      value - the value to inspect
      frame - the current stack frame
      Returns:
      true if the value should be expanded, false otherwise
    • fillVariable

      public static org.eclipse.lsp4j.debug.Variable fillVariable(String name, Object value, RemoteStackFrame frame, Collection<org.eclipse.lsp4j.debug.Variable> variables, VariablesRegistry variablesRegistry)
      Converts a value into a Variable suitable for the debugger.

      - If the value is a CompletionStage, waits for its completion if already done. - Creates a RemoteVariable if the value is expandable, otherwise a plain Variable. - Sets the name, type, and string representation of the value. - Optionally adds it to the provided collection of variables.

      Parameters:
      name - the variable name
      value - the variable value
      frame - the stack frame the variable belongs to
      variables - a collection to add the created variable to, can be null
      variablesRegistry - the registry used to track RemoteVariables
      Returns:
      the created Variable instance