mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-28 21:05:08 +00:00
Leading, Dangling, and Trailing comments formatting (#4785)
This commit is contained in:
parent
b2498c576f
commit
5d939222db
47 changed files with 824 additions and 771 deletions
|
@ -1,4 +1,4 @@
|
|||
use ruff_text_size::TextRange;
|
||||
use ruff_text_size::{TextRange, TextSize};
|
||||
use std::fmt::{Debug, Formatter};
|
||||
|
||||
/// The source code of a document that gets formatted
|
||||
|
@ -68,9 +68,17 @@ impl SourceCodeSlice {
|
|||
&code.text[self.range]
|
||||
}
|
||||
|
||||
pub fn range(&self) -> TextRange {
|
||||
pub const fn range(&self) -> TextRange {
|
||||
self.range
|
||||
}
|
||||
|
||||
pub const fn start(&self) -> TextSize {
|
||||
self.range.start()
|
||||
}
|
||||
|
||||
pub const fn end(&self) -> TextSize {
|
||||
self.range.end()
|
||||
}
|
||||
}
|
||||
|
||||
impl Debug for SourceCodeSlice {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue