aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
Diffstat (limited to 'crates')
-rw-r--r--crates/ra_analysis/src/completion/completion_item.rs23
1 files changed, 23 insertions, 0 deletions
diff --git a/crates/ra_analysis/src/completion/completion_item.rs b/crates/ra_analysis/src/completion/completion_item.rs
index 4280976e7..322a7c6be 100644
--- a/crates/ra_analysis/src/completion/completion_item.rs
+++ b/crates/ra_analysis/src/completion/completion_item.rs
@@ -69,3 +69,26 @@ impl Builder {
69 self 69 self
70 } 70 }
71} 71}
72
73impl Into<CompletionItem> for Builder {
74 fn into(self) -> CompletionItem {
75 self.build()
76 }
77}
78
79#[derive(Debug)]
80pub(crate) struct Completions {
81 buf: Vec<CompletionItem>,
82}
83
84impl Completions {
85 pub(crate) fn add(&mut self, item: impl Into<CompletionItem>) {
86 self.buf.push(item.into())
87 }
88}
89
90impl Into<Vec<CompletionItem>> for Completions {
91 fn into(self) -> Vec<CompletionItem> {
92 self.buf
93 }
94}