MCPcopy Create free account
hub / github.com/CodeBendKit/codeseek / _extract_code_snippet

Method _extract_code_snippet

rust-core/src/codegraph/parser.rs:660–669  ·  view source on GitHub ↗

提取代码片段内容

(&self, lines: &[&str], start_line: usize, end_line: usize)

Source from the content-addressed store, hash-verified

658
659 /// 提取代码片段内容
660 fn _extract_code_snippet(&self, lines: &[&str], start_line: usize, end_line: usize) -> String {
661 let start_idx = (start_line - 1).min(lines.len());
662 let end_idx = end_line.min(lines.len());
663
664 if start_idx >= end_idx {
665 return String::new();
666 }
667
668 lines[start_idx..end_idx].join("\n")
669 }
670
671 /// 解析目录下的所有文件
672 pub fn parse_directory(&mut self, dir: &Path) -> Result<(), String> {

Callers 2

_update_snippet_indexMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected