mirror of https://github.com/astral-sh/ruff
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.
|
||
|---|---|---|
| .. | ||
| import-resolution-diagram.dot | ||
| import-resolution-diagram.svg | ||
| list.rs | ||
| mod.rs | ||
| module.rs | ||
| path.rs | ||
| resolver.rs | ||
| testing.rs | ||
| typeshed.rs | ||