File tree Expand file tree Collapse file tree 2 files changed +32
-9
lines changed Expand file tree Collapse file tree 2 files changed +32
-9
lines changed Original file line number Diff line number Diff line change @@ -56,6 +56,8 @@ initialize loogleCache :
56
56
57
57
def getLoogleQueryJson (s : String) (num_results : Nat := 6 ) :
58
58
CoreM <| LoogleResult:= do
59
+ let s := s.splitOn "/-" |>.getD 0 s |>.trim
60
+ let s := s.replace "\n " " "
59
61
let cache ← loogleCache.get
60
62
match cache.get? (s, num_results) with
61
63
| some r => return r
Original file line number Diff line number Diff line change @@ -6,17 +6,38 @@ import LeanSearchClient.LoogleSyntax
6
6
Examples of using the Loogle API. The search is triggered by the word at the end of the query.
7
7
-/
8
8
9
- #loogle List ?a → ?a
9
+ -- #loogle List ?a → ?a
10
10
11
- example := #loogle List ?a → ?a
11
+ -- example := #loogle List ?a → ?a
12
12
13
13
14
- set_option loogle.queries 1
14
+ -- set_option loogle.queries 1
15
15
16
- example : 3 ≤ 5 := by
17
- #loogle Nat.succ_le_succ
18
- sorry
16
+ -- example : 3 ≤ 5 := by
17
+ -- #loogle Nat.succ_le_succ
18
+ -- sorry
19
19
20
- example : 3 ≤ 5 := by
21
- #loogle
22
- decide
20
+ -- example : 3 ≤ 5 := by
21
+ -- #loogle
22
+ -- decide
23
+
24
+ /-!
25
+ More examples to test comments do not interfere with the search or caching.
26
+ -/
27
+
28
+ #loogle ?a * _ < ?a * _ ↔ _
29
+ #loogle ?a * _ < ?a * _ ↔ _ /- foo -/
30
+ #loogle ?a * _ < ?a * _ ↔ _
31
+
32
+
33
+ -- comment
34
+ #loogle ?a * _ < ?a * _ ↔ _
35
+
36
+ /--
37
+ info: Loogle Search Results
38
+ • #check Option.get!
39
+ -/
40
+ #guard_msgs in
41
+ #loogle Option ?a → ?a, "get!"
42
+
43
+ /- hello -/
You can’t perform that action at this time.
0 commit comments