From 0ce82516c1023d9aed84556949ee2ac6294a3079 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 21 Dec 2018 15:32:29 +0300 Subject: introduce Completions --- .../ra_analysis/src/completion/completion_item.rs | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'crates') 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 { self } } + +impl Into for Builder { + fn into(self) -> CompletionItem { + self.build() + } +} + +#[derive(Debug)] +pub(crate) struct Completions { + buf: Vec, +} + +impl Completions { + pub(crate) fn add(&mut self, item: impl Into) { + self.buf.push(item.into()) + } +} + +impl Into> for Completions { + fn into(self) -> Vec { + self.buf + } +} -- cgit v1.2.3