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

Feature request: cancel outdated Lean RPC requests

Open
#492 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Quiet
Tech stack
lua
Domain
api, tooling

Research direction

Start by tracing the Lean.Widget.getInteractiveGoals calls and the handling of the corresponding $/lean/rpc/call requests. Check how UI destruction and redraws are represented, then investigate how $/cancelRequest can cancel those calls; done means outdated requests are cancelled in the relevant lifecycle cases without disrupting current results.

Written by the indexing model from the issue text.

Description

bug

Feature request

Lean RPC calls should be cancelled by lean.nvim when their results are no longer needed.

Background

  • The base LSP protocol offers support for cancellation.
    • I am hoping (but haven't confirmed) that the Neovim LSP client already cancels requests that become redundant before a response comes back, e.g. when the user discards a hover popup before its contents have arrived from the server.
  • lean.nvim also makes some Lean-specific RPC calls such as Lean.Widget.getInteractiveGoals. But pretty-printing large goals and computing goal diffs can be expensive. Such computations can consume a lot of resources if many of these requests are in-flight. It would be better to cancel these requests so that the Lean server can stop their processing threads early.
    • The cost of these requests is exacerbated when they are made too many times, as in #442.
    • There are various possible strategies for when to cancel. The most general one may be to do it when a) the relevant UI is being destroyed and b) when it is being redrawn with new parameters; basically a useEffect cleanup function.
    • Implementation-wise, one needs to $/cancelRequest the corresponding $/lean/rpc/call.
Dominant language
Lua
Stars
601
Forks
61
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.