LeanSearchClient #
In this file, we provide syntax for search using the leansearch API from within Lean. It allows you to search for Lean tactics and theorems using natural language.
We provide syntax to make a query and generate TryThis
options to click or
use a code action to use the results.
The queries are of three forms:
Command
syntax:#leansearch "search query"
as a command.Term
syntax:#leansearch "search query"
as a term.Tactic
syntax:#leansearch "search query"
as a tactic.
In all cases results are displayed in the Lean Infoview and clicking these replaces the query text. In the cases of a query for tactics only valid tactics are displayed.
Equations
- LeanSearchClient.queryNum = do let __do_lift ← Lean.getOptions pure (Lean.Option.get __do_lift leansearch.queries)
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- LeanSearchClient.SearchResult.query s num_results = do let jsArr ← LeanSearchClient.getQueryJson s num_results pure (Array.filterMap LeanSearchClient.SearchResult.ofJson? jsArr)
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- LeanSearchClient.defaultTerm (some type) = if (!type.hasExprMVar) = true then Lean.Meta.mkAppM `sorryAx #[type, Lean.mkConst `Bool.false] else pure (Lean.mkConst `True.intro)
- LeanSearchClient.defaultTerm none = pure (Lean.mkConst `True.intro)
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- LeanSearchClient.incompleteQuery = "#leansearch query should end with a `.` or `?`.\nNote this command sends your query to an external service at https://leansearch.net/."
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.