feat(debugger): completion in Evaluate, the Variables evaluate field and the Debug console (#1102)

While suspended, the debugger's expression fields complete from the debug adapter (DAP completions) in the selected frame: Evaluate, the Variables evaluate field and the Debug console share one hook. The list opens while typing an identifier or after '.', or on Ctrl+Space; Up/Down, Enter/Tab, Escape. The Evaluate dialog is resizable and its result tree grows with it. Backend: ide-dap completions (skipped without supportsCompletionsRequest), debug_completions on the host and the desktop app.
Цей коміт міститься в:
l0ng-ai authored and GitHub committed 2026-11-04 04:47:12 +08:00
1 джерело e575bf8c24
коміт fe0ee338f4
13 files changed
+481 -6

No files matched your search

+13
Переглянути файл
@@ -671,6 +671,8 @@ export const commands = {
debugScopes: (session: DebugSessionId, frameId: number) => typedError<Scope[], IdeError>(__TAURI_INVOKE("debug_scopes", { session, frameId })),
debugVariables: (session: DebugSessionId, reference: number) => typedError<Variable[], IdeError>(__TAURI_INVOKE("debug_variables", { session, reference })),
debugEvaluate: (session: DebugSessionId, frameId: number | null, expression: string) => typedError<Variable, IdeError>(__TAURI_INVOKE("debug_evaluate", { session, frameId, expression })),
/** Completions for an expression typed in Evaluate (`line` / `column` 0-based, UTF-16). */
debugCompletions: (session: DebugSessionId, frameId: number | null, text: string, line: number, column: number) => typedError<DebugCompletion[], IdeError>(__TAURI_INVOKE("debug_completions", { session, frameId, text, line, column })),
debugResume: (session: DebugSessionId, threadId: number) => typedError<null, IdeError>(__TAURI_INVOKE("debug_resume", { session, threadId })),
debugPause: (session: DebugSessionId, threadId: number) => typedError<null, IdeError>(__TAURI_INVOKE("debug_pause", { session, threadId })),
debugStep: (session: DebugSessionId, threadId: number, kind: StepKind) => typedError<null, IdeError>(__TAURI_INVOKE("debug_step", { session, threadId, kind })),
@@ -2584,6 +2586,17 @@ export type DebugCapabilities = {
hotCodeReplace: boolean,
};
/** A completion the adapter offers for an expression (DAP `completions`). */
export type DebugCompletion = {
label: string,
/** What to insert, when it differs from `label`. */
text: string | null,
/** DAP item type: `method`, `field`, `variable`, `class`, `keyword`, … */
kind: string | null,
detail: string | null,
sortText: string | null,
};
export type DebugEvent =
/**
* First event of every session (only build output of a root session's