Render code frame with context (#3901)
This commit is contained in:
@@ -78,6 +78,10 @@ impl<'src, 'index> SourceCode<'src, 'index> {
|
||||
self.index.line_start(line, self.text)
|
||||
}
|
||||
|
||||
pub fn line_end(&self, line: OneIndexed) -> TextSize {
|
||||
self.index.line_end(line, self.text)
|
||||
}
|
||||
|
||||
pub fn line_range(&self, line: OneIndexed) -> TextRange {
|
||||
self.index.line_range(line, self.text)
|
||||
}
|
||||
@@ -198,6 +202,11 @@ impl SourceCodeBuf {
|
||||
self.as_source_code().offset(location)
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn line_end(&self, line: OneIndexed) -> TextSize {
|
||||
self.as_source_code().line_end(line)
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn line_start(&self, line: OneIndexed) -> TextSize {
|
||||
self.as_source_code().line_start(line)
|
||||
|
||||
Reference in New Issue
Block a user