Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

LSP does not restart on version upgrade

Open
#554 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
lua, neovim
Domain
tooling

Research direction

Start by tracing the Neovim LSP lifecycle around the vim.lsp.enable('leanls', false) and vim.lsp.enable('leanls') entry points described in the issue. Determine how a Lean version upgrade can be detected and when the language server should restart, including the version-check race described in the proposed approaches. Done means upgrades restart the LSP automatically without requiring the manual workaround.

Written by the indexing model from the issue text.

Description

As in the title. This leads to a non-negligible number of headaches, including but not limited to unnecessary rebuild and seemingly corrupted files.

Workaround: A manual way to restart the language server is

:lua vim.lsp.enable('leanls', false); vim.lsp.enable('leanls')

Two ways this can be fixed I can think of:

  1. Make a temporary document with #version to query the LSP's Lean version (apparently there isn't really any easier way? Is there?)
  2. Do something like a seqlock, query the LSP's version before and after launching it, while they disagree then restart the LSP (disproportionately unlikely), if they agree then take that as the version, and restart when version increases (reason: avoid race condition)
Dominant language
Lua
Stars
597
Forks
60
Avg merge
3d 22h
Merged PRs (30d)
8

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Julian/lean.nvim

All issues in Julian/lean.nvim

Similar issues

More Lua issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.