mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-18 09:31:09 +00:00
Rename ruff_python_semantic's Context
struct to SemanticModel
(#4565)
This commit is contained in:
parent
3238743a7b
commit
19c4b7bee6
304 changed files with 1253 additions and 1142 deletions
|
@ -1,13 +1,15 @@
|
|||
use crate::source_code::SourceLocation;
|
||||
use ruff_text_size::{TextLen, TextRange, TextSize};
|
||||
#[cfg(feature = "serde")]
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::fmt;
|
||||
use std::fmt::{Debug, Formatter};
|
||||
use std::num::NonZeroUsize;
|
||||
use std::ops::Deref;
|
||||
use std::sync::Arc;
|
||||
|
||||
use ruff_text_size::{TextLen, TextRange, TextSize};
|
||||
#[cfg(feature = "serde")]
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use crate::source_code::SourceLocation;
|
||||
|
||||
/// Index for fast [byte offset](TextSize) to [`SourceLocation`] conversions.
|
||||
///
|
||||
/// Cloning a [`LineIndex`] is cheap because it only requires bumping a reference count.
|
||||
|
@ -312,9 +314,10 @@ const fn unwrap<T: Copy>(option: Option<T>) -> T {
|
|||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use ruff_text_size::TextSize;
|
||||
|
||||
use crate::source_code::line_index::LineIndex;
|
||||
use crate::source_code::{OneIndexed, SourceLocation};
|
||||
use ruff_text_size::TextSize;
|
||||
|
||||
#[test]
|
||||
fn ascii_index() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue