fix: revert "fix: show single final state after tactic combinator"
This reverts commit eb7bf2b272.
This commit is contained in:
parent
78bf398830
commit
b714a32d27
3 changed files with 2 additions and 17 deletions
|
|
@ -221,12 +221,9 @@ structure GoalsAtResult where
|
|||
Moreover, we instruct the LSP server to use the state after tactic execution if
|
||||
- the hover position is after the info's start position *and*
|
||||
- there is no nested tactic info after the hover position (tactic combinators should decide for themselves
|
||||
where to show intermediate states by calling `withTacticInfoContext`)
|
||||
|
||||
Finally, if the hover position is over the infos' trailing whitespace, we only show the last such info
|
||||
(so that we only show the single final state after combinators such as `repeat`). -/
|
||||
where to show intermediate states by calling `withTacticInfoContext`) -/
|
||||
partial def InfoTree.goalsAt? (text : FileMap) (t : InfoTree) (hoverPos : String.Pos) : List GoalsAtResult := Id.run do
|
||||
let goals := t.deepestNodes fun
|
||||
t.deepestNodes fun
|
||||
| ctx, i@(Info.ofTacticInfo ti), cs => OptionM.run do
|
||||
if let (some pos, some tailPos) := (i.pos?, i.tailPos?) then
|
||||
let trailSize := i.stx.getTrailingSize
|
||||
|
|
@ -238,11 +235,6 @@ partial def InfoTree.goalsAt? (text : FileMap) (t : InfoTree) (hoverPos : String
|
|||
else
|
||||
failure
|
||||
| _, _, _ => none
|
||||
if let (last :: _ :: _) := goals.reverse then
|
||||
-- should be the same for any element in `goals`
|
||||
if last.tacticInfo.stx.getTailPos?.get! <= hoverPos then
|
||||
return [last]
|
||||
goals
|
||||
where
|
||||
hasNestedTactic (pos tailPos) : InfoTree → Bool
|
||||
| InfoTree.node i@(Info.ofTacticInfo _) cs => Id.run do
|
||||
|
|
|
|||
|
|
@ -76,4 +76,3 @@ theorem left_distrib (t a b : Nat) : t * (a + b) = t * a + t * b := by
|
|||
rw [Nat.add_succ]
|
||||
repeat (rw [Nat.mul_succ])
|
||||
--^ $/lean/plainGoal
|
||||
--^ $/lean/plainGoal
|
||||
|
|
|
|||
|
|
@ -95,9 +95,3 @@
|
|||
["t a n✝ : Nat\n: t * (a + n✝) = t * a + t * n✝\n⊢ t * (a + n✝) + t = t * a + t * Nat.succ n✝",
|
||||
"t a n✝ : Nat\n: t * (a + n✝) = t * a + t * n✝\n⊢ t * (a + n✝) + t = t * a + (t * n✝ + t)",
|
||||
"t a n✝ : Nat\n: t * (a + n✝) = t * a + t * n✝\n⊢ t * (a + n✝) + t = t * a + (t * n✝ + t)"]}
|
||||
{"textDocument": {"uri": "file://plainGoal.lean"},
|
||||
"position": {"line": 76, "character": 30}}
|
||||
{"rendered":
|
||||
"```lean\nt a n✝ : Nat\n: t * (a + n✝) = t * a + t * n✝\n⊢ t * (a + n✝) + t = t * a + (t * n✝ + t)\n```",
|
||||
"goals":
|
||||
["t a n✝ : Nat\n: t * (a + n✝) = t * a + t * n✝\n⊢ t * (a + n✝) + t = t * a + (t * n✝ + t)"]}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue