From fdcb5a7e731c934d2820cef74b60c16a838a9c97 Mon Sep 17 00:00:00 2001 From: Andrew Gallant Date: Thu, 4 Dec 2025 12:23:59 -0500 Subject: [PATCH] [ty] Clarify the use of `SymbolKind` in auto-import --- crates/ty_ide/src/symbols.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/crates/ty_ide/src/symbols.rs b/crates/ty_ide/src/symbols.rs index a80a9ed56d..ba33af9ef2 100644 --- a/crates/ty_ide/src/symbols.rs +++ b/crates/ty_ide/src/symbols.rs @@ -292,7 +292,13 @@ impl<'a> From<&'a SymbolTreeWithChildren> for SymbolInfo<'a> { } } -/// The kind of symbol +/// The kind of symbol. +/// +/// Note that this is computed on a best effort basis. The nature of +/// auto-import is that it tries to do a very low effort scan of a lot of code +/// very quickly. This means that it doesn't use things like type information +/// or completely resolve the definition of every symbol. So for example, we +/// might label a module as a variable, depending on how it was introduced. #[derive(Debug, Clone, Copy, PartialEq, Eq, get_size2::GetSize)] pub enum SymbolKind { Module,