MCPcopy Create free account
hub / github.com/Eeive/Evcode-ide / run

Method run

src/app/mod.rs:95–132  ·  view source on GitHub ↗
(&mut self, terminal: &mut Terminal<B>)

Source from the content-addressed store, hash-verified

93 }
94
95 pub async fn run<B: Backend>(&mut self, terminal: &mut Terminal<B>) -> Result<()> {
96 const STATUS_TIMEOUT: Duration = Duration::from_secs(4);
97 const FRAME_BUDGET: Duration = Duration::from_millis(16);
98
99 loop {
100 if let Some(t) = self.status_msg_time {
101 if t.elapsed() >= STATUS_TIMEOUT {
102 self.status_msg.clear();
103 self.status_msg_time = None;
104 }
105 }
106
107 self.term.poll_completed();
108 self.lsp.poll_messages();
109 for d in self.lsp.diagnostic_strings() {
110 self.problems.insert(d);
111 }
112
113 terminal.draw(|f| draw(f, self))?;
114
115 if event::poll(FRAME_BUDGET)? {
116 match event::read()? {
117 Event::Key(key) => self.handle_key(key).await,
118 Event::Mouse(mouse) => self.handle_mouse(mouse),
119 _ => {}
120 }
121 }
122
123 if self.should_quit {
124 let _ = self.editor.save_all();
125 self.snap.save_all_to_disk();
126 self.save_session();
127 break;
128 }
129 }
130
131 Ok(())
132 }
133}

Callers 1

mainFunction · 0.80

Calls 9

drawFunction · 0.85
poll_completedMethod · 0.80
poll_messagesMethod · 0.80
diagnostic_stringsMethod · 0.80
handle_keyMethod · 0.80
handle_mouseMethod · 0.80
save_allMethod · 0.80
save_all_to_diskMethod · 0.80
save_sessionMethod · 0.80

Tested by

no test coverage detected