lean4-htt/tests/bench/server_startup.lean
Marc Huisinga af5b47295f
feat: reduce server memory consumption (#11162)
This PR reduces the memory consumption of the language server (the
watchdog process in particular). In Mathlib, it reduces memory
consumption by about 1GB.

It also fixes two bugs in the call hierarchy:
- When an open file had import errors (e.g. from a transitive build
failure), the call hierarchy would not display any usages in that file.
Now we use the reference information from the .ilean instead.
- When a command would not set a parent declaration (e.g. `#check`), the
result was filtered from the call hierarchy. Now we display it as
`[anonymous]` instead.
2025-12-01 10:53:23 +00:00

12 lines
337 B
Text

import Lean.Data.Lsp
open IO Lean Lsp
def main : IO Unit := do
Ipc.runWith "lean" #["--server"] do
let hIn ← Ipc.stdin
hIn.write (←FS.readBinFile "server_startup.log")
hIn.flush
let _ ← Ipc.readResponseAs 0 InitializeResult
Ipc.writeNotification ⟨"initialized", InitializedParams.mk⟩
Ipc.shutdown 1