aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_analysis/src/completion
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2018-12-21 12:32:29 +0000
committerAleksey Kladov <[email protected]>2018-12-21 12:32:29 +0000
commit0ce82516c1023d9aed84556949ee2ac6294a3079 (patch)
tree7cc07c9b51e6f6aff0fb0c4f2c7ab91ce97c1af0 /crates/ra_analysis/src/completion
parent4092b8d0b58598d0b4b820fff37b1d8c741c47b9 (diff)
introduce Completions
Diffstat (limited to 'crates/ra_analysis/src/completion')
-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}