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, InlineTokenRenderer,
44};
45#[path = "base/kind.rs"]
46mod kind;
47#[path = "editor/language.rs"]
48mod language;
49#[path = "editor/language_config.rs"]
50pub mod language_config;
51#[path = "base/layout.rs"]
52mod layout;
53#[path = "editor/lsp/mod.rs"]
54mod lsp;
55#[path = "base/mask_pattern.rs"]
56mod mask_pattern;
57#[path = "base/mode.rs"]
58mod mode;
59#[path = "base/movement.rs"]
60mod movement;
61#[path = "base/native.rs"]
62mod native;
63#[path = "base/rope_ext.rs"]
64mod rope_ext;
65#[path = "editor/search.rs"]
66mod search;
67#[path = "base/selection.rs"]
68mod selection;
69#[path = "base/state.rs"]
70mod state;
71mod textarea;
72#[path = "base/touch.rs"]
73mod touch;
74#[path = "base/undo_manager.rs"]
75mod undo_manager;
76
77pub(crate) fn init(cx: &mut App) {
78    state::init(cx);
79}
80
81pub use crate::number_input::{NumberInputEvent, NumberStep};
82pub use base::{InputBase, InputContextMenuCapabilities, InputStyles};
83pub use cursor::Selection;
84pub use decorations::{
85    RangeDecoration, RangeDecorationCollection, RangeDecorationStyle, TextDecoration,
86    TextDecorationCollection,
87};
88pub use diagnostics::{
89    Diagnostic, DiagnosticEntry, DiagnosticRelatedInformation, DiagnosticSet, DiagnosticSeverity,
90    DiagnosticSummary, DiagnosticTag, RelatedInformation,
91};
92pub use display_map::{BufferPoint, DisplayMap, DisplayPoint, FoldRange, WrappingIndent};
93pub use editor::{Editor, EditorState};
94pub use highlighting::{
95    DiagnosticColors, FoldIconRenderer, HighlightStyleResolver, InputEditorStyle, InputHighlighter,
96    InputHighlighterFactory, SharedHighlightStyleResolver, SyntaxContext, SyntaxContextProvider,
97};
98pub use indent::TabSize;
99pub use input::{Input, InputState};
100pub use kind::{
101    EditorExtras, EditorMode, InputExtras, InputMode, InputModeKind, MultiLineMode, TextareaMode,
102};
103pub(crate) use language::EditorLanguage;
104pub use language::{LanguageProvider, set_language_config, set_language_provider};
105pub(crate) use language_config::LanguageConfig;
106pub use language_config::{AutoClosingPair, BracketPair, IndentationRules};
107pub use lsp::{
108    CodeActionItem, CodeActionMenuState, CodeActionProvider, CompletionMenuOptions,
109    CompletionMenuState, CompletionProvider, DefinitionProvider, DocumentColorProvider,
110    DocumentRangeSemanticTokensProvider, HoverPopoverState, HoverProvider, InputOverlayKind, Lsp,
111    ShowDocumentHandler,
112};
113pub use lsp_types::Position;
114pub use mask_pattern::MaskPattern;
115#[cfg(target_os = "macos")]
116#[doc(hidden)]
117pub use native::set_text_content_type;
118pub use native::{NativeMenu, NativeMenuItem};
119pub use rope_ext::{InputEdit, Point, RopeExt, RopeLines};
120pub use ropey::Rope;
121pub use search::{SearchMatcher, SearchSession};
122pub use state::*;
123pub use textarea::{Textarea, TextareaState};