Use relative positions inside a SourceFile.
This commit is contained in:
parent
eb349e35aa
commit
45e19aa80c
@ -268,7 +268,7 @@ pub(crate) fn snippet_provider(&self, span: Span) -> SnippetProvider {
|
|||||||
let source_file = self.parse_sess.source_map().lookup_char_pos(span.lo()).file;
|
let source_file = self.parse_sess.source_map().lookup_char_pos(span.lo()).file;
|
||||||
SnippetProvider::new(
|
SnippetProvider::new(
|
||||||
source_file.start_pos,
|
source_file.start_pos,
|
||||||
source_file.end_pos,
|
source_file.end_position(),
|
||||||
Lrc::clone(source_file.src.as_ref().unwrap()),
|
Lrc::clone(source_file.src.as_ref().unwrap()),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user