MCPcopy Create free account
hub / github.com/ChrisFeldmeier/OpenCodeRust / parse_line_window

Method parse_line_window

crates/opencode-session/src/prompt.rs:595–611  ·  view source on GitHub ↗
(file_url: &url::Url)

Source from the content-addressed store, hash-verified

593 }
594
595 fn parse_line_window(file_url: &url::Url) -> Option<(usize, Option<usize>)> {
596 let start = file_url.query_pairs().find_map(|(key, value)| {
597 if key != "start" {
598 return None;
599 }
600 value.parse::<usize>().ok().map(|n| n.max(1))
601 })?;
602
603 let end = file_url.query_pairs().find_map(|(key, value)| {
604 if key != "end" {
605 return None;
606 }
607 value.parse::<usize>().ok().map(|n| n.max(1))
608 });
609
610 Some((start, end))
611 }
612
613 fn decode_data_url_text(url: &str, mime: &str) -> Option<String> {
614 if !Self::is_text_mime(mime) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected