pub enum SmartEdit {
InsertFunction {
name: String,
class_name: Option<String>,
namespace: Option<String>,
body: String,
after: Option<String>,
before: Option<String>,
visibility: String,
},
ReplaceFunction {
name: String,
class_name: Option<String>,
new_body: String,
},
AddImport {
import: String,
alias: Option<String>,
},
InsertClass {
name: String,
namespace: Option<String>,
body: String,
extends: Option<String>,
implements: Vec<String>,
},
AddMethod {
class_name: String,
method_name: String,
body: String,
visibility: String,
},
WrapCode {
start_line: usize,
end_line: usize,
wrapper_type: String,
condition: Option<String>,
},
DeleteElement {
element_type: String,
name: String,
parent: Option<String>,
},
Rename {
old_name: String,
new_name: String,
scope: String,
},
AddDocumentation {
target_type: String,
target_name: String,
documentation: String,
},
SmartAppend {
section: String,
content: String,
},
RemoveFunction {
name: String,
class_name: Option<String>,
force: bool,
cascade: bool,
},
}Expand description
Smart edit operations that use minimal tokens
Variants§
InsertFunction
Insert a function at the appropriate location
Fields
ReplaceFunction
Replace a function body (keeps signature)
AddImport
Add imports/use statements intelligently
InsertClass
Insert a class/struct
Fields
AddMethod
Add a method to a class
WrapCode
Wrap code in a construct (try-catch, if statement, etc)
DeleteElement
Delete a named element
Rename
Rename across the file
AddDocumentation
Add documentation comment
SmartAppend
Smart append - adds to the end of a logical section
RemoveFunction
Remove a function with dependency awareness
Trait Implementations§
Source§impl<'de> Deserialize<'de> for SmartEdit
impl<'de> Deserialize<'de> for SmartEdit
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for SmartEdit
impl RefUnwindSafe for SmartEdit
impl Send for SmartEdit
impl Sync for SmartEdit
impl Unpin for SmartEdit
impl UnsafeUnpin for SmartEdit
impl UnwindSafe for SmartEdit
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more