pub enum DocumentEvent {
Show 15 variants
TextInserted {
position: Position,
text: String,
length: usize,
},
TextDeleted {
range: Range,
deleted_text: String,
},
TextReplaced {
range: Range,
old_text: String,
new_text: String,
},
SelectionChanged {
old_selection: Option<Range>,
new_selection: Option<Range>,
},
CursorMoved {
old_position: Position,
new_position: Position,
},
DocumentSaved {
file_path: String,
save_as: bool,
},
DocumentLoaded {
file_path: String,
size: usize,
},
UndoPerformed {
action_description: String,
changes_count: usize,
},
RedoPerformed {
action_description: String,
changes_count: usize,
},
ValidationCompleted {
issues_count: usize,
error_count: usize,
warning_count: usize,
validation_time_ms: u64,
},
SearchCompleted {
pattern: String,
matches_count: usize,
hit_limit: bool,
search_time_us: u64,
},
ParsingCompleted {
success: bool,
sections_count: usize,
parse_time_ms: u64,
error_message: Option<String>,
},
ExtensionChanged {
extension_name: String,
loaded: bool,
},
ConfigChanged {
key: String,
old_value: Option<String>,
new_value: String,
},
CustomEvent {
event_type: String,
data: HashMap<String, String>,
},
}Expand description
Types of events that can occur in the editor
Variants§
TextInserted
Text was inserted at a position
Fields
TextDeleted
Text was deleted from a range
Fields
TextReplaced
Text was replaced in a range
Fields
SelectionChanged
Selection changed
Fields
CursorMoved
Cursor position changed
DocumentSaved
Document was saved to a file
Fields
DocumentLoaded
Document was loaded from a file
Fields
UndoPerformed
Undo operation was performed
Fields
RedoPerformed
Redo operation was performed
Fields
ValidationCompleted
Validation completed with results
Fields
SearchCompleted
Search operation completed
Fields
ParsingCompleted
Document parsing completed
Fields
ExtensionChanged
Extension was loaded or unloaded
Fields
ConfigChanged
Configuration setting changed
Fields
CustomEvent
Generic custom event for extensions
Implementations§
Source§impl DocumentEvent
impl DocumentEvent
Sourcepub fn description(&self) -> String
pub fn description(&self) -> String
Get a human-readable description of the event
Sourcepub fn is_modification(&self) -> bool
pub fn is_modification(&self) -> bool
Check if this event represents a document modification
Sourcepub fn affects_text(&self) -> bool
pub fn affects_text(&self) -> bool
Check if this event affects the document’s text content
Sourcepub fn affected_range(&self) -> Option<Range>
pub fn affected_range(&self) -> Option<Range>
Get the affected range for events that modify text
Source§impl DocumentEvent
Convenience functions for creating common events
impl DocumentEvent
Convenience functions for creating common events
Sourcepub fn text_inserted(position: Position, text: String) -> Self
pub fn text_inserted(position: Position, text: String) -> Self
Create a text insertion event
Sourcepub fn text_deleted(range: Range, deleted_text: String) -> Self
pub fn text_deleted(range: Range, deleted_text: String) -> Self
Create a text deletion event
Sourcepub fn text_replaced(range: Range, old_text: String, new_text: String) -> Self
pub fn text_replaced(range: Range, old_text: String, new_text: String) -> Self
Create a text replacement event
Sourcepub fn cursor_moved(old_position: Position, new_position: Position) -> Self
pub fn cursor_moved(old_position: Position, new_position: Position) -> Self
Create a cursor moved event
Sourcepub fn document_saved(file_path: String, save_as: bool) -> Self
pub fn document_saved(file_path: String, save_as: bool) -> Self
Create a document saved event
Trait Implementations§
Source§impl Clone for DocumentEvent
impl Clone for DocumentEvent
Source§fn clone(&self) -> DocumentEvent
fn clone(&self) -> DocumentEvent
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more