MCPcopy Index your code
hub / github.com/ChrisFeldmeier/OpenCodeRust / add

Method add

crates/opencode-session/src/todo.rs:132–148  ·  view source on GitHub ↗
(&self, session_id: &str, todo: TodoInfo)

Source from the content-addressed store, hash-verified

130 }
131
132 pub async fn add(&self, session_id: &str, todo: TodoInfo) {
133 let mut state = self.state.write().await;
134 let todos = state.entry(session_id.to_string()).or_insert_with(Vec::new);
135 let position = todos.len();
136 todos.push(todo.clone());
137
138 if let Some(ref db) = self.db {
139 let item = opencode_storage::TodoItem {
140 id: format!("{}_{}", session_id, position),
141 content: todo.content,
142 status: todo.status,
143 priority: todo.priority,
144 position: position as i64,
145 };
146 let _ = db.upsert(session_id, &item).await;
147 }
148 }
149
150 pub async fn remove(&self, session_id: &str, index: usize) -> bool {
151 let mut state = self.state.write().await;

Callers 1

addCandidateFunction · 0.80

Calls 2

upsertMethod · 0.80
cloneMethod · 0.45

Tested by

no test coverage detected