MCPcopy Create free account
hub / github.com/PRQL/prql / get_span_lines

Method get_span_lines

prqlc/prqlc/src/semantic/reporting.rs:59–69  ·  view source on GitHub ↗
(&mut self, id: usize)

Source from the content-addressed store, hash-verified

57 }
58
59 fn get_span_lines(&mut self, id: usize) -> Option<String> {
60 let decl_span = self.root_mod.span_map.get(&id);
61 decl_span.map(|decl_span| {
62 let line_span = self.source.get_line_range(&Range::from(*decl_span));
63 if line_span.len() <= 1 {
64 format!(" at line {}", line_span.start + 1)
65 } else {
66 format!(" at lines {}-{}", line_span.start + 1, line_span.end)
67 }
68 })
69 }
70}
71
72impl pl::PlFold for Labeler<'_> {

Callers 1

fold_exprMethod · 0.80

Calls 3

mapMethod · 0.80
lenMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected