leanprover / leanprover/lean4

Add ability for making server->client requests to `Server.RequestM`

Open
#1,465 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement P-low server
Dominant language
Lean
Stars
9.2k
Forks
990
Avg merge
1d 17h
Merged PRs (30d)
175

Description

Currently Server.RequestM does not provide any way to make a server->client LSP request and then wait on the client's response. This is useful in cases where we want to make one request, wait until it resolves, and then make another which relies on the client state being updated by the first request.

The implementation does not seem too easy. It would probably require plumbing in the worker's pending requests table, maybe storing an extra FS.Stream or something to write the response into so that the Task can receive it, as well as handling responses in the worker and in the watchdog.

Contributor guide

Open the contributing guide

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.

Research direction

Start by reading the pending requests table in src/Lean/Server/FileWorker.lean around line 147, then follow response handling in FileWorker.lean around line 449 and Watchdog.lean around line 597. Trace how Server.RequestM and worker tasks communicate; done means a server can issue a client LSP request, await its response, and use the updated client state for a subsequent request.

Written by the indexing model from the issue text.

Assessment

Domain
api, backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.