| 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 | |
| 8 | use gpui::App; |
| 9 | |
| 10 | /// Character used by masked editor modes. |
| 11 | pub(crate) const MASK_CHAR: char = '•'; |
| 12 | |
| 13 | #[path = "editor/auto_close.rs"] |
| 14 | mod auto_close; |
| 15 | mod base; |
| 16 | #[path = "base/blink_cursor.rs"] |
| 17 | pub(crate) mod blink_cursor; |
| 18 | #[path = "base/change.rs"] |
| 19 | mod change; |
| 20 | #[path = "base/cursor.rs"] |
| 21 | mod cursor; |
| 22 | #[path = "editor/decorations.rs"] |
| 23 | mod decorations; |
| 24 | #[path = "editor/diagnostics.rs"] |
| 25 | mod diagnostics; |
| 26 | #[path = "editor/display_map/mod.rs"] |
| 27 | mod display_map; |
| 28 | mod editor; |
| 29 | #[path = "base/element.rs"] |
| 30 | mod element; |
| 31 | #[path = "editor/highlighting.rs"] |
| 32 | mod highlighting; |
| 33 | #[path = "editor/indent.rs"] |
| 34 | mod indent; |
| 35 | #[path = "base/inline_tokens.rs"] |
| 36 | mod inline_tokens; |
| 37 | mod input; |
| 38 | #[path = "base/token_presentation.rs"] |
| 39 | mod token_presentation; |
| 40 | pub use inline_tokens::{InlineToken, InlineTokenError, InlineTokenSpan, InputContent}; |
| 41 | pub(crate) use token_presentation::InlineTokenPresentation; |
| 42 | pub use token_presentation::{ |
| 43 | InlineTokenClickEvent, InlineTokenClickListener, InlineTokenContext, InlineTokenHoverEvent, |
| 44 | InlineTokenHoverListener, InlineTokenRenderer, |
| 45 | }; |
| 46 | #[path = "base/kind.rs"] |
| 47 | mod kind; |
| 48 | #[path = "editor/language.rs"] |
| 49 | mod language; |
| 50 | #[path = "editor/language_config.rs"] |
| 51 | pub mod language_config; |
| 52 | #[path = "base/layout.rs"] |
| 53 | mod layout; |
| 54 | #[path = "editor/lsp/mod.rs"] |
| 55 | mod lsp; |
| 56 | #[path = "base/mask_pattern.rs"] |
| 57 | mod mask_pattern; |
| 58 | #[path = "base/mode.rs"] |
| 59 | mod mode; |
| 60 | #[path = "base/movement.rs"] |
| 61 | mod movement; |
| 62 | #[path = "base/native.rs"] |
| 63 | mod native; |
| 64 | #[path = "base/rope_ext.rs"] |
| 65 | mod rope_ext; |
| 66 | #[path = "editor/search.rs"] |
| 67 | mod search; |
| 68 | #[path = "base/selection.rs"] |
| 69 | mod selection; |
| 70 | #[path = "base/state.rs"] |
| 71 | mod state; |
| 72 | mod textarea; |
| 73 | #[path = "base/touch.rs"] |
| 74 | mod touch; |
| 75 | #[path = "base/undo_manager.rs"] |
| 76 | mod undo_manager; |
| 77 | |
| 78 | pub(crate) fn init(cx: &mut App) { |
| 79 | state::init(cx); |
| 80 | } |
| 81 | |
| 82 | pub use crate::number_input::{NumberInputEvent, NumberStep}; |
| 83 | pub use base::{InputBase, InputContextMenuCapabilities, InputStyles}; |
| 84 | pub use cursor::Selection; |
| 85 | pub use decorations::{ |
| 86 | RangeDecoration, RangeDecorationCollection, RangeDecorationStyle, TextDecoration, |
| 87 | TextDecorationCollection, |
| 88 | }; |
| 89 | pub use diagnostics::{ |
| 90 | Diagnostic, DiagnosticEntry, DiagnosticRelatedInformation, DiagnosticSet, DiagnosticSeverity, |
| 91 | DiagnosticSummary, DiagnosticTag, RelatedInformation, |
| 92 | }; |
| 93 | pub use display_map::{BufferPoint, DisplayMap, DisplayPoint, FoldRange, WrappingIndent}; |
| 94 | pub use editor::{Editor, EditorState}; |
| 95 | pub use highlighting::{ |
| 96 | DiagnosticColors, FoldIconRenderer, HighlightStyleResolver, InputEditorStyle, InputHighlighter, |
| 97 | InputHighlighterFactory, SharedHighlightStyleResolver, SyntaxContext, SyntaxContextProvider, |
| 98 | }; |
| 99 | pub use indent::TabSize; |
| 100 | pub use input::{Input, InputState}; |
| 101 | pub use kind::{ |
| 102 | DecoratedMode, EditorExtras, EditorMode, InputExtras, InputMode, InputModeKind, MultiLineMode, |
| 103 | TextareaExtras, TextareaMode, |
| 104 | }; |
| 105 | pub(crate) use language::EditorLanguage; |
| 106 | pub use language::{LanguageProvider, set_language_config, set_language_provider}; |
| 107 | pub(crate) use language_config::LanguageConfig; |
| 108 | pub use language_config::{AutoClosingPair, BracketPair, IndentationRules}; |
| 109 | pub use lsp::{ |
| 110 | CodeActionItem, CodeActionMenuState, CodeActionProvider, CompletionMenuOptions, |
| 111 | CompletionMenuState, CompletionProvider, DefinitionProvider, DocumentColorProvider, |
| 112 | DocumentRangeSemanticTokensProvider, HoverPopoverState, HoverProvider, InputOverlayKind, Lsp, |
| 113 | ShowDocumentHandler, |
| 114 | }; |
| 115 | pub use lsp_types::Position; |
| 116 | pub use mask_pattern::MaskPattern; |
| 117 | #[cfg(target_os = "macos")] |
| 118 | #[doc(hidden)] |
| 119 | pub use native::set_text_content_type; |
| 120 | pub use native::{NativeMenu, NativeMenuItem}; |
| 121 | pub use rope_ext::{InputEdit, Point, RopeExt, RopeLines}; |
| 122 | pub use ropey::Rope; |
| 123 | pub use search::{SearchMatcher, SearchSession}; |
| 124 | pub use state::*; |
| 125 | pub use textarea::{Textarea, TextareaState}; |