ruff/crates/ty_python_semantic/src/module_resolver
Andrew Gallant c548ef2027 [ty] Squash false positive logs for failing to find `builtins` as a real module
I recently started noticing this showing up in the logs for every scope
based completion request:

```
2025-12-11 11:25:35.704329935 DEBUG request{id=29 method="textDocument/completion"}:map_stub_definition: Module `builtins` not found while looking in parent dirs
```

And in particular, it was repeated several times. This was confusing to
me because, well, of course `builtins` should resolve.

This particular code path comes from looking for the docstrings
of completion items. This involves a spelunking that ultimately
tries to resolve a "real" module if the stub doesn't have available
docstrings. But I guess there is no "real" `builtins` module, so
`resolve_real_module` fails. Which is fine, but the noisy logs were
annoying since this is an expected case.

So here, we carve out a short circuit for `builtins` and also improve
the log message.
2025-12-11 12:50:08 -05:00
..
import-resolution-diagram.dot [ty] Update module resolution diagram to account for typeshed `VERSIONS` file 2025-07-30 10:34:58 -04:00
import-resolution-diagram.svg [ty] Update module resolution diagram to account for typeshed `VERSIONS` file 2025-07-30 10:34:58 -04:00
list.rs [ty] Exclude `typing_extensions` from completions unless it's really available 2025-12-01 11:24:16 -05:00
mod.rs [ty] Teach `ty` the meaning of desperation (try ancestor `pyproject.toml`s as search-paths if module resolution fails) (#21745) 2025-12-03 15:04:36 -05:00
module.rs [ty] Type inference for `@asynccontextmanager` (#21876) 2025-12-09 22:49:00 +01:00
path.rs [ty] Make auto-import ignore symbols in modules starting with a `_` 2025-12-04 13:21:26 -05:00
resolver.rs [ty] Squash false positive logs for failing to find `builtins` as a real module 2025-12-11 12:50:08 -05:00
testing.rs [ty] Re-arrange "list modules" implementation for Salsa caching 2025-08-20 10:41:47 -04:00
typeshed.rs [ty] Disallow std::env and io methods in most ty crates (#20046) 2025-08-22 11:13:47 -07:00