vscode-lean icon indicating copy to clipboard operation
vscode-lean copied to clipboard

"Try this" doesn't work correctly when there is an `end` in the line

Open shingtaklam1324 opened this issue 4 years ago • 0 comments

import tactic

-- Before

example (X : Type) (p : X → Prop) : (∃ x, p x) ↔ ¬ (∀ x, ¬ p x) :=
begin library_search end

-- After clicking the `Try this:`

example (X : Type) (p : X → Prop) : (∃ x, p x) ↔ ¬ (∀ x, ¬ p x) :=
begin exact not_forall_not.symm

It's probably to do with https://github.com/leanprover/vscode-lean/blob/master/src/tacticsuggestions.ts#L79-L109 since the current heuristics don't seem to take end into account.


Zulip: https://leanprover.zulipchat.com/#narrow/stream/113488-general/topic/squeeze_simp.20eating.20the.20end/near/240570377

shingtaklam1324 avatar May 28 '21 08:05 shingtaklam1324