From 703a1e337530be4dad601f9576a19bcd8bcaf98b Mon Sep 17 00:00:00 2001 From: Denys Zhak Date: Thu, 11 Dec 2025 11:45:22 +0200 Subject: [PATCH] Update crates/ruff_linter/src/checkers/ast/mod.rs Co-authored-by: Micha Reiser --- crates/ruff_linter/src/checkers/ast/mod.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/crates/ruff_linter/src/checkers/ast/mod.rs b/crates/ruff_linter/src/checkers/ast/mod.rs index fb163f8006..7b750536e9 100644 --- a/crates/ruff_linter/src/checkers/ast/mod.rs +++ b/crates/ruff_linter/src/checkers/ast/mod.rs @@ -437,7 +437,11 @@ impl<'a> Checker<'a> { } } - /// Returns the [`Tokens`] for the parsed source file + /// Returns the [`Tokens`] for the parsed source file. + /// + /// + /// Unlike [`Self::tokens`], this method always returns + /// the tokens for the current file, even when within a parsed type annotation. pub(crate) fn source_tokens(&self) -> &'a Tokens { self.parsed.tokens() }