mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-14 02:49:40 +00:00
introduce Completions
This commit is contained in:
parent
4092b8d0b5
commit
0ce82516c1
@ -69,3 +69,26 @@ impl Builder {
|
|||||||
self
|
self
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl Into<CompletionItem> for Builder {
|
||||||
|
fn into(self) -> CompletionItem {
|
||||||
|
self.build()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Debug)]
|
||||||
|
pub(crate) struct Completions {
|
||||||
|
buf: Vec<CompletionItem>,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Completions {
|
||||||
|
pub(crate) fn add(&mut self, item: impl Into<CompletionItem>) {
|
||||||
|
self.buf.push(item.into())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Into<Vec<CompletionItem>> for Completions {
|
||||||
|
fn into(self) -> Vec<CompletionItem> {
|
||||||
|
self.buf
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user