Skip to content

Commit 89ec2a2

Browse files
chore: bump to 2025-03-21
1 parent 8ff25be commit 89ec2a2

File tree

3 files changed

+25
-1
lines changed

3 files changed

+25
-1
lines changed

.github/workflows/ci.yml

+1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ jobs:
3333
- "nightly-2025-03-06"
3434
- "nightly-2025-03-12"
3535
- "nightly-2025-03-16"
36+
- "nightly-2025-03-21"
3637
platform:
3738
- os: ubuntu-latest
3839
installer: |

src/compat/SubVerso/Compat.lean

+23
Original file line numberDiff line numberDiff line change
@@ -225,3 +225,26 @@ open Lean Elab Command in
225225
def commandWithoutAsync : (act : CommandElabM α) → CommandElabM α :=
226226
withScope fun sc =>
227227
{sc with opts := sc.opts.setBool `Elab.async false}
228+
229+
-- When a name is removed, hiding it is an error. This makes it tough to be compatible - we want to
230+
-- hide Lean.HashMap in versions prior to nightly-2025-03-21, but cannot do so later.
231+
232+
/--
233+
Opens the namespace, hiding those of the identifiers that actually exist.
234+
-/
235+
syntax "open" ident "hiding" &"perhaps" "(" ident* ")" : command
236+
237+
open Lean Elab Command in
238+
elab_rules : command
239+
| `(open $ns hiding perhaps ( $xs* )) => do
240+
let env ← getEnv
241+
let xs ← xs.filterM fun x => do
242+
let x := x.getId
243+
let nss ← resolveNamespace ns
244+
let names := nss.filter fun ns => env.contains (ns ++ x)
245+
return !names.isEmpty
246+
247+
if xs.isEmpty then
248+
elabCommand (← `(open $ns:ident))
249+
else
250+
elabCommand (← `(open $ns:ident hiding $xs*))

src/highlighting/SubVerso/Highlighting/Code.lean

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import Lean.Widget.TaggedText
1010
import SubVerso.Compat
1111
import SubVerso.Highlighting.Highlighted
1212

13-
open Lean hiding HashMap
13+
open Lean hiding perhaps (HashMap)
1414
open Elab
1515
open Lean.Widget (TaggedText)
1616
open Lean.Widget

0 commit comments

Comments
 (0)