mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-29 21:35:58 +00:00
Use a single SourceCodeLocator everywhere (#510)
This commit is contained in:
parent
2fcbf3ab62
commit
db59d5b558
8 changed files with 63 additions and 66 deletions
|
@ -27,7 +27,7 @@ pub fn leading_space(line: &str) -> String {
|
|||
/// Extract the leading indentation from a docstring.
|
||||
pub fn indentation<'a>(checker: &'a Checker, docstring: &Expr) -> &'a str {
|
||||
let range = Range::from_located(docstring);
|
||||
checker.get_locator().slice_source_code_range(&Range {
|
||||
checker.locator.slice_source_code_range(&Range {
|
||||
location: Location::new(range.location.row(), 1),
|
||||
end_location: Location::new(range.location.row(), range.location.column()),
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue