Lines Matching full:files
5 use codespan_reporting::files::{Error, Files};
38 files: &'a F, in byte_index_to_position()
43 F: Files<'a> + ?Sized, in byte_index_to_position()
45 let source = files.source(file_id)?; in byte_index_to_position()
48 let line_index = files.line_index(file_id, byte_index)?; in byte_index_to_position()
49 let line_span = files.line_range(file_id, line_index).unwrap(); in byte_index_to_position()
67 files: &'a F, in byte_span_to_range()
72 F: Files<'a> + ?Sized, in byte_span_to_range()
75 start: byte_index_to_position(files, file_id, span.start)?, in byte_span_to_range()
76 end: byte_index_to_position(files, file_id, span.end)?, in byte_span_to_range()
108 files: &'a F, in position_to_byte_index()
113 F: Files<'a> + ?Sized, in position_to_byte_index()
115 let source = files.source(file_id)?; in position_to_byte_index()
118 let line_span = files.line_range(file_id, position.line as usize).unwrap(); in position_to_byte_index()
127 files: &'a F, in range_to_byte_span()
132 F: Files<'a> + ?Sized, in range_to_byte_span()
134 Ok(position_to_byte_index(files, file_id, &range.start)? in range_to_byte_span()
135 ..position_to_byte_index(files, file_id, &range.end)?) in range_to_byte_span()
140 use codespan_reporting::files::{Location, SimpleFiles};
151 let mut files = SimpleFiles::new(); in position() localVariable
152 let file_id = files.add("test", text); in position()
154 &files, in position()
168 files.location(file_id, pos).unwrap() in position()
178 let mut files = SimpleFiles::new(); in unicode_get_byte_index() localVariable
179 let file_id = files.add("unicode", UNICODE); in unicode_get_byte_index()
182 &files, in unicode_get_byte_index()
192 &files, in unicode_get_byte_index()
204 let mut files = SimpleFiles::new(); in unicode_get_position() localVariable
205 let file_id = files.add("unicode", UNICODE.to_string()); in unicode_get_position()
206 let file_id2 = files.add("unicode newline", "\n".to_string() + UNICODE); in unicode_get_position()
208 let result = byte_index_to_position(&files, file_id, 5); in unicode_get_position()
217 let result = byte_index_to_position(&files, file_id, 10); in unicode_get_position()
226 let result = byte_index_to_position(&files, file_id2, 11); in unicode_get_position()