Expand description
Text input: the shared editing engine and the three states built on it.
Nothing here should be pub unless it is reachable from outside the crate.
A pub on an item behind a private module says something the module path
contradicts, and it hides the real API surface from anyone reading it.
Re-exports§
pub use token_presentation::InlineTokenClickEvent;pub use token_presentation::InlineTokenContext;pub use token_presentation::InlineTokenHoverEvent;pub use language_config::AutoClosingPair;pub use language_config::BracketPair;pub use language_config::IndentationRules;
Modules§
- language_
config - Language-specific bracket pairing and indentation rules.
Structs§
- Activate
Token - AddCursor
Above - AddCursor
Below - Backspace
- Buffer
Point - Position in the buffer (logical text).
- Code
Action Item - Code
Action Menu State - Completion
Menu Options - Display options for the LSP completion popover.
- Completion
Menu State - Copy
- Cut
- Delete
- Delete
ToBeginning OfLine - Delete
ToEnd OfLine - Delete
ToNext Word End - Delete
ToPrevious Word Start - Diagnostic
- Diagnostic
Colors - Diagnostic
Entry - Diagnostic
Set - Diagnostic
Summary - Display
Map - DisplayMap is the main interface for Editor/Input coordinate mapping.
- Display
Point - Final display position (after soft-wrapping and folding).
- Editor
- An unstyled source-code editor.
- Editor
Extras - What a code editor adds on top of multi-line text: language features.
- Editor
Mode - Source code, with language features: the mode of
crate::input::EditorState. - Editor
Scrollbar Context - Current-frame editor geometry and its retained scroll offset.
The editor applies caret scrolling before invoking the presentation callback.
Like other
ScrollbarHandleimplementations, the content size includes the viewport’s padding, so subtracting the track size gives the scroll range. - Enter
- Escape
- Fold
Range - A foldable line range supplied by an editor highlighter or another source.
- GoTo
Definition - Hover
Popover State - Indent
- Indent
Inline - Inline
Token - An application-defined reference rendered as one inline editing unit. The ID names the referenced resource; the same ID may occur more than once.
- Inline
Token Click Event - Current token snapshot delivered after releasing the editor’s update borrow.
- Inline
Token Context - Read-only context for a single inline renderer. Width is the full available row.
- Inline
Token Hover Event - Hover snapshot for one atomic inline token. Hover never selects or edits; it reports pointer presence so the application can show a tooltip or run custom logic.
- Inline
Token Span - A token and its current half-open UTF-8 byte range.
- Input
- An unstyled single-line text input.
- Input
Accessibility - Accessibility presentation for the editor’s existing keyboard-focus boundary.
- Input
Base - The foundational input frame.
- Input
Base State - The shared text-editing engine behind
crate::input::InputState,crate::input::TextareaStateandcrate::input::EditorState. - Input
Content - An owned, coherent text-and-token snapshot: what
content()returns and whatset_valueaccepts. Plain text converts into content without tokens, and every token is validated against the text as it is attached, so a content value is always consistent. - Input
Context Menu Capabilities - What the input can offer to its context menu, at the moment it is opened.
- Input
Edit - Parser-independent description of an incremental text replacement.
- Input
Editor Style - Application-owned colors and highlight resolver consumed by editor painting.
- Input
Mode - A single-line text field: the mode of
crate::input::InputState. - Input
Presentation - Read-only styling data exposed to presentation facades.
- Input
Styles - Lsp
- LSP ServerCapabilities
- Move
Down - MoveEnd
- Move
Home - Move
Left - Move
Page Down - Move
Page Up - Move
Right - Move
ToEnd - Move
ToEnd OfLine - Move
ToNext Word - Move
ToPrevious Word - Move
ToStart - Move
ToStart OfLine - MoveUp
- Native
Menu - Presentation-independent context-menu model produced by the editor.
- Outdent
- Outdent
Inline - Paste
- Point
- Parser-independent byte/row/column position used for incremental edits.
- Position
- Position in a text document expressed as zero-based line and character offset. A position is between two characters like an ‘insert’ cursor in a editor.
- Range
Decoration - A geometric decoration over a UTF-8 byte range.
- Range
Decoration Collection - An independently managed collection of geometric range decorations.
- Redo
- Replace
- Rope
- A utf8 text rope.
- Rope
Lines - An iterator over the lines of a
Rope. - Search
- Search
Matcher - Stateful, presentation-independent search engine used by text inputs.
- Search
Session - One search over an input: the query, how the built-in panel shows it, and
its matches. Read it through
InputBaseState::search_session; it is written only through the input state’s search methods, and it grows, so build it withDefaultand do not destructure it exhaustively. - Select
All - Select
ToEnd - Select
ToEnd OfLine - Select
ToNext Word End - Select
ToPrevious Word Start - Select
ToStart - Select
ToStart OfLine - Selection
- A selection in the text, represented by start and end byte indices.
- Show
Character Palette - Show
Completions - TabSize
- Text
Decoration - A presentation style applied to a UTF-8 byte range in an input.
- Text
Decoration Collection - An independently managed collection of
TextDecorations. - Textarea
- An unstyled ordinary multi-line text input.
- Textarea
Mode - Ordinary multi-line text: the mode of
crate::input::TextareaState. - Toggle
Code Actions - Undo
Enums§
- Diagnostic
Severity - Inline
Token Error - A rejected token operation never partially changes the document.
- Input
Event - Input
Overlay Kind - Mask
Pattern - Native
Menu Item - Number
Input Event - Number
Step - Strategy used by numeric editors when stepping their value.
- Range
Decoration Style - Geometric presentation for an editor range decoration.
- Syntax
Context - Where in the syntax tree an offset sits, for editing decisions.
- Wrapping
Indent - Controls how soft-wrapped continuation lines are indented.
Traits§
- Code
Action Provider - Completion
Provider - A trait for providing code completions based on the current input state and context.
- Definition
Provider - Definition provider
- Document
Color Provider - Document
Range Semantic Tokens Provider - A provider of semantic highlighting tokens, layered on top of the
built-in tree-sitter
SyntaxHighlighter. - Highlight
Style Resolver - Resolves semantic highlight names into renderable GPUI styles.
- Hover
Provider - Hover provider
- Input
Extras - What the renderer may read out of a mode’s extra state.
- Input
Highlighter - Parser-independent syntax highlighting seam consumed by the Base editor.
- Input
Mode Kind - Hooks the shared engine calls back into for mode-specific work.
- Language
Provider - Supplies language identities, editing defaults, and syntax providers to Base.
- Multi
Line Mode - The modes whose layout spans more than one line:
TextareaModeandEditorMode. - RopeExt
- An extension trait for
Ropeto provide additional utility methods. - Syntax
Context Provider - Answers syntax context for editing decisions (pairing, skip, indent).
Functions§
- highlight_
characters - Highlight each character of
queryin order, skipping characters in between. - highlight_
contains - Highlight the first case-insensitive occurrence of
queryin the label. - highlight_
prefix - Highlight a prefix of the completion label, matching today’s menu.
- set_
language_ config - Replace a language’s editing configuration for this application.
Existing editors read the replacement on their next edit. Aliases follow the
installed language provider; Base alone treats names case-insensitively.
This does not change
auto_closeorsmart_indentpreferences. - set_
language_ provider - Install the application’s language service. Existing editors use the new service on their next editing operation, without waiting for a render. Registered configurations are retained and resolved through the new service.
Type Aliases§
- Completion
Highlighter - Decides which bytes of a completion label the menu paints as the match.
- Diagnostic
Related Information - Diagnostic
Tag - Editor
Scrollbar Renderer - Supply a scrollbar from the consuming UI library. None retains Base’s default.
- Editor
State - State for source-code editing.
- Fold
Icon Renderer - Input
Highlighter Factory - Input
State - State for a single-line text input.
- Related
Information - Shared
Highlight Style Resolver - Show
Document Handler - Host hook to show a document when following an LSP location
(Go to Definition), modeled after the
window/showDocumentrequest. - Textarea
State - State for editing ordinary multi-line text.