From 93db8833efda1e665de32bc9123f0f45dfcf9f58 Mon Sep 17 00:00:00 2001 From: Douglas Creager Date: Wed, 8 Oct 2025 14:16:16 -0400 Subject: [PATCH] [ty_test] Add use statements to hover.rs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Import InlineFileAssertions, ParsedAssertion, and UnparsedAssertion at the module level instead of using fully qualified crate::assertion names throughout the code. This makes the code cleaner and more idiomatic. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- crates/ty_test/src/hover.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/crates/ty_test/src/hover.rs b/crates/ty_test/src/hover.rs index 85508f0926..43aa67e6f3 100644 --- a/crates/ty_test/src/hover.rs +++ b/crates/ty_test/src/hover.rs @@ -11,6 +11,7 @@ use ruff_python_ast::AnyNodeRef; use ruff_text_size::{Ranged, TextSize}; use ty_python_semantic::{HasType, SemanticModel}; +use crate::assertion::{InlineFileAssertions, ParsedAssertion, UnparsedAssertion}; use crate::check_output::CheckOutput; use crate::db::Db; @@ -82,7 +83,7 @@ fn infer_type_at_position(db: &Db, file: File, offset: TextSize) -> Option Vec { let source = source_text(db, file); let lines = line_index(db, file); @@ -95,12 +96,12 @@ pub(crate) fn generate_hover_outputs( // Look for hover assertions in this line's assertions for assertion in line_assertions.iter() { - let crate::assertion::UnparsedAssertion::Hover(_, _) = assertion else { + let UnparsedAssertion::Hover(_, _) = assertion else { continue; }; // Parse the assertion to get the column - let Ok(crate::assertion::ParsedAssertion::Hover(hover)) = assertion.parse() else { + let Ok(ParsedAssertion::Hover(hover)) = assertion.parse() else { // Invalid hover assertion - will be caught as error by matcher continue; };