]> git.lizzy.rs Git - rust.git/blobdiff - crates/completion/src/item.rs
Reuse existing element rendering
[rust.git] / crates / completion / src / item.rs
index 6d1d085f4bc779e63ebfe1750b11577ac18494c3..53a12a763d3ef2a7c48622ddef4201963cacaa25 100644 (file)
@@ -31,6 +31,7 @@ pub struct CompletionItem {
     ///
     /// Typically, replaces `source_range` with new identifier.
     text_edit: TextEdit,
+
     insert_text_format: InsertTextFormat,
 
     /// What item (struct, function, etc) are we completing.
@@ -217,6 +218,10 @@ pub fn text_edit(&self) -> &TextEdit {
         &self.text_edit
     }
 
+    pub fn update_text_edit(&mut self, new_text_edit: TextEdit) {
+        self.text_edit = new_text_edit;
+    }
+
     /// Short one-line additional information, like a type
     pub fn detail(&self) -> Option<&str> {
         self.detail.as_deref()