| 50 | pub fn new(completion_engine: Option<CompletionEngine>, cx: &mut Context<Self>) -> Self { |
| 51 | Self { |
| 52 | rows: Vec::new(), |
| 53 | focus_handle: cx.focus_handle(), |
| 54 | completion_engine, |
| 55 | } |
| 56 | } |
| 57 | |
| 58 | pub fn add_row(&mut self, window: &mut Window, cx: &mut Context<Self>) { |
| 59 | let completion_engine = self.completion_engine.clone(); |
| 60 | let key_input = cx.new(|cx| { |
| 61 | configure_completion( |
| 62 | InputState::new(window, cx).placeholder("Key"), |
| 63 | completion_engine.as_ref(), |
| 64 | CompletionContext::FormName, |
| 65 | ) |
| 66 | }); |
| 67 | let completion_engine = self.completion_engine.clone(); |