From f054e7edf83632637651b4f77020f0cd7497d76c Mon Sep 17 00:00:00 2001 From: Andrew Gallant Date: Thu, 4 Dec 2025 09:13:17 -0500 Subject: [PATCH] [ty] Tweaks tests to use clearer language A completion lacking a module reference doesn't necessarily mean that the symbol is defined within the current module. I believe the intent here is that it means that no import is required to use it. --- crates/ty_ide/src/completion.rs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/crates/ty_ide/src/completion.rs b/crates/ty_ide/src/completion.rs index d751611339..cd4e886e45 100644 --- a/crates/ty_ide/src/completion.rs +++ b/crates/ty_ide/src/completion.rs @@ -4350,7 +4350,7 @@ from os. .build() .snapshot(); assert_snapshot!(snapshot, @r" - Kadabra :: Literal[1] :: Current module + Kadabra :: Literal[1] :: AbraKadabra :: Unavailable :: package "); } @@ -5534,7 +5534,7 @@ def foo(param: s) // Even though long_namea is alphabetically before long_nameb, // long_nameb is currently imported and should be preferred. assert_snapshot!(snapshot, @r" - long_nameb :: Literal[1] :: Current module + long_nameb :: Literal[1] :: long_namea :: Unavailable :: foo "); } @@ -5804,7 +5804,7 @@ from .imp #[test] fn typing_extensions_excluded_from_import() { let builder = completion_test_builder("from typing").module_names(); - assert_snapshot!(builder.build().snapshot(), @"typing :: Current module"); + assert_snapshot!(builder.build().snapshot(), @"typing :: "); } #[test] @@ -5823,8 +5823,8 @@ from .imp .completion_test_builder() .module_names(); assert_snapshot!(builder.build().snapshot(), @r" - typing :: Current module - typing_extensions :: Current module + typing :: + typing_extensions :: "); } @@ -5849,8 +5849,8 @@ from .imp .completion_test_builder() .module_names(); assert_snapshot!(builder.build().snapshot(), @r" - typing :: Current module - typing_extensions :: Current module + typing :: + typing_extensions :: "); } @@ -5883,7 +5883,7 @@ foo.ZQ .module_names() .build() .snapshot(); - assert_snapshot!(snapshot, @"ZQZQ :: Current module"); + assert_snapshot!(snapshot, @"ZQZQ :: "); } #[test] @@ -5925,7 +5925,7 @@ foo.ZQ .module_names() .build() .snapshot(); - assert_snapshot!(snapshot, @"ZQZQ :: Current module"); + assert_snapshot!(snapshot, @"ZQZQ :: "); } #[test] @@ -6241,7 +6241,7 @@ ZQ let module_name = c .module_name .map(ModuleName::as_str) - .unwrap_or("Current module"); + .unwrap_or(""); snapshot = format!("{snapshot} :: {module_name}"); } snapshot