mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-30 05:44:56 +00:00
Move Ranged
into ruff_text_size
(#6919)
## Summary The motivation here is that this enables us to implement `Ranged` in crates that don't depend on `ruff_python_ast`. Largely a mechanical refactor with a lot of regex, Clippy help, and manual fixups. ## Test Plan `cargo test`
This commit is contained in:
parent
88c8bece38
commit
fc89976c24
468 changed files with 940 additions and 706 deletions
|
@ -95,7 +95,7 @@ impl<'a> Locator<'a> {
|
|||
/// ## Examples
|
||||
///
|
||||
/// ```
|
||||
/// # use ruff_text_size::{TextRange, TextSize};
|
||||
/// # use ruff_text_size::{Ranged, TextRange, TextSize};
|
||||
/// # use ruff_source_file::Locator;
|
||||
///
|
||||
/// let locator = Locator::new("First line\nsecond line\r\nthird line");
|
||||
|
@ -122,7 +122,7 @@ impl<'a> Locator<'a> {
|
|||
/// ## Examples
|
||||
///
|
||||
/// ```
|
||||
/// # use ruff_text_size::{TextRange, TextSize};
|
||||
/// # use ruff_text_size::{Ranged, TextRange, TextSize};
|
||||
/// # use ruff_source_file::Locator;
|
||||
///
|
||||
/// let locator = Locator::new("First line\nsecond line\r\nthird line");
|
||||
|
@ -152,7 +152,7 @@ impl<'a> Locator<'a> {
|
|||
/// ## Examples
|
||||
///
|
||||
/// ```
|
||||
/// # use ruff_text_size::{TextRange, TextSize};
|
||||
/// # use ruff_text_size::{Ranged, TextRange, TextSize};
|
||||
/// # use ruff_source_file::Locator;
|
||||
///
|
||||
/// let locator = Locator::new("First line\nsecond line\r\nthird line");
|
||||
|
@ -176,7 +176,7 @@ impl<'a> Locator<'a> {
|
|||
/// ## Examples
|
||||
///
|
||||
/// ```
|
||||
/// # use ruff_text_size::{TextRange, TextSize};
|
||||
/// # use ruff_text_size::{Ranged, TextRange, TextSize};
|
||||
/// # use ruff_source_file::Locator;
|
||||
///
|
||||
/// let locator = Locator::new("First line\nsecond line\r\nthird line");
|
||||
|
@ -199,7 +199,7 @@ impl<'a> Locator<'a> {
|
|||
/// ## Examples
|
||||
///
|
||||
/// ```
|
||||
/// # use ruff_text_size::{TextRange, TextSize};
|
||||
/// # use ruff_text_size::{Ranged, TextRange, TextSize};
|
||||
/// # use ruff_source_file::Locator;
|
||||
///
|
||||
/// let locator = Locator::new("First line\nsecond line\r\nthird line");
|
||||
|
@ -222,7 +222,7 @@ impl<'a> Locator<'a> {
|
|||
/// ## Examples
|
||||
///
|
||||
/// ```
|
||||
/// # use ruff_text_size::{TextRange, TextSize};
|
||||
/// # use ruff_text_size::{Ranged, TextRange, TextSize};
|
||||
/// # use ruff_source_file::Locator;
|
||||
///
|
||||
/// let locator = Locator::new("First line\nsecond line\r\nthird line");
|
||||
|
@ -246,7 +246,7 @@ impl<'a> Locator<'a> {
|
|||
/// ## Examples
|
||||
///
|
||||
/// ```
|
||||
/// # use ruff_text_size::{TextRange, TextSize};
|
||||
/// # use ruff_text_size::{Ranged, TextRange, TextSize};
|
||||
/// # use ruff_source_file::Locator;
|
||||
///
|
||||
/// let locator = Locator::new("First line\nsecond line\r\nthird line");
|
||||
|
@ -278,7 +278,7 @@ impl<'a> Locator<'a> {
|
|||
/// ## Examples
|
||||
///
|
||||
/// ```
|
||||
/// # use ruff_text_size::{TextRange, TextSize};
|
||||
/// # use ruff_text_size::{Ranged, TextRange, TextSize};
|
||||
/// # use ruff_source_file::Locator;
|
||||
///
|
||||
/// let locator = Locator::new("First line\nsecond line\r\nthird line");
|
||||
|
@ -302,7 +302,7 @@ impl<'a> Locator<'a> {
|
|||
/// Returns true if the text of `range` contains any line break.
|
||||
///
|
||||
/// ```
|
||||
/// # use ruff_text_size::{TextRange, TextSize};
|
||||
/// # use ruff_text_size::{Ranged, TextRange, TextSize};
|
||||
/// # use ruff_source_file::Locator;
|
||||
///
|
||||
/// let locator = Locator::new("First line\nsecond line\r\nthird line");
|
||||
|
@ -327,7 +327,7 @@ impl<'a> Locator<'a> {
|
|||
/// ## Examples
|
||||
///
|
||||
/// ```
|
||||
/// # use ruff_text_size::{TextRange, TextSize};
|
||||
/// # use ruff_text_size::{Ranged, TextRange, TextSize};
|
||||
/// # use ruff_source_file::Locator;
|
||||
///
|
||||
/// let locator = Locator::new("First line\nsecond line\r\nthird line");
|
||||
|
@ -355,7 +355,7 @@ impl<'a> Locator<'a> {
|
|||
/// ## Examples
|
||||
///
|
||||
/// ```
|
||||
/// # use ruff_text_size::{TextRange, TextSize};
|
||||
/// # use ruff_text_size::{Ranged, TextRange, TextSize};
|
||||
/// # use ruff_source_file::Locator;
|
||||
///
|
||||
/// let locator = Locator::new("First line\nsecond line\r\nthird line");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue