pub struct RustEditor { /* private fields */ }Implementations§
Source§impl RustEditor
impl RustEditor
pub fn new(content: &str) -> Result<Self>
pub fn apply_operation(&mut self, op: &Operation) -> Result<ModificationResult>
pub fn span_to_byte_offset(&self, pos: LineColumn) -> usize
pub fn to_string(&self) -> String
Sourcepub fn get_syntax_tree(&self) -> &File
pub fn get_syntax_tree(&self) -> &File
Get a reference to the syntax tree (for revert operations)
Sourcepub fn replace_range(
&mut self,
start: usize,
end: usize,
new_content: &str,
) -> Result<()>
pub fn replace_range( &mut self, start: usize, end: usize, new_content: &str, ) -> Result<()>
Replace a range of bytes with new content (for revert operations)
Sourcepub fn find_field_locations(
&self,
field_name: &str,
) -> Result<Vec<FieldLocation>>
pub fn find_field_locations( &self, field_name: &str, ) -> Result<Vec<FieldLocation>>
Find all locations where a field appears in the codebase
Source§impl RustEditor
impl RustEditor
Sourcepub fn add_doc_comment_surgical(
&mut self,
target_type: &str,
target_name: &str,
doc_text: &str,
style: &DocCommentStyle,
) -> Result<ModificationResult>
pub fn add_doc_comment_surgical( &mut self, target_type: &str, target_name: &str, doc_text: &str, style: &DocCommentStyle, ) -> Result<ModificationResult>
Add a documentation comment to a target item using surgical editing
Sourcepub fn update_doc_comment_surgical(
&mut self,
target_type: &str,
target_name: &str,
doc_text: &str,
style: &DocCommentStyle,
) -> Result<ModificationResult>
pub fn update_doc_comment_surgical( &mut self, target_type: &str, target_name: &str, doc_text: &str, style: &DocCommentStyle, ) -> Result<ModificationResult>
Update an existing documentation comment on a target item using surgical editing
Sourcepub fn remove_doc_comment_surgical(
&mut self,
target_type: &str,
target_name: &str,
) -> Result<ModificationResult>
pub fn remove_doc_comment_surgical( &mut self, target_type: &str, target_name: &str, ) -> Result<ModificationResult>
Remove a documentation comment from a target item using surgical editing
Auto Trait Implementations§
impl !Send for RustEditor
impl !Sync for RustEditor
impl Freeze for RustEditor
impl RefUnwindSafe for RustEditor
impl Unpin for RustEditor
impl UnsafeUnpin for RustEditor
impl UnwindSafe for RustEditor
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more