Skip to content

Commit 80627bb

Browse files
kim-emclaude
andcommitted
fix: repair broken merge in #help note display logic
The merge of main into nightly-testing created a broken hybrid: the new filtering logic from #1545 but the old display logic referencing the removed `grouped_valid_entries` and tuple accessors. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
1 parent 52198d3 commit 80627bb

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

Batteries/Tactic/HelpCmd.lean

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -283,11 +283,6 @@ elab_rules : command
283283
| `(#help cat $[+%$more]? $cat $id:ident) => elabHelpCat more cat (id.getId.toString false)
284284
| `(#help cat $[+%$more]? $cat $id:str) => elabHelpCat more cat id.getString
285285

286-
/--
287-
format the string to be included in a single markdown bullet
288-
-/
289-
private def _root_.String.makeBullet (s:String) := "* " ++ ("\n ").intercalate (s.splitOn "\n")
290-
291286
open Lean Parser Batteries.Util.LibraryNote in
292287
/--
293288
`#help note "foo"` searches for all library notes whose
@@ -320,9 +315,12 @@ elab "#help " colGt &"note" colGt ppSpace name:strLit : command => do
320315
logError "Note not found"
321316
else
322317
logInfo <| "\n\n".intercalate <|
323-
grouped_valid_entries.map
324-
fun l => "library_note \"" ++ l.head!.fst ++ "\"\n" ++
325-
"\n\n".intercalate (l.map (·.snd.trimAscii.copy.makeBullet))
318+
← valid_entries.filterMapM
319+
fun x => do
320+
let some doc ← findDocString? env <| (`LibraryNote).eraseMacroScopes.append x |
321+
return none
322+
return "library_note " ++ x.toString (escape := true) ++ "\n" ++
323+
"/-- " ++ doc.trimAscii ++ " -/"
326324

327325
/--
328326
The command `#help term` shows all term syntaxes that have been defined in the current environment.

0 commit comments

Comments
 (0)