fix: info at pattern variables

This commit is contained in:
Sebastian Ullrich 2022-05-16 08:19:02 +02:00 committed by Leonardo de Moura
parent 61c7b8b94c
commit a2bf2a4abd
4 changed files with 12 additions and 5 deletions

View file

@ -255,7 +255,7 @@ where
/- Check whether `stx` is a pattern variable or constructor-like (i.e., constructor or constant tagged with `[matchPattern]` attribute) -/
processId (stx : Syntax) : M Syntax := do
match (← resolveId? stx "pattern" (withInfo := true)) with
match (← resolveId? stx "pattern") with
| none => processVar stx
| some f => match f with
| Expr.const fName _ _ =>

View file

@ -36,18 +36,15 @@ a : α
n : <failed-to-infer-type> @ ⟨8, 2⟩-⟨10, 19⟩ @ Lean.Elab.Term.elabMatch
x : Fam2 α β @ ⟨8, 8⟩-⟨8, 9⟩
[.] `Fam2.any : none @ ⟨9, 4⟩-⟨9, 12⟩
@Fam2.any : {α : Type} → Fam2 α α @ ⟨9, 4⟩-⟨9, 12⟩
[.] `Fam2.any : none @ ⟨9, 4⟩-⟨9, 12⟩
@Fam2.any : {α : Type} → Fam2 α α @ ⟨9, 4⟩-⟨9, 12⟩
[.] `Fam2.nat : none @ ⟨10, 4⟩-⟨10, 12⟩
Fam2.nat : Nat → Fam2 Nat Nat @ ⟨10, 4⟩-⟨10, 12⟩
[.] `n : none @ ⟨10, 13⟩-⟨10, 14⟩
[.] `Fam2.any : none @ ⟨9, 4⟩-⟨9, 12⟩
@Fam2.any : {α : Type} → Fam2 α α @ ⟨9, 4⟩-⟨9, 12⟩
[.] `Fam2.any : none @ ⟨9, 4⟩-⟨9, 12⟩
@Fam2.any : {α : Type} → Fam2 α α @ ⟨9, 4⟩-⟨9, 12⟩
[.] `a : none @ ⟨8, 2⟩†-⟨10, 19⟩†
a : α @ ⟨8, 2⟩†-⟨10, 19⟩†
[.] `Fam2.any : some Fam2 ([mdata _patWithRef: [mdata _inaccessible:1 [mdata _patWithRef: ?_uniq.652]]]) ([mdata _patWithRef: [mdata _inaccessible:1 [mdata _patWithRef: ?_uniq.653]]]) @ ⟨9, 4⟩-⟨9, 12⟩
[.] `a : some [mdata _patWithRef: [mdata _inaccessible:1 [mdata _patWithRef: ?_uniq.652]]] @ ⟨8, 2⟩†-⟨10, 19⟩†
α (isBinder := true) : Type @ ⟨8, 2⟩†-⟨10, 19⟩†
@ -60,7 +57,6 @@ a : α
Fam2.nat : Nat → Fam2 Nat Nat @ ⟨10, 4⟩-⟨10, 12⟩
[.] `n : none @ ⟨10, 13⟩-⟨10, 14⟩
[.] `a : none @ ⟨8, 2⟩†-⟨10, 19⟩†
a : α @ ⟨8, 2⟩†-⟨10, 19⟩†
[.] `Fam2.nat : some Fam2 ([mdata _patWithRef: [mdata _inaccessible:1 [mdata _patWithRef: ?_uniq.684]]]) ([mdata _patWithRef: [mdata _inaccessible:1 [mdata _patWithRef: ?_uniq.685]]]) @ ⟨10, 4⟩-⟨10, 12⟩
[.] `n : some Nat @ ⟨10, 13⟩-⟨10, 14⟩
[.] `a : some [mdata _patWithRef: [mdata _inaccessible:1 [mdata _patWithRef: ?_uniq.684]]] @ ⟨8, 2⟩†-⟨10, 19⟩†

View file

@ -48,3 +48,9 @@ example : Nat := Id.run do
y := 1
return y -- TODO: definition should be first `y`
--^ textDocument/documentHighlight
example (x : Option Nat) : Nat :=
match x with
| some x => 1
--^ textDocument/documentHighlight
| none => 0

View file

@ -116,3 +116,8 @@
{"range":
{"start": {"line": 48, "character": 9}, "end": {"line": 48, "character": 10}},
"kind": 1}]
{"textDocument": {"uri": "file://highlight.lean"},
"position": {"line": 53, "character": 9}}
[{"range":
{"start": {"line": 53, "character": 9}, "end": {"line": 53, "character": 10}},
"kind": 1}]