Skip to main content

gpui_deck/input/
mod.rs

1// Modified for GPUI Deck: expose Input while retaining its shared editing engine.
2//! Text input: the shared editing engine and the three states built on it.
3//!
4//! Nothing here should be `pub` unless it is reachable from outside the crate.
5//! A `pub` on an item behind a private module says something the module path
6//! contradicts, and it hides the real API surface from anyone reading it.
7#![warn(unreachable_pub)]
8
9use gpui::App;
10
11/// Character used by masked editor modes.
12pub(crate) const MASK_CHAR: char = '•';
13
14#[path = "editor/auto_close.rs"]
15mod auto_close;
16mod base;
17#[path = "base/blink_cursor.rs"]
18pub(crate) mod blink_cursor;
19#[path = "base/change.rs"]
20mod change;
21#[path = "base/cursor.rs"]
22mod cursor;
23#[path = "editor/decorations.rs"]
24mod decorations;
25#[path = "editor/diagnostics.rs"]
26mod diagnostics;
27#[path = "editor/display_map/mod.rs"]
28mod display_map;
29mod editor;
30#[path = "base/element.rs"]
31mod element;
32#[path = "editor/highlighting.rs"]
33mod highlighting;
34#[path = "editor/indent.rs"]
35mod indent;
36#[path = "base/inline_tokens.rs"]
37mod inline_tokens;
38mod input;
39#[path = "base/token_presentation.rs"]
40mod token_presentation;
41pub use inline_tokens::{InlineToken, InlineTokenError, InlineTokenSpan, InputContent};
42pub(crate) use token_presentation::InlineTokenPresentation;
43pub use token_presentation::{
44    InlineTokenClickEvent, InlineTokenClickListener, InlineTokenContext, InlineTokenHoverEvent,
45    InlineTokenHoverListener, InlineTokenRenderer,
46};
47#[path = "base/a11y_text.rs"]
48mod a11y_text;
49#[path = "base/kind.rs"]
50mod kind;
51#[path = "editor/language.rs"]
52mod language;
53#[path = "editor/language_config.rs"]
54pub mod language_config;
55#[path = "base/layout.rs"]
56mod layout;
57#[path = "editor/lsp/mod.rs"]
58mod lsp;
59#[path = "base/mask_pattern.rs"]
60mod mask_pattern;
61#[path = "base/mode.rs"]
62mod mode;
63#[path = "base/movement.rs"]
64mod movement;
65#[path = "base/native.rs"]
66mod native;
67#[path = "base/rope_ext.rs"]
68mod rope_ext;
69mod scrollbar_presentation;
70#[path = "editor/search.rs"]
71mod search;
72#[path = "base/selection.rs"]
73mod selection;
74#[path = "base/state.rs"]
75mod state;
76#[path = "base/tab_stops.rs"]
77mod tab_stops;
78mod textarea;
79pub use scrollbar_presentation::{EditorScrollbarContext, EditorScrollbarRenderer};
80#[path = "base/touch.rs"]
81mod touch;
82#[path = "base/undo_manager.rs"]
83mod undo_manager;
84
85pub(crate) fn init(cx: &mut App) {
86    state::init(cx);
87}
88
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};
102#[cfg(test)]
103pub(crate) use editor::Editor;
104pub use editor::EditorState;
105pub use highlighting::{
106    DiagnosticColors, FoldIconRenderer, HighlightStyleResolver, InputEditorStyle, InputHighlighter,
107    InputHighlighterFactory, SharedHighlightStyleResolver, SyntaxContext, SyntaxContextProvider,
108};
109pub use indent::TabSize;
110pub use input::{Input, InputState};
111pub use kind::{
112    EditorExtras, EditorMode, InputExtras, InputMode, InputModeKind, MultiLineMode, 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};