pub struct CodeEditorHandle { /* private fields */ }Expand description
Reactive shared handle to a CodeEditor instance.
Wraps Rc<RefCell<CodeEditor>> alongside a reactive Signal<u64> revision counter so
editing, scrolling, folding, and Find & Replace trigger immediate fine-grained UI updates
without cloning the underlying B-Tree text rope.
Implementations§
Source§impl CodeEditorHandle
impl CodeEditorHandle
Sourcepub fn new(initial_text: &str, language: Language) -> Self
pub fn new(initial_text: &str, language: Language) -> Self
Creates a new standalone handle initialized with initial_text and language.
Sourcepub fn version(&self) -> u64
pub fn version(&self) -> u64
Reads the reactive revision signal (subscribes callers to editor updates).
Sourcepub fn with_editor<R>(&self, f: impl FnOnce(&CodeEditor) -> R) -> R
pub fn with_editor<R>(&self, f: impl FnOnce(&CodeEditor) -> R) -> R
Executes a read-only closure against the inner CodeEditor.
Sourcepub fn with_editor_mut<R>(&self, f: impl FnOnce(&mut CodeEditor) -> R) -> R
pub fn with_editor_mut<R>(&self, f: impl FnOnce(&mut CodeEditor) -> R) -> R
Executes a mutating closure against the inner CodeEditor and notifies subscribers.
Sourcepub fn set_language(&self, language: Language)
pub fn set_language(&self, language: Language)
Changes syntax language and re-parses the buffer.
Sourcepub fn set_theme(&self, theme: EditorTheme)
pub fn set_theme(&self, theme: EditorTheme)
Updates the active CSS-variable EditorTheme.
Sourcepub fn set_diagnostics(&self, diagnostics: Vec<EditorDiagnostic>)
pub fn set_diagnostics(&self, diagnostics: Vec<EditorDiagnostic>)
Updates external/LSP diagnostics without clobbering live syntax diagnostics.
Sourcepub fn diagnostic_counts(&self) -> DiagnosticCounts
pub fn diagnostic_counts(&self) -> DiagnosticCounts
Returns diagnostic severity counts.
Sourcepub fn open_replace(&self)
pub fn open_replace(&self)
Opens the Find & Replace bar.
Sourcepub fn unfold_all(&self)
pub fn unfold_all(&self)
Expands all folded blocks.
Sourcepub fn render_interactive(&self, options: &CodeEditorOptions) -> NodeBlueprint
pub fn render_interactive(&self, options: &CodeEditorOptions) -> NodeBlueprint
Renders the complete interactive Monaco-class NodeBlueprint using options.
Sourcepub fn render_view(&self, options: &CodeEditorOptions) -> View
pub fn render_view(&self, options: &CodeEditorOptions) -> View
Renders the interactive editor wrapped in a Strata View.