MCPcopy Create free account
hub / github.com/dprint/jsonc-parser / with_position

Method with_position

src/errors.rs:184–192  ·  view source on GitHub ↗
(mut self, range: Range, file_text: &str)

Source from the content-addressed store, hash-verified

182 /// Attaches position info to an error that doesn't have any yet.
183 #[cfg(feature = "serde")]
184 pub(crate) fn with_position(mut self, range: Range, file_text: &str) -> ParseError {
185 if self.0.range.start == 0 && self.0.range.end == 0 {
186 let (line_display, column_display) = get_line_and_column_display(range, file_text);
187 self.0.range = range;
188 self.0.line_display = line_display;
189 self.0.column_display = column_display;
190 }
191 self
192 }
193}
194
195impl fmt::Display for ParseError {

Callers 2

deserialize_enumMethod · 0.80
deserialize_tokenFunction · 0.80

Calls 1

Tested by

no test coverage detected