KetraTerm
API · DevelopmentAll versions

SwingCompletionSuggestionProvider

class SwingCompletionSuggestionProvider @JvmOverloads constructor(engine: TerminalCompletionEngine, contextProvider: () -> SwingCompletionContext, sourceLabels: Map<String, String>, feedbackHandler: SwingShellSuggestionFeedbackHandler = SwingShellSuggestionFeedbackHandler.NONE) : SwingShellSuggestionProvider

Host-neutral adapter from the pure completion engine to Swing suggestions.

The adapter reads contextProvider for every request so hosts can publish current profile and working-directory state without rebuilding the engine.

Parameters

engine

pure progressive completion engine. This adapter does not select a dispatcher; the owning suggestion caller controls its coroutine context.

contextProvider

supplier for an immutable snapshot of current host-owned metadata. open captures it synchronously on the EDT before background work. Direct suggestions callers capture it in their own calling context.

sourceLabels

exact source identifiers mapped to host-owned display labels. Copied at construction; blank labels are rejected. Labels are trimmed and bounded to 128 UTF-16 units without splitting a surrogate pair. Unknown identifiers use the neutral built-in label or a humanized identifier. Source identity and ranking are unaffected. No host callback is invoked during adaptation.

feedbackHandler

observer captured with every opened source. Provider replacement never redirects feedback from an already opened request.

Constructors

Link copied to clipboard
constructor(engine: TerminalCompletionEngine, contextProvider: () -> SwingCompletionContext, sourceLabels: Map<String, String>, feedbackHandler: SwingShellSuggestionFeedbackHandler = SwingShellSuggestionFeedbackHandler.NONE)
constructor(engine: TerminalCompletionEngine, contextProvider: () -> SwingCompletionContext = { SwingCompletionContext.EMPTY }, feedbackHandler: SwingShellSuggestionFeedbackHandler = SwingShellSuggestionFeedbackHandler.NONE)

Creates an adapter with neutral source labels and optional live host context.

Functions

Link copied to clipboard

Captures host context and feedback on the EDT; engine work starts only on collection.

Link copied to clipboard

Returns progressive candidate snapshots adapted to the reusable Swing popup contract.