Skip to main content

gpui_base/input/
mod.rs

1//! Text input: the shared editing engine and the three states built on it.
2//!
3//! Nothing here should be `pub` unless it is reachable from outside the crate.
4//! A `pub` on an item behind a private module says something the module path
5//! contradicts, and it hides the real API surface from anyone reading it.
6#![warn(unreachable_pub)]
7
8use gpui::App;
9
10/// Character used by masked editor modes.
11pub(crate) const MASK_CHAR: char = '•';
12
13#[path = "editor/auto_close.rs"]
14mod auto_close;
15mod base;
16#[path = "base/blink_cursor.rs"]
17pub(crate) mod blink_cursor;
18#[path = "base/change.rs"]
19mod change;
20#[path = "base/cursor.rs"]
21mod cursor;
22#[path = "editor/decorations.rs"]
23mod decorations;
24#[path = "editor/diagnostics.rs"]
25mod diagnostics;
26#[path = "editor/display_map/mod.rs"]
27mod display_map;
28mod editor;
29#[path = "base/element.rs"]
30mod element;
31#[path = "editor/highlighting.rs"]
32mod highlighting;
33#[path = "editor/indent.rs"]
34mod indent;
35#[path = "base/inline_tokens.rs"]
36mod inline_tokens;
37mod input;
38#[path = "base/token_presentation.rs"]
39mod token_presentation;
40pub use inline_tokens::{InlineToken, InlineTokenError, InlineTokenSpan, InputContent};
41pub(crate) use token_presentation::InlineTokenPresentation;
42pub use token_presentation::{
43    InlineTokenClickEvent, InlineTokenClickListener, InlineTokenContext, InlineTokenHoverEvent,
44    InlineTokenHoverListener, InlineTokenRenderer,
45};
46#[path = "base/a11y_text.rs"]
47pub(crate) mod a11y_text;
48#[path = "base/kind.rs"]
49mod kind;
50#[path = "editor/language.rs"]
51mod language;
52#[path = "editor/language_config.rs"]
53pub mod language_config;
54#[path = "base/layout.rs"]
55mod layout;
56#[path = "editor/lsp/mod.rs"]
57mod lsp;
58#[path = "base/mask_pattern.rs"]
59mod mask_pattern;
60#[path = "base/mode.rs"]
61mod mode;
62#[path = "base/movement.rs"]
63mod movement;
64#[path = "base/native.rs"]
65mod native;
66#[path = "base/rope_ext.rs"]
67mod rope_ext;
68mod scrollbar_presentation;
69#[path = "editor/search.rs"]
70mod search;
71#[path = "base/selection.rs"]
72mod selection;
73#[path = "base/state.rs"]
74mod state;
75#[path = "base/tab_stops.rs"]
76mod tab_stops;
77mod textarea;
78pub use scrollbar_presentation::{EditorScrollbarContext, EditorScrollbarRenderer};
79#[path = "base/touch.rs"]
80mod touch;
81#[path = "base/undo_manager.rs"]
82mod undo_manager;
83
84pub(crate) fn init(cx: &mut App) {
85    state::init(cx);
86}
87
88pub use crate::number_input::{NumberInputEvent, NumberStep};
89pub use base::{InputBase, InputContextMenuCapabilities, InputStyles};
90pub use blink_cursor::CursorBlink;
91pub use cursor::Selection;
92pub use decorations::{
93    GutterDecoration, GutterDecorationCollection, OverviewRulerDecoration,
94    OverviewRulerDecorationCollection, OverviewRulerLane, RangeDecoration,
95    RangeDecorationCollection, RangeDecorationStyle, TextDecoration, TextDecorationCollection,
96};
97pub use diagnostics::{
98    Diagnostic, DiagnosticEntry, DiagnosticRelatedInformation, DiagnosticSet, DiagnosticSeverity,
99    DiagnosticSummary, DiagnosticTag, RelatedInformation,
100};
101pub use display_map::{BufferPoint, DisplayMap, DisplayPoint, FoldRange, WrappingIndent};
102pub use editor::{Editor, EditorLineNumberRenderer, EditorState};
103pub use highlighting::{
104    DiagnosticColors, FoldIconRenderer, FoldPlaceholderRenderer, HighlightStyleResolver,
105    InputEditorStyle, InputHighlighter, InputHighlighterFactory, SharedHighlightStyleResolver,
106    SyntaxContext, SyntaxContextProvider,
107};
108pub use indent::TabSize;
109pub use input::{Input, InputState};
110pub use kind::{
111    EditorExtras, EditorMode, InputExtras, InputMode, InputModeKind, MultiLineMode, TextareaExtras,
112    TextareaMode,
113};
114pub(crate) use language::EditorLanguage;
115pub use language::{LanguageProvider, set_language_config, set_language_provider};
116pub(crate) use language_config::LanguageConfig;
117pub use language_config::{AutoClosingPair, BracketPair, IndentationRules};
118pub use lsp::{
119    CodeActionItem, CodeActionMenuState, CodeActionProvider, CompletionHighlighter,
120    CompletionMenuOptions, CompletionMenuState, CompletionProvider, DefinitionProvider,
121    DocumentColorProvider, DocumentRangeSemanticTokensProvider, HoverPopoverState, HoverProvider,
122    InputOverlayKind, Lsp, ShowDocumentHandler, highlight_characters, highlight_contains,
123    highlight_prefix,
124};
125pub use lsp_types::Position;
126pub use mask_pattern::MaskPattern;
127#[cfg(target_os = "macos")]
128#[doc(hidden)]
129pub use native::set_text_content_type;
130pub use native::{NativeMenu, NativeMenuItem};
131pub use rope_ext::{InputEdit, Point, RopeExt, RopeLines};
132pub use ropey::Rope;
133pub use search::{SearchMatcher, SearchSession};
134pub use state::*;
135pub use textarea::{Textarea, TextareaState};