Skip to content

Commit

Permalink
feat: save definition sites in code examples (#59)
Browse files Browse the repository at this point in the history
* feat: save definition sites in code examples
  • Loading branch information
david-christiansen authored Nov 6, 2024
1 parent dbb71c2 commit 83bf19c
Show file tree
Hide file tree
Showing 3 changed files with 113 additions and 68 deletions.
8 changes: 8 additions & 0 deletions src/compat/SubVerso/Compat.lean
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,14 @@ def rwTacticRightBracket? (stx : Syntax) : Option Syntax := Id.run do
return none


def getDeclarationRange? [Monad m] [MonadFileMap m] (stx : Syntax) : m (Option DeclarationRange) :=
%first_succeeding [Lean.Elab.getDeclarationRange? stx, some <$> Lean.Elab.getDeclarationRange stx]

namespace NameSet
def union (xs ys : NameSet) : NameSet :=
xs.mergeBy (fun _ _ _ => .unit) ys
end NameSet

namespace List
-- bind was renamed to flatMap in 4.14
def flatMap (xs : List α) (f : α → List β) : List β :=
Expand Down
Loading

0 comments on commit 83bf19c

Please sign in to comment.