bubbles library TUI
Reusable interactive components for Artisanal TUI.
This library provides a collection of widgets (Bubbles) like text inputs, viewports, progress bars, and spinners that can be composed into larger applications.
Available Widgets
- KeyBinding - Declarative key bindings with help text
- CursorModel - Blinking cursor for text inputs
- SpinnerModel - Animated loading spinners
- HelpModel - Help view for displaying key bindings
- PaginatorModel - Pagination state and rendering
- ViewportModel - Scrollable content viewport
- ProgressModel - Animated progress bars
- TextInputModel - Single-line text input
- TextAreaModel - Multi-line text editing
- TableModel - Interactive tables
- ListModel - Filterable list selection
- TreeModel - Expandable hierarchical selection and viewport state
- TimerModel - Countdown timer
- StopwatchModel - Stopwatch/elapsed time
- FilePickerModel - File/directory browser and selection
- AnticipateModel - Autocomplete input with suggestions
- NumberInputModel - Interactive numeric input with increment/decrement
- SuggestModel - Text input with a prefix-matched suggestion dropdown
Usage
Bubbles can be composed within your own models using ComponentHost:
class MyModel with ComponentHost implements Model {
final TextInputModel input;
final SpinnerModel spinner;
MyModel({
TextInputModel? input,
SpinnerModel? spinner,
}) : input = input ?? TextInputModel(),
spinner = spinner ?? SpinnerModel();
@override
(Model, Cmd?) update(Msg msg) {
// Delegate to child bubbles
final (newInput, inputCmd) = updateComponent(input, msg);
return (
MyModel(input: newInput, spinner: spinner),
inputCmd,
);
}
@override
String view() => '${spinner.view()} ${input.view()}';
}
Display Components
In addition to interactive models, Artisanal provides DisplayComponents.
These are simple string renderers that don't handle input but provide
consistent styling for tables, lists, and panels.
Use RenderConfig to adapt these components to the current terminal
width and color capabilities.
Bubbles can be composed within your own models using ComponentHost:
class MyModel with ComponentHost implements Model {
final TextInputModel input;
final SpinnerModel spinner;
MyModel({
TextInputModel? input,
SpinnerModel? spinner,
}) : input = input ?? TextInputModel(),
spinner = spinner ?? SpinnerModel();
@override
(Model, Cmd?) update(Msg msg) {
// Delegate to child bubbles
final (newInput, inputCmd) = updateComponent(input, msg);
return (
MyModel(input: newInput, spinner: spinner),
inputCmd,
);
}
@override
String view() => '${spinner.view()} ${input.view()}';
}
In addition to interactive models, Artisanal provides DisplayComponents.
These are simple string renderers that don't handle input but provide
consistent styling for tables, lists, and panels.
Use RenderConfig to adapt these components to the current terminal
width and color capabilities.
Classes
- Alert
- A fluent builder for creating styled alerts.
- AlertComponent
- An alert/notice block component.
- AnticipateConfig
- Configuration for anticipate/autocomplete component.
- AnticipateKeyMap
- Key map for anticipate navigation and selection.
- AnticipateModel
- Anticipate model for autocomplete input.
- AppliedFileEdit
- Result of applying one file's edits.
- AsyncSyntaxTreeProvider
- Asynchronous backend interface for incremental syntax trees.
- AsyncSyntaxTreeSession
- Coordinates asynchronous tree builds and rejects stale responses.
-
AsyncTextSyntaxProvider<
State> - Asynchronous syntax provider for parsers that run outside the render loop.
-
AsyncTextSyntaxSession<
State> - Coordinates asynchronous syntax builds and rejects stale responses.
- AttachmentPreview
- Prepared pixel payload (or failure) for one attachment.
- Box
- A boxed message component.
- BoxBuilder
- A fluent builder for creating styled boxes.
- BulletList
- A bullet list component.
- CodeBlockCommentDelimiters
- CodeLanguageProfile
- Column
- Table column definition.
- ColumnComponent
- A component that renders with a newline after each child.
- ColumnsComponent
- A multi-column layout component.
-
CommandPaletteComponent<
T> - Renders an EditorCommandPalette as a scrolling modal overlay.
- CommandPaletteController
- Shared query, ranking, selection, and viewport controller.
- CommandPaletteItem
- A portable command-palette item, independent of any widget framework.
- CommandPaletteMatch
- A scored palette match with deterministic ranking evidence.
- CommandPaletteOverlay
- Renders a CommandPaletteController as a scrolling modal overlay.
- CommandPaletteWindow
- Inclusive-exclusive window of filtered items that should stay on screen.
- Comment
- A fluent builder for creating styled comments.
- CommentComponent
- A comment component (dimmed text with // prefix).
- CommonKeyBindings
- Commonly used key bindings for navigation.
- ComponentBoxChars
- Box drawing characters for component system.
- CompositeComponent
- A component that composes multiple child components.
- ConditionalStep
- Conditional wizard step.
- ConfirmCancelledMsg
- Message sent when confirmation is cancelled.
- ConfirmKeyMap
- Key bindings for the confirm component.
- ConfirmModel
- A confirmation (yes/no) component following the Model architecture.
- ConfirmResultMsg
- Message sent when confirmation is made.
- ConfirmStep
- Confirmation wizard step.
- ConfirmStyles
- Styles for the confirm component.
- CountdownModel
- A countdown model built on top of TimerModel.
- CursorBlinkMsg
- Message indicating the cursor should toggle its blink state.
- CursorModel
- A blinking cursor widget for text input components.
-
DataTableModel<
T> - A hybrid interactive data table model.
-
DataTableSelectionMadeMsg<
T> - Message sent when a data table row is selected.
- DataTableStyles
- Styles for the interactive data table.
- DebugOverlayModel
- Draggable render-metrics overlay for debugging TUI performance.
- DefaultItemDelegate
- Default item delegate with simple rendering.
- DefinitionList
- A fluent builder for creating styled definition lists.
- DefinitionListComponent
- A definition list component (term: description pairs).
- DestructiveConfirmModel
- A destructive confirmation component that requires typing to confirm.
- DiffCommentAnchor
- A commentable position in the rendered diff.
- DiffCommentLineHighlight
- A visual highlight request for a commentable diff line.
- DiffCommentLineKey
- Stable identity for a commentable line in a pull-request diff.
- DiffFile
- A file entry in a parsed diff.
- DiffLayout
- Immutable output of a diff layout pass.
- DiffLine
- A single parsed line from a unified diff.
- DiffStyles
- Configuration for diff styling.
- DisplayComponent
- Base type for display-only UI building blocks.
- DisplayNumberAssigner
- Monotonic display-number assigner; reset when the prompt clears.
- EditBuffer
- EditConflict
- Two edits in one file whose ranges overlap.
-
EditHistoryCheckpoint<
Action, State, Marker> -
EditHistoryController<
Action, State, Marker> - EditorCodeAction
- A quick fix, refactor, or source action offered by tooling.
- EditorCodeActionProvider
- Supplies code actions without coupling editor core to LSP or FFI.
- EditorCodeActionRequest
- Context passed to a backend-neutral code-action provider.
- EditorCodeActionSession
- Rejects results superseded by another request or explicit cancellation.
-
EditorCommand<
T> - A stable, discoverable editor operation.
- EditorCommandIds
- Stable IDs for commands shared by editor hosts.
-
EditorCommandPalette<
T> - UI-agnostic state for an editor command palette.
-
EditorCommandRegistry<
T> - Ordered registry of stable editor commands.
- EditorCommentConfig
- Versatile language abstraction for the editor core.
- EditorCompletionItem
- One completion candidate and the edits needed to accept it.
- EditorCompletionProvider
- Backend-neutral source of editor completions.
- EditorCompletionRequest
- Immutable completion request in grapheme/document coordinates.
- EditorCompletionResult
- Result returned by an EditorCompletionProvider.
- EditorCompletionSession
- Coordinates asynchronous completion requests and rejects stale responses.
- EditorCoreConfig
- EditorDocumentSnapshot
- Serializable editor document state supplied to persistence adapters.
- EditorDocumentStore
- Persistence boundary for files, databases, browser storage, or remote APIs.
- EditorIndentContext
- Indent request passed to a language adapter.
- EditorKeyBinding
- Associates a host-normalized key chord with a command.
- EditorKeymap
- Ordered keymap with conflict detection.
- EditorLanguageAdapter
- Adapter that customizes editing behavior per language.
- EditorLanguageRegistry
- Mutable registry mapping language identifiers to adapters.
- EditorPairConfig
- Bracket/pair configuration for a language.
- EditorPersistenceSession
- Coordinates durable saves and recovery while rejecting stale completions.
- EditorSelection
- External editor selection attached to a prompt.
- EditorSelectionPosition
- IDE selection ingestion for prompt composers.
- EditorSelectionRange
- One selected range inside EditorSelection.filePath.
- EditorSortLinesArgument
-
Options supplied to the argument-taking
sortSelectedLinescommand. - EditorState
- EditorSyntaxCapture
- A query capture mapped to a decoration style.
- EditorSyntaxNode
- Pure-Dart syntax-tree DTOs for Tree-sitter-style backends.
- EditorSyntaxTree
- Immutable snapshot of a parsed syntax tree.
- EditorWorkAssessment
- Feature recommendations derived from an EditorWorkBudget.
- EditorWorkBudget
- Configurable limits for features whose cost grows with document size.
- EditorWrapSelectionArgument
-
Delimiters supplied to the argument-taking
wrapSelectioncommand. - ExceptionComponent
- An exception renderer component.
- FileEntry
- A file entry with cached stat information.
- FilePickerErrorMsg
- Error message when reading a directory fails.
- FilePickerKeyMap
- Key mappings for the file picker component.
- FilePickerModel
- A file picker model for navigating and selecting files.
- FilePickerReadDirMsg
- Message sent when directory contents are read.
- FilePickerStyles
- Styles for the file picker component.
- FileTextEdit
- Atomic multi-file edit sets for tooling (formatters, refactors, agents).
- FilteredItem
- Filtered item with match information.
-
FilteredSearchItem<
T> - A filtered item with its original index and match positions.
- FilterMatchesMsg
- Filter matches message.
- FoldRange
- Foldable line range (both ends inclusive, 0-based).
- FoldState
- Collapse state over a fold list.
- GitDiffKeyMap
- Key bindings for the git diff viewer.
- GitDiffModel
- A git diff viewer bubble.
- GroupedDefinitionList
- A fluent builder for creating grouped definition lists.
- GroupStep
- Group of wizard steps.
- GutterContext
- GutterContext provides context to a GutterFunc.
- Help
- Help information for a key binding.
- HelpModel
- A help view widget for displaying key bindings.
- HelpStyles
- Styles for the help view.
- HighlightInfo
- Describes a text highlight region within the viewport.
- HorizontalTableComponent
- A horizontal table component (row-as-headers style).
- InlineElement
- One typed span in a document.
- InlineElementStore
- Owns a document's live elements: ids, hit-testing, and offset tracking.
- ItemDelegate
- Item delegate for rendering list items.
- KeyBinding
- A key binding that maps keys to actions with optional help text.
- KeyMap
- A collection of key bindings forming a key map.
- KeyValue
- A key-value pair component with dot fill.
- LineInfo
- LinkComponent
- LinkGroupComponent
- ListEnumerator
- Defines how list items are explicitly enumerated.
- ListItem
- Item interface for list items.
- ListKeyMap
- Key map for list navigation.
- ListModel
- List model for interactive lists.
- ListStyles
- Styles for list rendering.
- Markdown
- A component that renders markdown to ANSI-styled terminal output.
- MarkdownOptions
- Configuration options for the Markdown component.
- MediaAttachment
- One attached media item bound to an inline element id.
- MediaViewerState
- State for a modal media viewer.
- MemoryEditorDocumentStore
- In-memory EditorDocumentStore for tests, examples, and recovery drills.
- ModalChrome
- Pure-data modal chrome. Stored by the caller alongside domain state.
- MultiProgressModel
- A model for managing multiple progress bars simultaneously.
- MultiSearchKeyMap
- Key bindings for the multi-search component.
-
MultiSearchModel<
T> - A multi-select search/filter component.
-
MultiSearchSelectionMadeMsg<
T> - Message sent when multiple search results are selected.
-
MultiSelectionMadeMsg<
T> - Message sent when multiple items are selected.
- MultiSelectKeyMap
- Key bindings for the multi-select component.
-
MultiSelectModel<
T> - A multi-select component following the Model architecture.
- MultiSelectStep
- Multi-select wizard step.
- MultiSelectStyles
- Styles for the multi-select component.
- NumberCancelledMsg
- Emitted when the user cancels the prompt.
- NumberedList
- A numbered list component.
- NumberInputKeyMap
- Key bindings for NumberInputModel.
- NumberInputModel
- Interactive numeric input component.
- NumberInputStyles
- Visual styles for NumberInputModel.
- NumberSubmittedMsg
- Emitted when the user submits a valid number.
- PaginatorKeyMap
- Key bindings for paginator navigation.
- PaginatorModel
- A paginator widget for handling pagination state and rendering.
- Panel
- A fluent builder for creating styled panels.
- PanelBoxChars
- Box drawing characters for panels and borders.
- PanelBoxCharSet
- A set of box drawing characters.
- PanelComponent
- A boxed panel component with optional title.
- ParsedSnippet
- A parsed snippet: expanded text plus tabstops in document coordinates.
- PasswordCancelledMsg
- Message sent when password input is cancelled.
- PasswordConfirmModel
- A password confirmation component that asks for password twice.
- PasswordKeyMap
- Key bindings for the password component.
- PasswordModel
- A password input component following the Model architecture.
- PasswordStep
- Password input wizard step.
- PasswordStyles
- Styles for the password component.
- PasswordSubmittedMsg
- Message sent when password input is submitted.
- PasteErrorMsg
- Message for paste errors.
- PasteMsg
- Message for paste events.
- PauseModel
- A simple "press any key" pause model.
- PlaceholderTracker
- Tracks placeholder ranges across document edits.
- ProgressBar
- A progress indicator component.
- ProgressBarAdvanceMsg
- ProgressBarComponent TUI
- A progress bar component.
- ProgressBarIterateDoneMsg
- ProgressBarIterateErrorMsg
- ProgressBarModel
- A UV-safe progress bar model that can be hosted inside a parent Model.
- ProgressBarMsg
- ProgressBarSetMsg
- ProgressFrameMsg
- Message indicating a progress bar animation frame should advance.
- ProgressModel
- A progress bar widget with optional animation support.
- Rank
- Rank from filtering.
- RenderConfig TUI
- Rendering configuration for display-only UI building blocks.
- RowComponent
- A component that renders children horizontally with a separator.
- Rule
- A horizontal rule/separator component.
- SanitizerOptions
- Options for configuring the sanitizer behavior.
- ScrollbarChars
- SearchCancelledMsg
- Message sent when search is cancelled.
- SearchKeyMap
- Key bindings for the search component.
-
SearchModel<
T> - A search/filter component following the Model architecture.
-
SearchSelectionMadeMsg<
T> - Message sent when a search result is selected.
- SearchStyles
- Styles for the search component.
- SelectionCancelledMsg
- Message sent when selection is cancelled.
-
SelectionMadeMsg<
T> - Message sent when an item is selected.
- SelectKeyMap
- Key bindings for the select component.
-
SelectModel<
T> - A single-select component following the Model architecture.
- SelectStep
- Single-select wizard step.
- SelectStyles
- Styles for the select component.
- SequenceDiagramModel
- A TUI bubble that renders a Mermaid sequence diagram.
- SimpleExceptionComponent
- A simple one-line exception component.
- SnippetSession
- Ordered tabstop navigation over a ParsedSnippet.
- SnippetTabstop
-
Snippet parsing (
${1:default},$1,$0) with tabstop sessions. - Spinner
- A spinner animation definition.
- SpinnerFrame
- A spinner frame component (for use in animations).
- SpinnerModel
- A spinner widget for showing loading/activity states.
- Spinners
- Pre-defined spinner animations.
- SpinnerTickMsg
- Message indicating a spinner should advance to the next frame.
- StatusMessageTimeoutMsg
- Status message timeout message.
- StopwatchModel
- A stopwatch model that counts up from zero.
- StopwatchResetMsg
- Message sent to reset the stopwatch.
- StopwatchStartStopMsg
- Message sent to start or stop the stopwatch.
- StopwatchTickMsg
- Message sent when the stopwatch ticks.
- StringItem
- Simple string item implementation.
- StyledBlock
- A fluent builder for creating styled blocks (Symfony-style).
- StyledBlockComponent
- A styled block component (Symfony-style).
- StyledText
- A styled text component using the context's style.
- SuggestCancelledMsg
- Emitted when the user cancels the suggest prompt.
- SuggestKeyMap
- Key bindings for SuggestModel.
- SuggestModel
- Interactive text-input with a scrollable prefix-matched suggestion dropdown.
- SuggestStyles
- Visual styles for SuggestModel.
- SuggestSubmittedMsg
- Emitted when the user accepts a value (typed or from the dropdown).
- SyntaxTreeEdit
- An incremental edit applied to a previous tree snapshot.
- SyntaxTreeProvider
- Backend interface for incremental syntax trees.
- Table
- A fluent builder for creating styled tables.
- TableComponent
- A table component with headers and rows.
- TableKeyMap
- Key map for table navigation.
- TableModel
- Table model for interactive tables.
- TableStyles
- Styles for table rendering.
- TableTheme
- A composable table theme with blend-aware effects and presets.
- TableThemeEffect
- A composable style rule for table cells.
- TaskComponent
- A task status component (Laravel-style).
- Text
- A simple text component.
- TextAreaCodeActionsErrorMsg
- TextAreaCodeActionsMsg
- TextAreaCompletionErrorMsg
- Delivers a completion provider failure to TextAreaModel.
- TextAreaCompletionMsg
- Delivers an asynchronous completion result to TextAreaModel.
- TextAreaCursorStyle
- TextAreaKeyMap
- TextAreaModel
- TextAreaPasteErrorMsg
- TextAreaPasteMsg
- TextAreaStyles
- TextAreaStyleState
- TextCommandResult
- TextCursorCommandResult
- TextDecorationRange
- TextDiagnosticRange
- TextDocument
- TextDocumentChange
- TextDocumentEditResult
- TextEditResult
- TextExtmark
- TextExtmarkOptions
- TextExtmarkPositionRange
- TextExtmarksController
- TextHighlightRange
- TextHitResult
- TextInputCursorStyle
- Style for the cursor.
- TextInputKeyMap
- Key map for text input navigation and editing.
- TextInputModel
- Text input model for single-line or multi-line text entry.
- TextInputStep
- Text input wizard step.
- TextInputStyles
- Styles for the text input.
- TextInputStyleState
- Style state for focused and blurred states.
- TextLineCommandResult
- TextLineDecoration
- TextLineStateSnapshot
- TextModel
- A high-level text component that supports selection, scrolling, and wrapping. It is built on top of ViewportModel but defaults to auto-height and soft-wrap.
- TextOffsetStateSnapshot
- TextPasteChunk
- TextPasteChunkStep
- TextPasteController
- TextPastePlan
- TextPasteReference
- TextPasteReferenceStore
- TextPasteSession
- TextPatternDiagnosticRule
- TextPosition
- TextPositionDiagnosticRange
- TextSearchMatch
- One match in document coordinates.
- TextSearchQuery
- Regex-capable find/replace over a TextDocument.
- TextSearchResult
- Result of findTextSearchMatches.
- TextSearchSession
- Stateful find-next/previous cursor over a match list.
- TextSelection
- TextSelectionRange
- Multi-selection sets for multi-cursor editing flows.
- TextSelectionSet
- Sorted, non-overlapping selection ranges with a primary index.
-
TextSyntaxBuildResult<
State> - TextSyntaxChangeWindow
- TextSyntaxDecorationPatch
- TextSyntaxLineWindow
-
TextSyntaxProvider<
State> -
TextSyntaxSession<
State> -
TextSyntaxSnapshot<
State> - TextUtf8CoordinateIndex
- Reusable UTF-8/grapheme coordinate index for a document snapshot.
- TextUtf8Point
- A zero-based UTF-8 row and byte-column pair.
- TextView
- TextViewLine
- TextViewport
- TextVisualCursorPosition
- TimerModel
- A countdown timer model.
- TimerStartStopMsg
- Message sent to start or stop the timer.
- TimerTickMsg
- Message sent when the timer ticks.
- TimerTimeoutMsg
- Internal message sent when timer times out.
- TitledBlockComponent
- A simple titled block used by the artisanal-style I/O facade.
- TrackedPlaceholderRange
- Tracked placeholder ranges for prompt composers.
- Tree
- A fluent builder for creating styled trees (lipgloss v2 parity).
- TreeChildren
- TreeComponent
- A tree structure component.
- TreeEnumerator
- Defines the characters used to draw tree branches.
- TreeFilter
-
TreeItem<
T> - An immutable item in an interactive TreeModel.
-
TreeItemActivatedMsg<
T> - Message emitted when the selected tree item is activated.
- TreeKeyMap
- Keyboard bindings for TreeModel.
-
TreeModel<
T> TUI - Shared state and interaction policy for hierarchical tree views.
- TreeNode
- TreeNodeChildren
-
TreeRow<
T> - One projected row in an interactive tree.
- TreeStringData
- TreeStyles
- Styles used by TreeModel.view.
- TwoColumnDetail
- A fluent builder for creating two-column detail rows.
- TwoColumnDetailComponent
- A two-column detail component with dot fill.
- TwoColumnDetailList
- A fluent builder for creating multiple two-column detail rows.
-
UndoableCommand<
State> - A command that knows how to apply and undo its own effect on a mutable state.
- UndoCommandJournalEntry
- Journal envelope for one command or transaction.
-
UndoManager<
State> - Undo/redo command journal with optional transactional grouping.
- ViewportKeyMap
- Key bindings for viewport navigation.
- ViewportModel
- A viewport widget for scrollable content.
- ViewportScrollPane
- ViewState
- Stores the view state when navigating into directories.
- WizardCancelledMsg
- Message sent when the wizard is cancelled.
- WizardCompletedMsg
- Message sent when the entire wizard is completed.
- WizardModel
- Wizard model for multi-step forms.
- WizardStep
- Base class for wizard steps.
- WizardStepCompletedMsg
- Message sent when a wizard step is completed.
- WorkspaceEdit
- Named file edits applied together.
Enums
- AlertDisplayStyle
- Alert display style.
- AlertType
- Alert types.
- AttachmentPreviewStatus
- Media attachment lifecycle for prompt composers.
- BlockStyleType
- Block style types.
- BorderStyle
- Border styles for boxes.
- BoxAlign
- Alignment for box content.
- ConfirmDisplayMode
- Display mode for the confirm component.
- CursorMode
- Cursor display mode.
- DebugOverlayMode
- Which sections the debug overlay displays.
- DiffCommentKind
- The kind of diff line represented by a DiffCommentAnchor.
- DiffCommentLineHighlightKind
- The visual role of a commentable diff line.
- DiffCommentSide
- Which side of a pull-request diff a commentable line belongs to.
- DiffLineType
- The type of a parsed diff line.
- DiffViewMode
- The display mode for the diff viewer.
- EchoMode
- Echo mode for text input display.
- EditorCommandDispatchResult
- Result of dispatching a command through EditorCommandRegistry.
- EditorCompletionKind
- Broad category used to decorate and rank a completion.
- EditorDocumentScale
- Coarse document-size class used to choose bounded editor strategies.
- FilterState
- Filter state for the list.
- FoldKind
- Code folding: indent-based ranges plus collapse state.
- MediaAffordance
- What the composer may do with an attachment right now.
- PaginationType
- Pagination rendering type.
- PanelAlignment
- Alignment for panel content.
- PasswordEchoMode
- Echo mode for password display.
- StyledBlockDisplayStyle
- Display style for styled blocks.
- TableAlign
- Column alignment options for tables.
- TableBlendMode
- Blend mode used by themed table effects.
- TableThemeGradientAxis
- The axis for sampling gradient colors in a table theme.
- TableThemeSection
- The table section an effect should apply to.
- TaskStatus
- Task status values.
- TextDecorationLayerKey
- TextDiagnosticSeverity
- TextPasteMode
Extensions
- AlertFactory on Alert
- Factory methods for common alert styles.
- BoxPresets on BoxBuilder
- Factory methods for common box styles.
- DefinitionListFactory on DefinitionList
- Factory methods for common definition list styles.
- KeyMatchExtension on Key
- Extension to check key matches more fluently.
- KeyMsgMatchExtension on KeyMsg
- Extension to check KeyMsg matches.
- PanelPresets on Panel
- Factory methods for common panel styles.
- StyledBlockFactory on StyledBlock
- Factory methods for common styled block styles.
- TableFactory on Table
- Factory methods for common table styles.
- TextLineStateCommandExtensions on TextLineStateSnapshot
- TextOffsetStateCommandExtensions on TextOffsetStateSnapshot
- TextOffsetStateDocumentEditingExtensions on TextOffsetStateSnapshot
- TreeFactory on Tree
- Factory methods for common tree styles.
- TwoColumnDetailFactory on TwoColumnDetail
- Factory methods for common two-column detail styles.
Constants
-
bracketClosings
→ const Map<
String, String> - Closing brackets understood by the matcher.
-
bracketOpenings
→ const Map<
String, String> - Structural bracket matching over a TextDocument.
- dataTablePromptOptions → const ProgramOptions
- Dedicated defaults for interactive data-table prompts.
-
defaultCodeAutoPairs
→ const Map<
String, String> -
defaultCodeClosingToOpening
→ const Map<
String, String> - defaultEmptyCharBlock → const String
- Default character used to fill the empty portion of the progress bar.
- defaultFullCharFullBlock → const String
- Default character used to fill the progress bar (full block).
- defaultFullCharHalfBlock → const String
- Default character used to fill the progress bar. It is a half block, which allows more granular color blending control.
- inlineElementFileRef → const String
- inlineElementImage → const String
- Typed inline elements (chips) anchored to document ranges.
- inlineElementPaste → const String
- promptProgramOptions → const ProgramOptions
- Shared defaults for "artisanal-style" prompts that run a single bubble and return a value.
- textActiveLineDecorationKey → const String
- textActiveLineDecorationLayerKey → const String
- textActiveLineDecorationLayerPriority → const int
- textActiveLineNumberDecorationKey → const String
- textareaPromptOptions → const ProgramOptions
- textDefaultDecorationLayerKey → const String
- textDefaultDecorationLayerPriority → const int
- textDefaultExtmarkType → const String
- textDefaultLineDecorationLayerKey → const String
- textDefaultLineDecorationLayerPriority → const int
- textDiagnosticErrorDecorationKey → const String
- textDiagnosticErrorLineDecorationKey → const String
- textDiagnosticErrorLineNumberDecorationKey → const String
- textDiagnosticHintDecorationKey → const String
- textDiagnosticHintLineDecorationKey → const String
- textDiagnosticHintLineNumberDecorationKey → const String
- textDiagnosticInfoDecorationKey → const String
- textDiagnosticInfoLineDecorationKey → const String
- textDiagnosticInfoLineNumberDecorationKey → const String
- textDiagnosticsDecorationLayerKey → const String
- textDiagnosticsDecorationLayerPriority → const int
- textDiagnosticsLineDecorationLayerKey → const String
- textDiagnosticsLineDecorationLayerPriority → const int
- textDiagnosticWarningDecorationKey → const String
- textDiagnosticWarningLineDecorationKey → const String
- textDiagnosticWarningLineNumberDecorationKey → const String
- textSearchActiveMatchDecorationKey → const String
- textSearchDecorationLayerKey → const String
- textSearchDecorationLayerPriority → const int
- textSearchMatchDecorationKey → const String
- textSyntaxDecorationLayerKey → const String
- textSyntaxDecorationLayerPriority → const int
- undefined → const Object
-
Sentinel value to distinguish "not provided" from "explicitly set to null"
in ViewportModel.copyWith. This allows callers to set nullable fields to
null (e.g.,
copyWith(selectionStart: null)) rather than keeping the existing value (the default when the parameter is omitted).
Functions
-
applyFileEdits(
String filePath, String text, List< FileTextEdit> edits) → AppliedFileEdit -
Applies
editstotext, descending by offset. -
applyWorkspaceEdit(
Map< String, String> files, WorkspaceEdit edit) → Map<String, AppliedFileEdit> -
Applies
editto every file infiles(missing files count as empty). -
bracketPairRange(
TextDocument document, int offset) → ({int endOffset, int startOffset})? -
Returns the range covering a bracket pair and everything between the
brackets (end exclusive, one past the closing bracket), or
nullwhen no pair is found atoffset. -
builtinCodeLanguageProfiles(
) → List< CodeLanguageProfile> - Builtin language registrations.
-
codeBlockNewlineSuffix(
{required String beforeCursor, required String afterCursor, required String baseIndent}) → ({int consumedColumns, String text})? -
codeHandleAutoPair(
{required TextDocument document, required TextOffsetStateSnapshot state, required CodeLanguageProfile profile, required String typed}) → TextCommandResult -
codeHandleClosingDelimiterAlignment(
{required TextDocument document, required TextOffsetStateSnapshot state, required CodeLanguageProfile profile, required String typed, required int indentWidth}) → TextCommandResult -
codeHandlePairBackspace(
{required TextDocument document, required TextOffsetStateSnapshot state, required CodeLanguageProfile profile}) → TextCommandResult -
codeInsertIndentedNewline(
{required TextDocument document, required TextOffsetStateSnapshot state, required int indentWidth, String? language}) → TextCommandResult -
codeLeadingIndent(
String line) → String -
codeOutdentedIndent(
String indent, int width) → String -
codeShouldAutoPairSymmetricDelimiter(
String text, int offset, {bool hasSelection = false}) → bool -
codeShouldAutoPairSymmetricDelimiterInDocument(
TextDocument document, int offset, {bool hasSelection = false}) → bool -
codeShouldIncreaseIndentAfter(
String prefix, {String? language}) → bool -
codeShouldIncreaseIndentForAdapter(
String prefix, {EditorLanguageAdapter? adapter}) → bool - Adapter-aware indent check. Prefer this over the string-based overload: pass the resolved EditorLanguageAdapter (builtin, Tree-sitter-backed, or custom) instead of a language name.
-
codeToggleBlockComments(
{required TextDocument document, required TextOffsetStateSnapshot state, required CodeLanguageProfile profile}) → TextCommandResult -
commandPaletteVisibleWindow(
{required int itemCount, required int selectedIndex, required int viewportSize}) → CommandPaletteWindow -
Centers
selectedIndexinside a window ofviewportSizeitems. -
computeIndentFolds(
List< String> lineTexts, {int tabWidth = 4}) → List<FoldRange> -
Computes indent folds over
lineTexts. -
computeTextDocumentChange(
String previousText, String nextText) → TextDocumentChange -
computeTextDocumentChangeForDocuments(
{required TextDocument previousDocument, required TextDocument nextDocument}) → TextDocumentChange -
createSanitizer(
[SanitizerOptions? options]) → RuneSanitizer - Creates a rune sanitizer with the given options.
-
defaultFilter(
String term, List< String> targets) → List<Rank> - Default fuzzy filter implementation.
-
defaultSearchFilter<
T> (String query, List< T> items, String toString(T)) → List<FilteredSearchItem< T> > - Default fuzzy filter implementation.
-
defaultTextAreaStyles(
) → TextAreaStyles -
defaultTextInputStyles(
{bool isDark = true}) → TextInputStyles - Returns the default styles for the text input.
-
deleteAfterCursor(
List< String> graphemes, int cursorOffset) → TextEditResult -
deleteBeforeCursor(
List< String> graphemes, int cursorOffset) → TextEditResult -
deleteNext(
List< String> graphemes, {required int cursorOffset, int? selectionBaseOffset, int? selectionExtentOffset}) → TextCommandResult -
deleteNextDocumentGrapheme(
TextDocument document, int cursorOffset) → TextDocumentEditResult -
deleteNextGrapheme(
List< String> graphemes, int cursorOffset) → TextEditResult -
deleteNextOrSelection(
List< String> graphemes, {required int cursorOffset, int? selectionBaseOffset, int? selectionExtentOffset}) → TextCommandResult -
deletePrevious(
List< String> graphemes, {required int cursorOffset, int? selectionBaseOffset, int? selectionExtentOffset}) → TextCommandResult -
deletePreviousDocumentGrapheme(
TextDocument document, int cursorOffset) → TextDocumentEditResult -
deletePreviousGrapheme(
List< String> graphemes, int cursorOffset) → TextEditResult -
deletePreviousOrSelection(
List< String> graphemes, {required int cursorOffset, int? selectionBaseOffset, int? selectionExtentOffset}) → TextCommandResult -
deleteSelection(
List< String> graphemes, {int? selectionBaseOffset, int? selectionExtentOffset, required int cursorOffset}) → TextCommandResult -
deleteSurroundingPair(
List< String> graphemes, {required int cursorOffset, int? selectionBaseOffset, int? selectionExtentOffset, required Map<String, String> surroundPairs}) → TextCommandResult -
deleteToLineEnd(
List< String> graphemes, {required int cursorOffset, int? selectionBaseOffset, int? selectionExtentOffset, required int lineEndOffset}) → TextCommandResult -
deleteToLineStart(
List< String> graphemes, {required int cursorOffset, int? selectionBaseOffset, int? selectionExtentOffset, required int lineStartOffset}) → TextCommandResult -
deleteWordBackward(
List< String> graphemes, {required int cursorOffset, int? selectionBaseOffset, int? selectionExtentOffset, required GraphemePredicate isWord}) → TextCommandResult -
deleteWordBackwardRange(
List< String> graphemes, int offset, {required GraphemePredicate isWord}) → ({int end, int start}) -
deleteWordBackwardRangeFromReader(
int length, int offset, {required GraphemePredicate isWord, required GraphemeReader graphemeAt}) → ({int end, int start}) -
deleteWordForward(
List< String> graphemes, {required int cursorOffset, int? selectionBaseOffset, int? selectionExtentOffset, required GraphemePredicate isWord}) → TextCommandResult -
deleteWordForwardRange(
List< String> graphemes, int offset, {required GraphemePredicate isWord}) → ({int end, int start}) -
deleteWordForwardRangeFromReader(
int length, int offset, {required GraphemePredicate isWord, required GraphemeReader graphemeAt}) → ({int end, int start}) -
deriveInactive(
Color bright, {double factor = 0.2}) → Color - Derives the inactive color for scanner background positions.
-
deriveTrail(
Color bright, {int steps = 6}) → List< Color> - Derives a gradient of trail colors from a single bright color.
-
duplicateSelectedLinesAbove(
List< String> lines, {required TextPosition cursor, TextPosition? selectionBase, TextPosition? selectionExtent}) → TextLineCommandResult -
duplicateSelectedLinesBelow(
List< String> lines, {required TextPosition cursor, TextPosition? selectionBase, TextPosition? selectionExtent}) → TextLineCommandResult -
editorSelectionKey(
EditorSelection? selection) → String - Stable key for dismiss tracking (dismissed context stays cleared until the selection changes again).
-
editorSelectionRangeLabel(
EditorSelectionRange range) → String? -
Short
#line/#start-endlabel for a range (single-line ranges show just the line). -
expandPlaceholderRanges(
String text, List< TrackedPlaceholderRange> ranges) → String -
Splices each range's TrackedPlaceholderRange.fullText into
text. -
expandSearchReplacementTemplate(
String template, TextSearchMatch match, String matchedText) → String -
Expands
$&(whole match) and$1–$99(groups) intemplate. Unknown references expand to''.$$is an escaped dollar. -
extractPastedFilePaths(
String text) → List< String> - Extracts file-path candidates from pasted or dropped text.
-
filterEditorCompletions(
Iterable< EditorCompletionItem> items, String query) → List<EditorCompletionItem> -
Deterministically filters and sorts
itemsfor a command palette or popup. -
findMatchingBracket(
TextDocument document, int offset) → int? -
Returns the offset of the bracket matching the one at
offset. -
findTextQueryHighlights(
{required TextDocument document, required String query, bool caseSensitive = false}) → List< TextHighlightRange> -
findTextSearchMatches(
TextDocument document, TextSearchQuery query, {int? maxResults}) → TextSearchResult -
Finds
queryindocument. -
firstGraphemeCluster(
String s) → ({String first, String rest}) - Gets the first grapheme cluster from a string.
-
formatEditorSelectionContext(
EditorSelection selection) → String -
Builds the context block sent with the prompt for
selection. -
imageChipText(
int displayNumber) → String - Chip text for an attachment. Always path-free: origins appear only in hover/cursor overlays, never in the buffer.
-
insertAtCursor(
List< String> graphemes, int cursorOffset, List<String> inserted) → TextEditResult -
insertAutoPair(
List< String> graphemes, {required int cursorOffset, int? selectionBaseOffset, int? selectionExtentOffset, required List<String> opening, required List<String> closing}) → TextCommandResult -
insertIndentedNewline(
List< String> graphemes, {required int cursorOffset, int? selectionBaseOffset, int? selectionExtentOffset, required List<String> baseIndent, List<String> additionalIndent = const <String>[], List<String> trailingSuffix = const <String>[], int trailingSuffixReplaceCount = 0}) → TextCommandResult -
insertIntoDocument(
TextDocument document, int cursorOffset, List< String> inserted) → TextDocumentEditResult -
insertTextAtEachSelection(
List< String> graphemes, TextSelectionSet selections, List<String> insertion) → ({List<String> graphemes, TextSelectionSet selections}) -
Inserts
insertiongraphemes at every range inselections(ranges collapse to the insertion end). Applies descending; returns the new graphemes and set. -
insertTextIntoDocument(
TextDocument document, int cursorOffset, String inserted) → TextDocumentEditResult -
isDecodableImageBytes(
List< int> bytes) → bool -
Whether
bytesdecode as an image (magic-byte probe, not extension). -
isImagePath(
String path) → bool - File-path recognition for pasted and dropped paths.
-
keyMatches(
Key key, List< KeyBinding> bindings) → bool - Checks if a key message matches any of the given bindings.
-
keyMatchesSingle(
Key key, KeyBinding binding) → bool - Checks if a key matches a single binding.
-
lineSnapshotFromEditorState(
EditorState editorState, {required int lineCount, required int lineLength(int line), bool preserveCollapsedSelection = false}) → TextLineStateSnapshot -
lineSnapshotFromOffsets(
TextDocument document, {required int cursorOffset, int? selectionBaseOffset, int? selectionExtentOffset}) → TextLineStateSnapshot -
mapSelectionEnds(
TextSelectionSet selections, {required int mapEnd(int activeOffset, TextSelectionRange range), required bool forward, bool extend = false}) → TextSelectionSet -
Moves or extends every range's active edge through
mapEnd. -
mapSelectionRanges(
TextSelectionSet selections, {required TextSelectionRange transform(TextSelectionRange range)}) → TextSelectionSet -
Maps each range through
transformand rebuilds the set. -
matchCommandPaletteItems(
List< CommandPaletteItem> items, String query) → List<CommandPaletteMatch> -
Filters and ranks
itemsusing the established palette matching contract. -
mathMax(
int a, int b) → int -
mergeTextSyntaxDecorationPatch(
List< TextDecorationRange> previousDecorations, TextSyntaxDecorationPatch patch) → List<TextDecorationRange> -
moveCursorByCharacter(
List< String> graphemes, {required int cursorOffset, int? selectionBaseOffset, int? selectionExtentOffset, required bool forward, bool extendSelection = false, bool clearSelection = true, bool preserveCollapsedSelection = false}) → TextCursorCommandResult -
moveCursorByVisualLine(
TextDocument document, EditorState state, TextView view, {required int cursorOffset, int? selectionBaseOffset, int? selectionExtentOffset, required int lineDelta, int desiredDisplayColumn = -1, bool extendSelection = false, bool clearSelection = true, bool preserveCollapsedSelection = false}) → TextCursorCommandResult -
moveCursorByWord(
List< String> graphemes, {required int cursorOffset, int? selectionBaseOffset, int? selectionExtentOffset, required bool forward, required GraphemePredicate isWord, bool extendSelection = false, bool clearSelection = true, bool preserveCollapsedSelection = false}) → TextCursorCommandResult -
moveCursorToDocumentBoundary(
List< String> graphemes, {required int cursorOffset, int? selectionBaseOffset, int? selectionExtentOffset, required bool forward, bool extendSelection = false, bool clearSelection = true, bool preserveCollapsedSelection = false}) → TextCursorCommandResult -
moveCursorToOffset(
{required int textLength, required int cursorOffset, int? selectionBaseOffset, int? selectionExtentOffset, required int targetOffset, bool extendSelection = false, bool clearSelection = true, bool preserveCollapsedSelection = false}) → TextCursorCommandResult -
moveCursorToVisualLineBoundary(
TextDocument document, EditorState state, TextView view, {required int cursorOffset, int? selectionBaseOffset, int? selectionExtentOffset, required bool end, bool extendSelection = false, bool clearSelection = true, bool preserveCollapsedSelection = false}) → TextCursorCommandResult -
moveSelectedLines(
List< String> lines, {required TextPosition cursor, TextPosition? selectionBase, TextPosition? selectionExtent, required int direction}) → TextLineCommandResult -
moveWordBackward(
List< String> graphemes, int offset, {required GraphemePredicate isWord}) → int -
moveWordBackwardFromReader(
int length, int offset, {required GraphemePredicate isWord, required GraphemeReader graphemeAt}) → int -
moveWordForward(
List< String> graphemes, int offset, {required GraphemePredicate isWord}) → int -
moveWordForwardFromReader(
int length, int offset, {required GraphemePredicate isWord, required GraphemeReader graphemeAt}) → int -
nextTextPasteChunk(
{required int totalRunes, required int offset, required int chunkSize}) → TextPasteChunk? -
nextWordRange(
List< String> graphemes, int offset, {required GraphemePredicate isWord}) → ({int end, int start})? -
nextWordRangeFromReader(
int length, int offset, {required GraphemePredicate isWord, required GraphemeReader graphemeAt}) → ({int end, int start})? -
normalizedSelectionRange(
int? baseOffset, int? extentOffset) → ({int end, int start})? -
normalizePromptContent(
String content) → String - Prompt-composer content helpers.
-
normalizeTextDiagnostics(
Iterable< TextDiagnosticRange> diagnostics, {int? maxLength}) → List<TextDiagnosticRange> -
offsetSnapshotFromEditorState(
TextDocument document, EditorState editorState, {required int textLength, bool preserveCollapsedSelection = false}) → TextOffsetStateSnapshot -
parseSnippet(
String source) → ParsedSnippet -
Parses
sourceinto expanded text and tabstops. Never throws: malformed sequences (${x}, unterminated${1:) emit literally. -
partitionImagePaths(
Iterable< String> candidates) → ({List<String> images, List<String> other}) -
Splits
candidatesinto image paths and everything else. -
planTextPaste(
String content, {required bool collapseLargePaste, required int collapsedPasteMinChars, required int collapsedPasteMinLines, required int chunkThresholdRunes}) → TextPastePlan -
previewWorkspaceEdit(
Map< String, String> files, WorkspaceEdit edit, {int contextLines = 3}) → String -
Renders a unified-style dry-run preview of
editagainstfiles. -
previousWordRange(
List< String> graphemes, int offset, {required GraphemePredicate isWord}) → ({int end, int start})? -
previousWordRangeFromReader(
int length, int offset, {required GraphemePredicate isWord, required GraphemeReader graphemeAt}) → ({int end, int start})? -
progressIterateCmd<
T> ({required int id, required Iterable< T> items, required Future<void> onItem(T item)}) → StreamCmd<Msg> -
Produces a UV-safe StreamCmd that runs
onItemfor each element and emits progress updates for a hosted ProgressBarModel. -
reconcileExternalRecords<
V> (Map< int, V> records, Set<int> liveIds) → List<V> - Drops sidecar records whose element id is no longer live.
-
registerBuiltinEditorLanguages(
[EditorLanguageRegistry? registry]) → void -
Registers the builtin profiles on
registry(defaults to the shared registry). Safe to call multiple times. -
removeDocumentRange(
TextDocument document, {required int start, required int end, int? cursorOffset}) → TextDocumentEditResult -
removeRange(
List< String> graphemes, {required int start, required int end, int? cursorOffset}) → TextEditResult -
renderCommandPaletteBody(
{required String query, required List< CommandPaletteItem> items, required int selectedIndex, required CommandPaletteWindow window, String emptyLabel = 'No matching commands'}) → List<String> - Renders the shared query, rows, and overflow footer used by TEA hosts.
-
renderModal(
String baseView, List< String> body, {ModalChrome chrome = const ModalChrome(), required int screenW, required int screenH}) → String -
Renders
bodyas a centered bordered dialog overbaseView. -
renumberNumberedList(
List< String> lines, {required TextPosition cursor, TextPosition? selectionBase, TextPosition? selectionExtent, int startAt = 1}) → TextLineCommandResult -
replaceDocumentRange(
TextDocument document, {required int start, required int end, List< String> replacement = const <String>[], int? cursorOffset}) → TextDocumentEditResult -
replaceDocumentTextRange(
TextDocument document, {required int start, required int end, String replacement = '', int? cursorOffset}) → TextDocumentEditResult -
replaceRange(
List< String> graphemes, {required int start, required int end, List<String> replacement = const <String>[], int? cursorOffset}) → TextEditResult -
replaceSelectionOrInsert(
List< String> graphemes, {required int cursorOffset, int? selectionBaseOffset, int? selectionExtentOffset, List<String> replacement = const <String>[], bool replaceSelection = true}) → TextCommandResult -
replaceTextSearchMatches(
List< String> graphemes, List<TextSearchMatch> matches, List<String> expand(TextSearchMatch match)) → List<String> -
Replaces
matchesingraphemes(e.g.document.flattenWithNewlines()) usingexpandfor each match's replacement graphemes. -
resolveCodeLanguageProfile(
String? language) → CodeLanguageProfile -
resolveEditorSelectionRange(
TextDocument document, EditorSelectionRange range) → ({int endOffset, int startOffset}) - Resolves a wire range to clamped document offsets.
-
resolveExternalEditorExecutable(
Map< String, String> environment, {bool isWindows = false, bool allowFallback = true}) → String? - Resolves the external editor executable from environment variables.
-
resolveMediaAffordance(
{required bool protocolSupported, bool forceTextFallback = false}) → MediaAffordance -
Resolves the affordance from capability probes. Hosts read the real
probes (ultraviolet terminal capabilities);
forceTextFallbackcovers minimal/scrollback-only modes that never paint pixels. -
runAnticipatePrompt(
AnticipateModel model, Terminal terminal, {ProgramOptions? options}) → Future< String?> -
Runs an AnticipateModel and resolves to the accepted value, or
nullif cancelled. -
runConfirmPrompt(
ConfirmModel model, Terminal terminal, {ProgramOptions? options}) → Future< bool?> -
Runs a ConfirmModel and resolves to the selected value, or
nullif cancelled. -
runDataTablePrompt<
T> (DataTableModel< T> model, Terminal terminal, {ProgramOptions? options}) → Future<T?> -
Runs a DataTableModel and resolves to the selected item, or
nullif cancelled. -
runeWidth(
int rune) → int - Calculates the display width of a single rune.
-
runMultiSearchPrompt<
T> (MultiSearchModel< T> model, Terminal terminal, {ProgramOptions? options}) → Future<List< T> ?> -
Runs a MultiSearchModel and resolves to the selected items, or
nullif cancelled. -
runMultiSelectPrompt<
T> (MultiSelectModel< T> model, Terminal terminal, {ProgramOptions? options}) → Future<List< T> ?> -
Runs a MultiSelectModel and resolves to the selected items, or
nullif cancelled. -
runNumberInputPrompt(
NumberInputModel model, Terminal terminal, {ProgramOptions? options}) → Future< num?> -
Runs a NumberInputModel and resolves to the submitted number, or
nullif the user cancels. -
runPasswordConfirmPrompt(
PasswordConfirmModel model, Terminal terminal, {ProgramOptions? options}) → Future< String?> -
Runs a PasswordConfirmModel and resolves to the submitted password, or
nullif cancelled. -
runPasswordPrompt(
PasswordModel model, Terminal terminal, {ProgramOptions? options}) → Future< String?> -
Runs a PasswordModel and resolves to the submitted password, or
nullif cancelled. -
runSearchPrompt<
T> (SearchModel< T> model, Terminal terminal, {ProgramOptions? options}) → Future<T?> -
Runs a SearchModel and resolves to the selected item, or
nullif cancelled. -
runSelectPrompt<
T> (SelectModel< T> model, Terminal terminal, {ProgramOptions? options}) → Future<T?> -
Runs a SelectModel and resolves to the selected item, or
nullif cancelled. -
runSpinnerTask<
T> ({required String message, required Future< T> task(), Spinner spinner = Spinners.miniDot, required Terminal terminal, ProgramOptions? options}) → Future<T> -
Runs an animated spinner while executing
task, returning its result. -
runSuggestPrompt(
SuggestModel model, Terminal terminal, {ProgramOptions? options}) → Future< String?> -
Runs a SuggestModel and resolves to the accepted value, or
nullif the user cancels. -
runTextAreaPrompt(
TextAreaModel model, Terminal terminal, {ProgramOptions? options}) → Future< String?> -
Runs a TextAreaModel and resolves to the submitted value, or
nullif cancelled. -
runTextInputPrompt(
TextInputModel model, Terminal terminal, {ProgramOptions? options}) → Future< String?> -
Runs a TextInputModel and resolves to the submitted value, or
nullif cancelled. -
runWizardPrompt(
WizardModel model, Terminal terminal, {ProgramOptions? options}) → Future< Map< String, dynamic> ?> -
Runs a WizardModel and resolves to the final answers, or
nullif cancelled. -
skipClosingDelimiter(
List< String> graphemes, {required int cursorOffset, int? selectionBaseOffset, int? selectionExtentOffset, required List<String> closing, bool clearSelection = false}) → TextCursorCommandResult -
stringWidth(
String s) → int - Calculates the display width of a string, accounting for wide characters.
-
syncEditorStateFromLineSnapshot(
EditorState editorState, TextLineStateSnapshot snapshot, {required int lineCount, required int lineLength(int line)}) → void -
syncEditorStateFromOffsets(
TextDocument document, EditorState editorState, {required int cursorOffset, int? selectionBaseOffset, int? selectionExtentOffset}) → void -
syntaxCapturesToRanges(
Iterable< EditorSyntaxCapture> captures) → List<({int endOffset, int priority, int startOffset, String? styleKey})> - Maps EditorSyntaxCaptures to core decoration ranges.
-
syntaxTreeEditsForDocumentChange(
TextDocumentChange change) → List< SyntaxTreeEdit> - Converts a document change into the backend-neutral syntax-tree edit shape.
-
syntaxTreeEditsForReplacement(
{required int startOffset, required int oldEndOffset, required int newEndOffset}) → List< SyntaxTreeEdit> - Computes the SyntaxTreeEdit list for a single replacement.
-
textCapitalizeWords(
String text) → String -
textCleanupWhitespace(
{required List< String> lines, required TextLineStateSnapshot state, bool trimTrailingBlankLines = true}) → TextLineCommandResult -
textCleanupWhitespaceDocument(
{required TextDocument document, required TextLineStateSnapshot state, bool trimTrailingBlankLines = true}) → TextCommandResult -
textCollapsedPasteToken(
{required int lineCount}) → String -
textCountLines(
String text) → int -
textDeleteLines(
{required List< String> lines, required TextLineStateSnapshot state}) → TextLineCommandResult -
textDeleteLinesDocument(
{required TextDocument document, required TextLineStateSnapshot state}) → TextCommandResult -
textDeleteNext(
{required TextDocument document, required TextOffsetStateSnapshot state}) → TextCommandResult -
textDeletePrevious(
{required TextDocument document, required TextOffsetStateSnapshot state}) → TextCommandResult -
textDeleteSelection(
{required TextDocument document, required TextOffsetStateSnapshot state}) → TextCommandResult -
textDeleteToLineEnd(
{required TextDocument document, required TextOffsetStateSnapshot state}) → TextCommandResult -
textDeleteToLineStart(
{required TextDocument document, required TextOffsetStateSnapshot state}) → TextCommandResult -
textDeleteWordBackward(
{required TextDocument document, required TextOffsetStateSnapshot state, GraphemePredicate isWord = _isWordGrapheme}) → TextCommandResult -
textDeleteWordForward(
{required TextDocument document, required TextOffsetStateSnapshot state, GraphemePredicate isWord = _isWordGrapheme}) → TextCommandResult -
textDiagnosticAtOffset(
{required List< TextDiagnosticRange> diagnostics, required int offset}) → TextDiagnosticRange? -
textDiagnosticContainingIndex(
{required List< TextDiagnosticRange> diagnostics, required int offset}) → int? -
textDiagnosticDecorations(
Iterable< TextDiagnosticRange> diagnostics) → List<TextDecorationRange> -
textDiagnosticLineDecorations(
{required String text, required Iterable< TextDiagnosticRange> diagnostics}) → List<TextLineDecoration> -
textDiagnosticLineDecorationsForDocument(
{required TextDocument document, required Iterable< TextDiagnosticRange> diagnostics}) → List<TextLineDecoration> -
textDiagnosticLineMarker(
TextDiagnosticSeverity severity) → String -
textDiagnosticLineNumberStyleKey(
TextDiagnosticSeverity severity) → String -
textDiagnosticLineStyleKey(
TextDiagnosticSeverity severity) → String -
textDiagnosticLocationLabel(
{required String text, required TextDiagnosticRange diagnostic}) → String -
textDiagnosticLocationLabelForDocument(
{required TextDocument document, required TextDiagnosticRange diagnostic}) → String -
textDiagnosticSeverityLabel(
TextDiagnosticSeverity severity) → String -
textDiagnosticsFromPositions(
{required TextDocument document, required Iterable< TextPositionDiagnosticRange> diagnostics}) → List<TextDiagnosticRange> -
textDiagnosticStartPosition(
{required String text, required TextDiagnosticRange diagnostic}) → TextPosition -
textDiagnosticStartPositionForDocument(
{required TextDocument document, required TextDiagnosticRange diagnostic}) → TextPosition -
textDiagnosticStyleKey(
TextDiagnosticSeverity severity) → String -
textDiagnosticSummaryLabel(
{required String text, required TextDiagnosticRange diagnostic}) → String -
textDiagnosticSummaryLabelForDocument(
{required TextDocument document, required TextDiagnosticRange diagnostic}) → String -
textDuplicateSelectedLinesAbove(
{required List< String> lines, required TextLineStateSnapshot state}) → TextLineCommandResult -
textDuplicateSelectedLinesAboveDocument(
{required TextDocument document, required TextLineStateSnapshot state}) → TextCommandResult -
textDuplicateSelectedLinesBelow(
{required List< String> lines, required TextLineStateSnapshot state}) → TextLineCommandResult -
textDuplicateSelectedLinesBelowDocument(
{required TextDocument document, required TextLineStateSnapshot state}) → TextCommandResult -
textExtmarkPositionRange(
TextDocument document, TextExtmark extmark) → TextExtmarkPositionRange -
textIndentLines(
{required List< String> lines, required TextLineStateSnapshot state, int width = 2}) → TextLineCommandResult -
textIndentLinesDocument(
{required TextDocument document, required TextLineStateSnapshot state, int width = 2}) → TextCommandResult -
textInsertGraphemes(
{required TextDocument document, required TextOffsetStateSnapshot state, required List< String> graphemes, bool replaceSelection = true}) → TextCommandResult -
textInsertText(
{required TextDocument document, required TextOffsetStateSnapshot state, required String text, bool replaceSelection = true}) → TextCommandResult -
textJoinLines(
{required List< String> lines, required TextLineStateSnapshot state}) → TextLineCommandResult -
textJoinLinesDocument(
{required TextDocument document, required TextLineStateSnapshot state}) → TextCommandResult -
textMoveByCharacter(
{required TextDocument document, required TextOffsetStateSnapshot state, required bool forward, bool extendSelection = false, bool clearSelection = false}) → TextCursorCommandResult -
textMoveByWord(
{required TextDocument document, required TextOffsetStateSnapshot state, required bool forward, GraphemePredicate isWord = _isWordGrapheme, bool extendSelection = false, bool clearSelection = false}) → TextCursorCommandResult -
textMoveSelectedLines(
{required List< String> lines, required TextLineStateSnapshot state, required int direction}) → TextLineCommandResult -
textMoveSelectedLinesDocument(
{required TextDocument document, required TextLineStateSnapshot state, required int direction}) → TextCommandResult -
textMoveToDocumentBoundary(
{required TextDocument document, required TextOffsetStateSnapshot state, required bool forward, bool extendSelection = false, bool clearSelection = false}) → TextCursorCommandResult -
textOffsetForUtf8ByteOffset(
TextDocument document, int byteOffset) → int - Converts a UTF-8 byte offset from the document start into a grapheme offset.
-
textOffsetForUtf8Point(
TextDocument document, TextUtf8Point point) → int - Converts a UTF-8 parser point into a grapheme offset.
-
textOffsetOnAdjacentVisibleLine(
{required TextDocument document, required int offset, required bool below, int? preferredColumn, TextLineHiddenPredicate? isLineHidden}) → int - Resolves the next visible logical line while retaining a preferred column.
-
textOutdentLines(
{required List< String> lines, required TextLineStateSnapshot state, int width = 2}) → TextLineCommandResult -
textOutdentLinesDocument(
{required TextDocument document, required TextLineStateSnapshot state, int width = 2}) → TextCommandResult -
textPatternDiagnostics(
{required String text, required Iterable< TextPatternDiagnosticRule> rules}) → List<TextPositionDiagnosticRange> -
textPatternDiagnosticsForDocument(
{required TextDocument document, required Iterable< TextPatternDiagnosticRule> rules}) → List<TextPositionDiagnosticRange> -
textPositionForUtf8Point(
TextDocument document, TextUtf8Point point) → TextPosition - Converts a UTF-8 parser point into a grapheme-based document position.
-
textPrepareInsertedGraphemes(
List< int> runes, {required bool multiline, int? maxGraphemes}) → List<String> -
textRenumberNumberedList(
{required List< String> lines, required TextLineStateSnapshot state, int startAt = 1}) → TextLineCommandResult -
textRenumberNumberedListDocument(
{required TextDocument document, required TextLineStateSnapshot state, int startAt = 1}) → TextCommandResult -
textSanitizeRunes(
List< int> runes, {required bool multiline}) → List<int> -
textSanitizeRunesLimited(
List< int> runes, {required bool multiline, required int maxOutputCodepoints}) → List<int> -
textSearchDecorations(
Iterable< TextHighlightRange> matches, {int activeIndex = -1}) → List<TextDecorationRange> -
textSortSelectedLines(
{required List< String> lines, required TextLineStateSnapshot state, bool descending = false, bool caseSensitive = false}) → TextLineCommandResult -
textSortSelectedLinesDocument(
{required TextDocument document, required TextLineStateSnapshot state, bool descending = false, bool caseSensitive = false}) → TextCommandResult -
textSplitLine(
{required TextDocument document, required TextOffsetStateSnapshot state}) → TextCommandResult -
textSyntaxChangeWindow(
{required TextDocument previousDocument, required TextDocument nextDocument, required TextDocumentChange change, int lookBehindLines = 0, int lookAheadLines = 0}) → TextSyntaxChangeWindow -
textToggleChecklistState(
{required List< String> lines, required TextLineStateSnapshot state, String checkedMarker = 'x'}) → TextLineCommandResult -
textToggleChecklistStateDocument(
{required TextDocument document, required TextLineStateSnapshot state, String checkedMarker = 'x'}) → TextCommandResult -
textToggleHeadingPrefix(
{required List< String> lines, required TextLineStateSnapshot state, int level = 1}) → TextLineCommandResult -
textToggleHeadingPrefixDocument(
{required TextDocument document, required TextLineStateSnapshot state, int level = 1}) → TextCommandResult -
textToggleLinePrefix(
{required List< String> lines, required TextLineStateSnapshot state, required String prefix, bool addSpaceWhenNonEmpty = true, bool skipBlankLinesWhenChecking = true}) → TextLineCommandResult -
textToggleLinePrefixDocument(
{required TextDocument document, required TextLineStateSnapshot state, required String prefix, bool addSpaceWhenNonEmpty = true, bool skipBlankLinesWhenChecking = true}) → TextCommandResult -
textToggleNumberedList(
{required List< String> lines, required TextLineStateSnapshot state, int startAt = 1}) → TextLineCommandResult -
textToggleNumberedListDocument(
{required TextDocument document, required TextLineStateSnapshot state, int startAt = 1}) → TextCommandResult -
textTransformSelectionOrLine(
{required TextDocument document, required TextOffsetStateSnapshot state, required String transform(String text)}) → TextCommandResult -
textTransformWordOrAdjacent(
{required TextDocument document, required TextOffsetStateSnapshot state, required String transform(String text)}) → TextCommandResult -
textTransposeBackward(
{required TextDocument document, required TextOffsetStateSnapshot state}) → TextCommandResult -
textUnwrapSelection(
{required TextDocument document, required TextOffsetStateSnapshot state, required Map< String, String> surroundPairs}) → TextCommandResult -
textUtf8ByteOffsetForOffset(
TextDocument document, int offset) → int - Converts a grapheme offset from the document start into a UTF-8 byte offset.
-
textUtf8PointForOffset(
TextDocument document, int offset) → TextUtf8Point - Converts a grapheme offset into a zero-based UTF-8 parser point.
-
textUtf8PointForPosition(
TextDocument document, TextPosition position) → TextUtf8Point - Converts a document position into a zero-based UTF-8 parser point.
-
textWrapSelection(
{required TextDocument document, required TextOffsetStateSnapshot state, required String before, String? after}) → TextCommandResult -
toggleChecklistState(
List< String> lines, {required TextPosition cursor, TextPosition? selectionBase, TextPosition? selectionExtent, String checkedMarker = 'x'}) → TextLineCommandResult -
toggleDelimitedSegment(
List< String> graphemes, {required int cursorOffset, int? selectionBaseOffset, int? selectionExtentOffset, required int rangeStartOffset, required int rangeEndOffset, required String startDelimiter, required String endDelimiter}) → TextCommandResult -
toggleHeadingPrefix(
List< String> lines, {required TextPosition cursor, TextPosition? selectionBase, TextPosition? selectionExtent, int level = 1}) → TextLineCommandResult -
toggleLinePrefix(
List< String> lines, {required TextPosition cursor, TextPosition? selectionBase, TextPosition? selectionExtent, required String prefix, bool addSpaceWhenNonEmpty = true, bool skipBlankLinesWhenChecking = true}) → TextLineCommandResult -
toggleNumberedList(
List< String> lines, {required TextPosition cursor, TextPosition? selectionBase, TextPosition? selectionExtent, int startAt = 1}) → TextLineCommandResult -
transformSelectionOrLine(
List< String> graphemes, {required int cursorOffset, required int lineStartOffset, required int lineEndOffset, int? selectionBaseOffset, int? selectionExtentOffset, required String transform(String text)}) → TextCommandResult -
transformWordOrAdjacent(
List< String> graphemes, {required int cursorOffset, required GraphemePredicate isWord, required String transform(String text)}) → TextCommandResult -
truncate(
String s, int width, [String tail = '']) → String - Truncates a string to fit within the given width.
-
unwrapSelection(
List< String> graphemes, {required int cursorOffset, int? selectionBaseOffset, int? selectionExtentOffset, required Map<String, String> surroundPairs}) → TextCommandResult -
validateFileEdits(
String filePath, List< FileTextEdit> edits) → List<EditConflict> -
Returns the overlap conflicts in
editsforfilePath(empty = clean). -
wordRangeForTransform(
List< String> graphemes, int offset, {required GraphemePredicate isWord}) → ({int end, int start})? -
wordRangeForTransformFromReader(
int length, int offset, {required GraphemePredicate isWord, required GraphemeReader graphemeAt}) → ({int end, int start})? -
wrapSelection(
List< String> graphemes, {required int cursorOffset, int? selectionBaseOffset, int? selectionExtentOffset, required List<String> before, List<String> ? after}) → TextCommandResult
Typedefs
- AlertStyleFunc = Style? Function(String line, int lineIndex)
- Callback for alert message styling.
- BoxContentStyleFunc = Style? Function(String line, int lineIndex)
- Callback for box content styling.
- ColorFunc = Color Function(double total, double current)
-
Function that can be used to dynamically fill the progress bar.
totalis the total filled percentage, andcurrentis the current percentage that is actively being filled with a color. - CommandPaletteCallback = Cmd? Function()
- Callback invoked by a command-palette item.
- DefinitionStyleFunc = Style? Function(String term, String description, int index, bool isTerm)
- Callback for styling definition list items.
-
EditHistoryCoalescePredicate<
Action, State, Marker> = bool Function(Action action, {required State currentState, required Action? lastAction, required Marker? lastMarker}) -
EditHistoryMarkerBuilder<
Action, State, Marker> = Marker Function(Action action, State state) -
EditHistoryStateEquals<
State> = bool Function(State a, State b) -
EditorCommandArgumentHandler<
T> = bool Function(T target, Object? argument) - Executes an editor command with a host-supplied argument such as insert text.
-
EditorCommandHandler<
T> = bool Function(T target) -
Executes an editor command against
target. -
EditorCommandPredicate<
T> = bool Function(T target) - Decides whether an editor command is currently available.
- EditorRangeResolver = TextSelectionSet Function(TextDocument document, TextSelectionSet current)
- Produces a new selection set from the document and current selections.
-
FilterFunc
= List<
Rank> Function(String term, List<String> targets) - Filter function type.
- GraphemePredicate = bool Function(String grapheme)
- GraphemeReader = String? Function(int offset)
- GutterFunc = String Function(GutterContext context)
- GutterFunc can be implemented and set into ViewportModel.leftGutterFunc.
- ListStyleFunc = Style? Function(int index, String item)
- Callback for per-item styling in lists.
- PanelContentStyleFunc = Style? Function(String line, int lineIndex)
- Callback for panel content styling.
- PromptFunc = String Function(PromptInfo info)
- PromptInfo = ({int col, bool isFocused, int lineIndex, int row})
-
Row
= List<
String> - Table row (list of cell values).
-
RuneSanitizer
= List<
int> Function(List<int> runes) - Function type for sanitizing rune lists.
-
SearchFilterFunc<
T> = List< FilteredSearchItem< Function(String query, List<T> >T> items, String toString(T)) - Filter function type for search.
- StyledBlockStyleFunc = Style? Function(String line, int lineIndex)
- Callback for block content styling.
- TableStyleFunc = Style? Function(int row, int col, String data)
- Callback for per-cell styling in tables.
- TextLineHiddenPredicate = bool Function(int line)
- Reports whether a logical document line is hidden from vertical movement.
-
TreeEnumeratorFunc
= String Function(List<
TreeNode> children, int index) - TreeEnumeratorStyleFunc = Style? Function(List children, int index)
- Callback for per-item enumerator (branch character) styling in trees.
-
TreeIndenterFunc
= String Function(List<
TreeNode> children, int index) -
TreeNodeStyleFunc
= Style Function(List<
TreeNode> children, int index) - TreeStyleFunc = Style? Function(String item, int depth, bool isDirectory)
- Callback for per-item styling in trees.
- TwoColumnStyleFunc = Style? Function(String text, bool isLeft)
- Callback for styling the left or right column.
-
UndoCommandDecoder<
State> = UndoableCommand< State> Function(String type, Map<String, Object?> payload) - ValidateFunc = String? Function(String value)
- Validation function that returns an error message if input is invalid.