File tree 3 files changed +25
-1
lines changed
highlighting/SubVerso/Highlighting
3 files changed +25
-1
lines changed Original file line number Diff line number Diff line change 33
33
- " nightly-2025-03-06"
34
34
- " nightly-2025-03-12"
35
35
- " nightly-2025-03-16"
36
+ - " nightly-2025-03-21"
36
37
platform :
37
38
- os : ubuntu-latest
38
39
installer : |
Original file line number Diff line number Diff line change @@ -225,3 +225,26 @@ open Lean Elab Command in
225
225
def commandWithoutAsync : (act : CommandElabM α) → CommandElabM α :=
226
226
withScope fun sc =>
227
227
{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*))
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ import Lean.Widget.TaggedText
10
10
import SubVerso.Compat
11
11
import SubVerso.Highlighting.Highlighted
12
12
13
- open Lean hiding HashMap
13
+ open Lean hiding perhaps ( HashMap)
14
14
open Elab
15
15
open Lean.Widget (TaggedText)
16
16
open Lean.Widget
You can’t perform that action at this time.
0 commit comments