aboutsummaryrefslogtreecommitdiff
path: root/crates/ide_completion/src/item.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ide_completion/src/item.rs')
-rw-r--r--crates/ide_completion/src/item.rs13
1 files changed, 8 insertions, 5 deletions
diff --git a/crates/ide_completion/src/item.rs b/crates/ide_completion/src/item.rs
index b16f0775a..5e8ed75f1 100644
--- a/crates/ide_completion/src/item.rs
+++ b/crates/ide_completion/src/item.rs
@@ -68,7 +68,7 @@ pub struct CompletionItem {
68 68
69 /// Indicates that a reference or mutable reference to this variable is a 69 /// Indicates that a reference or mutable reference to this variable is a
70 /// possible match. 70 /// possible match.
71 ref_match: Option<(Mutability, CompletionScore)>, 71 ref_match: Option<Mutability>,
72 72
73 /// The import data to add to completion's edits. 73 /// The import data to add to completion's edits.
74 import_to_add: Option<ImportEdit>, 74 import_to_add: Option<ImportEdit>,
@@ -104,6 +104,9 @@ impl fmt::Debug for CompletionItem {
104 if let Some(score) = &self.score { 104 if let Some(score) = &self.score {
105 s.field("score", score); 105 s.field("score", score);
106 } 106 }
107 if let Some(mutability) = &self.ref_match {
108 s.field("ref_match", &format!("&{}", mutability.as_keyword_for_ref()));
109 }
107 if self.trigger_call_info { 110 if self.trigger_call_info {
108 s.field("trigger_call_info", &true); 111 s.field("trigger_call_info", &true);
109 } 112 }
@@ -261,7 +264,7 @@ impl CompletionItem {
261 self.trigger_call_info 264 self.trigger_call_info
262 } 265 }
263 266
264 pub fn ref_match(&self) -> Option<(Mutability, CompletionScore)> { 267 pub fn ref_match(&self) -> Option<Mutability> {
265 self.ref_match 268 self.ref_match
266 } 269 }
267 270
@@ -311,7 +314,7 @@ pub(crate) struct Builder {
311 deprecated: bool, 314 deprecated: bool,
312 trigger_call_info: Option<bool>, 315 trigger_call_info: Option<bool>,
313 score: Option<CompletionScore>, 316 score: Option<CompletionScore>,
314 ref_match: Option<(Mutability, CompletionScore)>, 317 ref_match: Option<Mutability>,
315} 318}
316 319
317impl Builder { 320impl Builder {
@@ -430,8 +433,8 @@ impl Builder {
430 self.import_to_add = import_to_add; 433 self.import_to_add = import_to_add;
431 self 434 self
432 } 435 }
433 pub(crate) fn ref_match(mut self, ref_match: (Mutability, CompletionScore)) -> Builder { 436 pub(crate) fn ref_match(mut self, mutability: Mutability) -> Builder {
434 self.ref_match = Some(ref_match); 437 self.ref_match = Some(mutability);
435 self 438 self
436 } 439 }
437} 440}