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

Brackets in comments cause problems with "Try this"

Open shingtaklam1324 opened this issue 5 years ago • 1 comments

import tactic

example (X : Type) (p : X → Prop) : (∃ x, p x) ↔ ¬ (∀ x, ¬ p x) :=
begin
  library_search -- avoid smileys if you want to use "try this" :-)
end

example (X : Type) (p : X → Prop) : (∃ x, p x) ↔ ¬ (∀ x, ¬ p x) :=
begin
  library_search -- and frownies are even worse :-(
end

Clicking on the "Try this:" code doesn't work, because the system gets confused by the brackets (in the first case the comment is deleted apart from the bracket; in the second case end gets deleted too). In practice I guess one isn't going to write anything after library_search usually -- the only reason I ran into this was because I was documenting something for a beginner.


Originally opened by @kbuzzard as leanprover-community/mathlib#5051

shingtaklam1324 avatar Nov 24 '20 10:11 shingtaklam1324

The relevant part of the code starts here, if anyone wants to take a crack at it: https://github.com/leanprover/vscode-lean/blob/master/src/tacticsuggestions.ts#L79

bryangingechen avatar Nov 24 '20 15:11 bryangingechen