KetraTerm
API · v0.2.2All versions

SwingShellSuggestion

data class SwingShellSuggestion @JvmOverloads constructor(val replacementText: String, val replacementStartOffset: Int, val replacementEndOffset: Int, val source: String, val kind: String, val displayText: String = replacementText, val detail: String = "", val accentRole: SwingShellSuggestionAccentRole = SwingShellSuggestionAccentRole.from(kind, source), val matchedRanges: SwingShellSuggestionMatchRanges = SwingShellSuggestionMatchRanges.EMPTY, val sourceDisplayText: String = source, val interactionContext: Any? = null)

Host-provided shell suggestion shown by the reusable Swing terminal popup.

The Swing layer only presents and selects suggestions. The host/provider owns choosing the replacement text, range, source, and semantic kind; Swing validates that contract before applying the default command-line edit.

Throws

if text/source/kind fields are invalid, replacement offsets are unordered, or matchedRanges do not address displayText.

Constructors

Link copied to clipboard
constructor(replacementText: String, replacementStartOffset: Int, replacementEndOffset: Int, source: String, kind: String, displayText: String = replacementText, detail: String = "", accentRole: SwingShellSuggestionAccentRole = SwingShellSuggestionAccentRole.from(kind, source), matchedRanges: SwingShellSuggestionMatchRanges = SwingShellSuggestionMatchRanges.EMPTY, sourceDisplayText: String = source, interactionContext: Any? = null)

Properties

Link copied to clipboard

stable visual category supplied by the host or derived from kind for generic providers.

Link copied to clipboard

secondary contextual text shown with displayText, such as flags, path context, or a short description.

Link copied to clipboard

primary text shown in the popup.

Link copied to clipboard

opaque host-owned request context preserved by Swing and returned unchanged with acceptance or dismissal feedback.

Link copied to clipboard

compact semantic candidate kind label supplied by the host.

Link copied to clipboard

immutable ordered UTF-16 intervals relative to displayText used to visually highlight matching fragments.

Link copied to clipboard

exclusive UTF-16 end offset in the request command text.

Link copied to clipboard

inclusive UTF-16 start offset in the request command text.

Link copied to clipboard

text the provider intends to insert or use for command-line replacement after acceptance.

Link copied to clipboard

stable provider identifier used for feedback and learning, such as history, path, or intellij-git-branch.

Link copied to clipboard

compact user-facing source label. This is kept separate from source so renderers never need to infer presentation from a provider identifier.

Functions

Link copied to clipboard

Returns the command text that would result from accepting this suggestion.

Link copied to clipboard

Returns the validated replacement plan for this suggestion and request.