You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: LeanSearchClient/Syntax.lean
+63-48
Original file line number
Diff line number
Diff line change
@@ -3,29 +3,37 @@ Copyright (c) 2024 Siddhartha Gadgil. All rights reserved.
3
3
Released under Apache 2.0 license as described in the file LICENSE.
4
4
Authors: Siddhartha Gadgil
5
5
-/
6
-
import Lean
6
+
import Lean.Elab.Tactic.Meta
7
+
import Lean.Meta.Tactic.TryThis
7
8
import LeanSearchClient.Basic
8
9
9
10
/-!
10
11
# LeanSearchClient
11
12
12
-
In this file, we provide syntax for search using the [leansearch API](https://leansearch.net/) from within Lean. It allows you to search for Lean tactics and theorems using natural language.
13
+
In this file, we provide syntax for search using the [leansearch API](https://leansearch.net/)
14
+
from within Lean. It allows you to search for Lean tactics and theorems using natural language.
13
15
14
-
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:
16
+
We provide syntax to make a query and generate `TryThis` options to click or
17
+
use a code action to use the results.
18
+
19
+
The queries are of three forms:
15
20
16
21
* `Command` syntax: `#leansearch "search query"` as a command.
17
22
* `Term` syntax: `#leansearch "search query"` as a term.
18
23
* `Tactic` syntax: `#leansearch "search query"` as a tactic.
19
24
20
-
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.
25
+
In all cases results are displayed in the Lean Infoview and clicking these replaces the query text.
26
+
In the cases of a query for tactics only valid tactics are displayed.
logWarning "Lean search query should end with a full stop (period) or a question mark. Note this command sends your query to an external service at https://leansearch.net/."
148
+
logWarning incompleteQuery
136
149
| _ => throwUnsupportedSyntax
137
150
138
151
syntax (name := leansearch_term) "#leansearch" str : term
logWarning "Lean search query should end with a full stop (period) or a question mark. Note this command sends your query to an external service at https://leansearch.net/."
logWarning "Lean search query should end with a full stop (period) or a question mark. Note this command sends your query to an external service at https://leansearch.net/."
0 commit comments