Zulip Chat Archive

Stream: lean4

Topic: Syntax-aware document editing


Edward Ayers (May 31 2022 at 14:37):

Is there any plans or work underway to create a syntax-safe document editing component for the Lean server?

Jakob von Raumer (May 31 2022 at 14:39):

/cc @Sebastian Ullrich

Sebastian Ullrich (May 31 2022 at 14:46):

I assume you mean something better than manipulating the syntax tree, manually inserting whitespace as appropriate. One rough plan has always been to make the pretty printer good enough that you can just edit the structure of the syntax tree and then reformat the entire surrounding command.

Sebastian Ullrich (May 31 2022 at 14:48):

Or maybe I misunderstood you completely. Do you mean editing by the server or by a human user?

Jakob von Raumer (May 31 2022 at 14:59):

We were talking about the "code actions"

Sebastian Ullrich (May 31 2022 at 15:03):

That's what I hoped :)

Edward Ayers (May 31 2022 at 15:38):

What's the method to pretty print Syntax?

Sebastian Ullrich (May 31 2022 at 16:06):

It's ppCommand, see e.g. https://github.com/leanprover/lean4/blob/ef9976ccdaa7c19fe1208cf64b1f43b3c0811d1b/script/reformat.lean#L32


Last updated: Dec 20 2023 at 11:08 UTC