diff --git a/src/Lean/Elab/PatternVar.lean b/src/Lean/Elab/PatternVar.lean index a60d0ae43e..bb30c64617 100644 --- a/src/Lean/Elab/PatternVar.lean +++ b/src/Lean/Elab/PatternVar.lean @@ -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 _ _ => diff --git a/tests/lean/1018unknowMVarIssue.lean.expected.out b/tests/lean/1018unknowMVarIssue.lean.expected.out index 979bdc60ae..179a3b2c76 100644 --- a/tests/lean/1018unknowMVarIssue.lean.expected.out +++ b/tests/lean/1018unknowMVarIssue.lean.expected.out @@ -36,18 +36,15 @@ a : α n : @ ⟨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⟩† diff --git a/tests/lean/interactive/highlight.lean b/tests/lean/interactive/highlight.lean index 59bc9e2d6a..93f0ec278d 100644 --- a/tests/lean/interactive/highlight.lean +++ b/tests/lean/interactive/highlight.lean @@ -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 diff --git a/tests/lean/interactive/highlight.lean.expected.out b/tests/lean/interactive/highlight.lean.expected.out index fff839d035..10c86ad5a6 100644 --- a/tests/lean/interactive/highlight.lean.expected.out +++ b/tests/lean/interactive/highlight.lean.expected.out @@ -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}]