fix: improve "no library suggestions engine registered" error message (#11464)

This PR improves the error message when no library suggestions engine is
registered to recommend importing `Lean.LibrarySuggestions.Default` for
the built-in engine.

**Before:**
```
No library suggestions engine registered. (Note that Lean does not provide a default library suggestions engine, these must be provided by a downstream library, and configured using `set_library_suggestions`.)
```

**After:**
```
No library suggestions engine registered. (Add `import Lean.LibrarySuggestions.Default` to use Lean's built-in engine, or use `set_library_suggestions` to configure a custom one.)
```

🤖 Prepared with Claude Code

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
Kim Morrison 2025-12-02 11:55:46 +11:00 committed by GitHub
parent c0d5b9b52c
commit a0c8404ab8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 4 deletions

View file

@ -403,9 +403,8 @@ opaque getSelector : MetaM (Option Selector)
def select (m : MVarId) (c : Config := {}) : MetaM (Array Suggestion) := do
let some selector ← getSelector |
throwError "No library suggestions engine registered. \
(Note that Lean does not provide a default library suggestions engine, \
these must be provided by a downstream library, \
and configured using `set_library_suggestions`.)"
(Add `import Lean.LibrarySuggestions.Default` to use Lean's built-in engine, \
or use `set_library_suggestions` to configure a custom one.)"
selector m c
/-!

View file

@ -1,7 +1,7 @@
import Lean.LibrarySuggestions.Basic
/--
error: No library suggestions engine registered. (Note that Lean does not provide a default library suggestions engine, these must be provided by a downstream library, and configured using `set_library_suggestions`.)
error: No library suggestions engine registered. (Add `import Lean.LibrarySuggestions.Default` to use Lean's built-in engine, or use `set_library_suggestions` to configure a custom one.)
-/
#guard_msgs in
example : True := by