java.lang.Object
io.quarkus.qute.debug.agent.variables.VariablesHelper
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.eclipse.lsp4j.debug.VariablefillVariable(String name, Object value, RemoteStackFrame frame, Collection<org.eclipse.lsp4j.debug.Variable> variables, VariablesRegistry variablesRegistry) Converts a value into aVariablesuitable for the debugger.static booleanshouldBeExpanded(Object value, RemoteStackFrame frame) Determines whether a value should be expanded in the debugger UI.
-
Constructor Details
-
VariablesHelper
public VariablesHelper()
-
-
Method Details
-
shouldBeExpanded
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 inspectframe- 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 aVariablesuitable for the debugger.- If the value is a
CompletionStage, waits for its completion if already done. - Creates aRemoteVariableif the value is expandable, otherwise a plainVariable. - Sets the name, type, and string representation of the value. - Optionally adds it to the provided collection of variables.- Parameters:
name- the variable namevalue- the variable valueframe- the stack frame the variable belongs tovariables- a collection to add the created variable to, can be nullvariablesRegistry- the registry used to track RemoteVariables- Returns:
- the created
Variableinstance
-