Skip to content

Lsp formatting#13606

Draft
wvhulle wants to merge 3 commits intoleanprover:masterfrom
wvhulle:lsp-formatting
Draft

Lsp formatting#13606
wvhulle wants to merge 3 commits intoleanprover:masterfrom
wvhulle:lsp-formatting

Conversation

@wvhulle
Copy link
Copy Markdown

@wvhulle wvhulle commented May 2, 2026

This PR adds document and range formatting support via LSP.

Used this with success for formatting of Lean files in my favorite text editor with LSP formatting support. Builds on top of existing pretty formatter.

Likely needs further refactoring for code quality improvement. So please wait with detailed review. Putting it up here, will be rebased along the way.

@wvhulle wvhulle force-pushed the lsp-formatting branch 3 times, most recently from ffa6395 to c356069 Compare May 2, 2026 16:42
@github-actions github-actions Bot added the toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN label May 2, 2026
@mathlib-lean-pr-testing
Copy link
Copy Markdown

Mathlib CI status (docs):

  • ❗ Batteries/Mathlib CI will not be attempted unless your PR branches off the nightly-with-mathlib branch. Try git rebase 508a1132422faa6d0a35a135909ddc0526910783 --onto 0a6c31520b2ebaa6e71227454b46ebfb4986ae7b. You can force Mathlib CI using the force-mathlib-ci label. (2026-05-02 17:28:25)

@leanprover-bot
Copy link
Copy Markdown
Collaborator

Reference manual CI status:

  • ❗ Reference manual CI will not be attempted unless your PR branches off the nightly-with-manual branch. Try git rebase 508a1132422faa6d0a35a135909ddc0526910783 --onto 3fc99eef102549c743c6c63547983319bfae6f01. You can force reference manual CI using the force-manual-ci label. (2026-05-02 17:28:26)

wvhulle added 2 commits May 2, 2026 19:39
Adds a 'lake format' subcommand that formats Lean source files in
place using the Source pretty-printer. Wires shell helpers needed
for invoking lake from the worker process.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants