pub fn to_text_edit(&self, merge_behavior: Option<MergeBehavior>) -> Option<TextEdit> {
        let _p = profile::span("ImportEdit::to_text_edit");

        let rewriter = insert_use::insert_use(
            &self.import_scope,
            mod_path_to_ast(&self.import_path),
            merge_behavior,
        );
        let old_ast = rewriter.rewrite_root()?;
        let mut import_insert = TextEdit::builder();
        algo::diff(&old_ast, &rewriter.rewrite(&old_ast)).into_text_edit(&mut import_insert);

        Some(import_insert.finish())
    }
/// Attempts to insert the import to the given scope, producing a text edit.
/// May return no edit in edge cases, such as scope already containing the import.
Attempts to insert the import to the given scope, producing a text edit.
May return no edit in edge cases, such as scope already containing the import.
Attempts to insert the import to the given scope producing a text edit . May return no edit in edge cases such as scope already containing the import .
pub fn to_text_edit(&self, merge_behavior: Option<MergeBehavior>) -> Option<TextEdit> {
        let _p = profile::span("ImportEdit::to_text_edit");
        let rewriter = insert_use::insert_use(
            &self.import_scope,
            mod_path_to_ast(&self.import_path),
            merge_behavior,
        );
        let old_ast = rewriter.rewrite_root()?;
        let mut import_insert = TextEdit::builder();
        algo::diff(&old_ast, &rewriter.rewrite(&old_ast)).into_text_edit(&mut import_insert);
        Some(import_insert.finish())
    }
pub fn to_text_edit ( & self , merge_behavior : Option < MergeBehavior > ) -> Option < TextEdit > { let _p = profile :: span ( " " ) ; let rewriter = insert_use :: insert_use ( & self . import_scope , mod_path_to_ast ( & self . import_path ) , merge_behavior , ) ; let old_ast = rewriter . rewrite_root ( ) ? ; let mut import_insert = TextEdit :: builder ( ) ; algo :: diff ( & old_ast , & rewriter . rewrite ( & old_ast ) ) . into_text_edit ( & mut import_insert ) ; Some ( import_insert . finish ( ) ) }
Attempts to insert the import to the given scope, producing a text edit.
Attempts to insert the import to the given scope producing a text edit .
&self
merge_behavior
Option<MergeBehavior>