Skip to content

Additions and fixes to the LSP server (work-in-progress)#12731

Closed
wvhulle wants to merge 41 commits intoleanprover:masterfrom
wvhulle:master
Closed

Additions and fixes to the LSP server (work-in-progress)#12731
wvhulle wants to merge 41 commits intoleanprover:masterfrom
wvhulle:master

Conversation

@wvhulle
Copy link

@wvhulle wvhulle commented Feb 27, 2026

Hey, this is a long PR with additions, fixes related to the Lean LSP server. Apologies for the extend of the changes. However, this branch is based on a fairly recent commit (a few weeks ago, v4.28) but I am willing to rebase or split up later.

I found a couple of issues that were kind of related:

Formatter:

image

Diagnostics:

image

Diagnostic levels:

image

Links in popups:

image

For more screenshots, see https://github.com/wvhulle/lean4

Fixed:

  • Communicate panicked file worker to LSP client
  • Show LSP server startup as LSP notification in status bar instead of diagnostic
  • Remove indentation of multi-line strings
  • Passthrough of diagnostic tags and removal of if
  • Passthrough of diagnostic levels: info, warn, error
  • Passthrough of LSP-compliant related information in diagnostics
  • Fix spamming of LSP client with refresh (when client does not advertise it)

Added:

  • Show build failures of external targets as workspace diagnostics with correct spans
  • formatter for files using LSP
  • Lake subcommand for using formatter (code shared with LSP formatter)
  • Install Lean binaries in HOME/.lake/bin folder
  • Links to reference manual in LSP doc hover pop-ups
  • Allow code actions to use local context (for better code actions)
  • Pass LSP config object to lake serve

This PR is a list of changes to get another project working and fixes some other annoyances: Heron.

wvhulle and others added 30 commits January 29, 2026 15:30
This PR adds a `lake install` command that builds and installs package
executables to ~/.elan/bin/. The command requires Elan to be installed.
Without arguments, it installs all executables defined in the package.
Specific targets can be specified to install only those executables.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This PR adds git options to `lake install` that allow installing
executables directly from a Git repository:

- `--git <url>` clones the repository to a temporary directory
- `--branch <branch>` checks out a specific branch
- `--rev <rev>` checks out a specific commit or tag

Examples:
  lake install --git https://github.com/user/repo
  lake install --git https://github.com/user/repo --branch dev
  lake install --git https://github.com/user/repo --rev v1.0.0
Fix mimalloc setup to work in Nix sandbox by using postUnpack.
Add elan-compatible package structure with proper rpath configuration.

refactor: simplify flake architecture

Remove override mechanism and mkLeanPackages abstraction.
Use inputs.self.rev directly instead of passing git hash as parameter.
Much cleaner architecture without circular dependencies.
- Build stage0 as a separate derivation with isolated source (only
  stage0/ subtree) so it caches independently of src/ changes
- Stage1 (lean-all) depends on stage0 output as PREV_STAGE
- Add lake package output as a thin wrapper around lean-all
- Remove broken old-glibc dev shells (nixos-18.03/19.03 inputs)
- Simplify flake structure: single nixpkgs input, less nesting

Build: add build-time version assertion

Build: add more binary targets
…r by target

fix: remove verbose trace message and group by failed target in lake
build summary
… occurs when linters run without context backup
@wvhulle wvhulle changed the title Additions and fixes for LSP in non-VS Code editors (work-in-progress) Additions and fixes to the LSP server (work-in-progress) Feb 27, 2026
@wvhulle
Copy link
Author

wvhulle commented Feb 27, 2026

Will be split up

@wvhulle wvhulle closed this Feb 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant