MCPcopy Create free account
hub / github.com/JaredStewart/coderlm / mark_file

Function mark_file

server/src/ops/structure.rs:194–210  ·  view source on GitHub ↗
(
    file_tree: &Arc<FileTree>,
    file: &str,
    mark_str: &str,
)

Source from the content-addressed store, hash-verified

192}
193
194pub fn mark_file(
195 file_tree: &Arc<FileTree>,
196 file: &str,
197 mark_str: &str,
198) -> Result<(), String> {
199 let mark = FileMark::from_str(mark_str)
200 .ok_or_else(|| format!("Unknown mark type: '{}'. Valid: documentation, ignore, test, config, generated, custom", mark_str))?;
201
202 if let Some(mut entry) = file_tree.files.get_mut(file) {
203 if !entry.marks.contains(&mark) {
204 entry.marks.push(mark);
205 }
206 Ok(())
207 } else {
208 Err(format!("File '{}' not found in index", file))
209 }
210}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected