pub struct GenericRefactoringProvider;Expand description
Generic text-based refactoring provider for any language
Implementations§
Source§impl GenericRefactoringProvider
impl GenericRefactoringProvider
Sourcepub fn apply_text_transformation(
code: &str,
from_pattern: &str,
to_pattern: &str,
) -> Result<String>
pub fn apply_text_transformation( code: &str, from_pattern: &str, to_pattern: &str, ) -> Result<String>
Apply a simple text-based transformation
Sourcepub fn apply_rename(
code: &str,
old_name: &str,
new_name: &str,
) -> Result<String>
pub fn apply_rename( code: &str, old_name: &str, new_name: &str, ) -> Result<String>
Apply a rename transformation
Sourcepub fn count_occurrences(code: &str, pattern: &str) -> usize
pub fn count_occurrences(code: &str, pattern: &str) -> usize
Count occurrences of a pattern in code
Trait Implementations§
Source§impl Default for GenericRefactoringProvider
impl Default for GenericRefactoringProvider
Source§impl RefactoringProvider for GenericRefactoringProvider
impl RefactoringProvider for GenericRefactoringProvider
Source§fn analyze_refactoring(
&self,
_code: &str,
_language: &str,
_refactoring_type: RefactoringType,
) -> Result<RefactoringAnalysis>
fn analyze_refactoring( &self, _code: &str, _language: &str, _refactoring_type: RefactoringType, ) -> Result<RefactoringAnalysis>
Analyze a refactoring operation
Source§fn apply_refactoring(
&self,
code: &str,
_language: &str,
refactoring: &Refactoring,
) -> Result<String>
fn apply_refactoring( &self, code: &str, _language: &str, refactoring: &Refactoring, ) -> Result<String>
Apply a refactoring to code
Source§fn validate_refactoring(
&self,
original: &str,
refactored: &str,
_language: &str,
) -> Result<ValidationResult>
fn validate_refactoring( &self, original: &str, refactored: &str, _language: &str, ) -> Result<ValidationResult>
Validate refactored code
Auto Trait Implementations§
impl Freeze for GenericRefactoringProvider
impl RefUnwindSafe for GenericRefactoringProvider
impl Send for GenericRefactoringProvider
impl Sync for GenericRefactoringProvider
impl Unpin for GenericRefactoringProvider
impl UnwindSafe for GenericRefactoringProvider
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