java.lang.Object
io.quarkus.qute.debug.adapter.DebugServerAdapter
- All Implemented Interfaces:
org.eclipse.lsp4j.debug.services.IDebugProtocolServer
public class DebugServerAdapter
extends Object
implements org.eclipse.lsp4j.debug.services.IDebugProtocolServer
Debug Adapter Protocol (DAP) server implementation for Qute debugging.
This adapter connects the DebuggeeAgent (responsible for template
execution debugging) with an external DAP client, such as VS Code or
IntelliJ. It translates events and requests between Qute's internal debugging
system and the standardized DAP interface.
It supports breakpoints, stack traces, variable inspection, evaluation, stepping, pausing, resuming, and other typical debugging features.
-
Field Summary
Fields inherited from interface org.eclipse.lsp4j.debug.services.IDebugProtocolServer
SCHEMA_VERSION -
Constructor Summary
ConstructorsConstructorDescriptionDebugServerAdapter(DebuggeeAgent agent) Creates a newDebugServerAdapterand registers listeners to forward debugger events to the DAP client. -
Method Summary
Modifier and TypeMethodDescriptionAttaches to a running debug session.CompletableFuture<org.eclipse.lsp4j.debug.CompletionsResponse> completions(org.eclipse.lsp4j.debug.CompletionsArguments args) Provides code completions for the given context.voidconnect(org.eclipse.lsp4j.debug.services.IDebugProtocolClient client) Associates a DAP client with this adapter and configures the appropriate JavaSourceResolver based on the client type.CompletableFuture<org.eclipse.lsp4j.debug.ContinueResponse> continue_(org.eclipse.lsp4j.debug.ContinueArguments args) Resumes execution of a specific thread or all threads.disconnect(org.eclipse.lsp4j.debug.DisconnectArguments args) Disconnects the debug client and disables the agent.CompletableFuture<org.eclipse.lsp4j.debug.EvaluateResponse> evaluate(org.eclipse.lsp4j.debug.EvaluateArguments args) Evaluates an expression in the context of a given stack frame.voidHandles a terminate event and notifies the client.voidhandleThreadChanged(ThreadEvent event) Handles a thread event and notifies the client.CompletableFuture<org.eclipse.lsp4j.debug.Capabilities> initialize(org.eclipse.lsp4j.debug.InitializeRequestArguments args) Initializes the debug session, returning supported capabilities.next(org.eclipse.lsp4j.debug.NextArguments args) pause(org.eclipse.lsp4j.debug.PauseArguments args) CompletableFuture<org.eclipse.lsp4j.debug.ScopesResponse> scopes(org.eclipse.lsp4j.debug.ScopesArguments args) Returns the variable scopes for a given stack frame.CompletableFuture<org.eclipse.lsp4j.debug.SetBreakpointsResponse> setBreakpoints(org.eclipse.lsp4j.debug.SetBreakpointsArguments args) Sets breakpoints in a given source file.CompletableFuture<org.eclipse.lsp4j.debug.SetExceptionBreakpointsResponse> setExceptionBreakpoints(org.eclipse.lsp4j.debug.SetExceptionBreakpointsArguments args) Required by DAP but not used in this implementation.CompletableFuture<org.eclipse.lsp4j.debug.SourceResponse> source(org.eclipse.lsp4j.debug.SourceArguments args) CompletableFuture<org.eclipse.lsp4j.debug.StackTraceResponse> stackTrace(org.eclipse.lsp4j.debug.StackTraceArguments args) Returns the stack trace for a given thread.stepIn(org.eclipse.lsp4j.debug.StepInArguments args) stepOut(org.eclipse.lsp4j.debug.StepOutArguments args) terminate(org.eclipse.lsp4j.debug.TerminateArguments args) Terminates the current debugging session.CompletableFuture<org.eclipse.lsp4j.debug.ThreadsResponse> threads()Returns the list of threads currently being debugged.CompletableFuture<org.eclipse.lsp4j.debug.VariablesResponse> variables(org.eclipse.lsp4j.debug.VariablesArguments args) Returns the variables for a given variable reference.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.eclipse.lsp4j.debug.services.IDebugProtocolServer
breakpointLocations, cancel, configurationDone, dataBreakpointInfo, disassemble, exceptionInfo, goto_, gotoTargets, launch, loadedSources, locations, modules, readMemory, restart, restartFrame, reverseContinue, setDataBreakpoints, setExpression, setFunctionBreakpoints, setInstructionBreakpoints, setVariable, stepBack, stepInTargets, terminateThreads, writeMemory
-
Constructor Details
-
DebugServerAdapter
Creates a newDebugServerAdapterand registers listeners to forward debugger events to the DAP client.- Parameters:
agent- the Qute debugging agent
-
-
Method Details
-
initialize
public CompletableFuture<org.eclipse.lsp4j.debug.Capabilities> initialize(org.eclipse.lsp4j.debug.InitializeRequestArguments args) Initializes the debug session, returning supported capabilities.- Specified by:
initializein interfaceorg.eclipse.lsp4j.debug.services.IDebugProtocolServer- Parameters:
args- the initialization request arguments- Returns:
- a future providing the supported capabilities
-
connect
public void connect(org.eclipse.lsp4j.debug.services.IDebugProtocolClient client) Associates a DAP client with this adapter and configures the appropriate JavaSourceResolver based on the client type.- Parameters:
client- the connected DAP client
-
attach
Attaches to a running debug session.- Specified by:
attachin interfaceorg.eclipse.lsp4j.debug.services.IDebugProtocolServer- Parameters:
args- attachment arguments- Returns:
- a future that completes when the client is notified
-
setBreakpoints
public CompletableFuture<org.eclipse.lsp4j.debug.SetBreakpointsResponse> setBreakpoints(org.eclipse.lsp4j.debug.SetBreakpointsArguments args) Sets breakpoints in a given source file.- Specified by:
setBreakpointsin interfaceorg.eclipse.lsp4j.debug.services.IDebugProtocolServer- Parameters:
args- the breakpoints configuration- Returns:
- a future providing the resolved breakpoints
-
setExceptionBreakpoints
public CompletableFuture<org.eclipse.lsp4j.debug.SetExceptionBreakpointsResponse> setExceptionBreakpoints(org.eclipse.lsp4j.debug.SetExceptionBreakpointsArguments args) Required by DAP but not used in this implementation.- Specified by:
setExceptionBreakpointsin interfaceorg.eclipse.lsp4j.debug.services.IDebugProtocolServer- Parameters:
args- the exception breakpoints arguments- Returns:
- an empty response
-
threads
Returns the list of threads currently being debugged.- Specified by:
threadsin interfaceorg.eclipse.lsp4j.debug.services.IDebugProtocolServer- Returns:
- a future containing the threads
-
stackTrace
public CompletableFuture<org.eclipse.lsp4j.debug.StackTraceResponse> stackTrace(org.eclipse.lsp4j.debug.StackTraceArguments args) Returns the stack trace for a given thread.- Specified by:
stackTracein interfaceorg.eclipse.lsp4j.debug.services.IDebugProtocolServer- Parameters:
args- the stack trace request arguments- Returns:
- a future containing the stack trace
-
scopes
public CompletableFuture<org.eclipse.lsp4j.debug.ScopesResponse> scopes(org.eclipse.lsp4j.debug.ScopesArguments args) Returns the variable scopes for a given stack frame.- Specified by:
scopesin interfaceorg.eclipse.lsp4j.debug.services.IDebugProtocolServer- Parameters:
args- the scopes request arguments- Returns:
- a future containing the scopes
-
variables
public CompletableFuture<org.eclipse.lsp4j.debug.VariablesResponse> variables(org.eclipse.lsp4j.debug.VariablesArguments args) Returns the variables for a given variable reference.- Specified by:
variablesin interfaceorg.eclipse.lsp4j.debug.services.IDebugProtocolServer- Parameters:
args- the variables request arguments- Returns:
- a future containing the variables
-
terminate
Terminates the current debugging session.- Specified by:
terminatein interfaceorg.eclipse.lsp4j.debug.services.IDebugProtocolServer- Parameters:
args- the terminate arguments- Returns:
- a future that completes when the session is terminated
-
disconnect
Disconnects the debug client and disables the agent.- Specified by:
disconnectin interfaceorg.eclipse.lsp4j.debug.services.IDebugProtocolServer- Parameters:
args- the disconnect arguments- Returns:
- a future that completes when the disconnection is done
-
stepIn
- Specified by:
stepInin interfaceorg.eclipse.lsp4j.debug.services.IDebugProtocolServer
-
stepOut
- Specified by:
stepOutin interfaceorg.eclipse.lsp4j.debug.services.IDebugProtocolServer
-
pause
- Specified by:
pausein interfaceorg.eclipse.lsp4j.debug.services.IDebugProtocolServer
-
next
- Specified by:
nextin interfaceorg.eclipse.lsp4j.debug.services.IDebugProtocolServer
-
continue_
public CompletableFuture<org.eclipse.lsp4j.debug.ContinueResponse> continue_(org.eclipse.lsp4j.debug.ContinueArguments args) Resumes execution of a specific thread or all threads.- Specified by:
continue_in interfaceorg.eclipse.lsp4j.debug.services.IDebugProtocolServer- Parameters:
args- the continue request arguments- Returns:
- a future containing the response
-
evaluate
public CompletableFuture<org.eclipse.lsp4j.debug.EvaluateResponse> evaluate(org.eclipse.lsp4j.debug.EvaluateArguments args) Evaluates an expression in the context of a given stack frame.- Specified by:
evaluatein interfaceorg.eclipse.lsp4j.debug.services.IDebugProtocolServer- Parameters:
args- the evaluation arguments- Returns:
- a future containing the evaluation result
-
completions
public CompletableFuture<org.eclipse.lsp4j.debug.CompletionsResponse> completions(org.eclipse.lsp4j.debug.CompletionsArguments args) Provides code completions for the given context.- Specified by:
completionsin interfaceorg.eclipse.lsp4j.debug.services.IDebugProtocolServer- Parameters:
args- the completions request arguments- Returns:
- a future containing the completion results
-
source
public CompletableFuture<org.eclipse.lsp4j.debug.SourceResponse> source(org.eclipse.lsp4j.debug.SourceArguments args) - Specified by:
sourcein interfaceorg.eclipse.lsp4j.debug.services.IDebugProtocolServer
-
handleThreadChanged
Handles a thread event and notifies the client.- Parameters:
event- the thread event
-
handleTerminate
public void handleTerminate()Handles a terminate event and notifies the client. -
onJavaSourceResolved
-