Commit graph

9 commits

Author SHA1 Message Date
Marc Huisinga
3119fd0240
fix: make watchdog more resilient against badly behaving clients (#4443)
This PR addresses some non-critical but annoying issues that sometimes
cause the language server to report an error:
- When using global search and replace in VS Code, the language client
sends `textDocument/didChange` notifications for documents that it never
told the server to open first. Instead of emitting an error and crashing
the language server when this occurs, we now instead ignore the
notification. Fixes #4435.
- When terminating the language server, VS Code sometimes still sends
request to the language server even after emitting a `shutdown` request.
The LSP spec explicitly forbids this, but instead of emitting an error
when this occurs, we now error requests and ignore all other messages
until receiving the final `exit` notification. Reported on Zulip several
times over the years but never materialized as an issue, e.g.
https://leanprover.zulipchat.com/#narrow/stream/270676-lean4/topic/Got.20.60shutdown.60.20request.2C.20expected.20an.20.60exit.60.20notification/near/441914289.
- Some language clients attempt to reply to the file watcher
registration request before completing the LSP initialization dance. To
fix this, we now only send this request after the initialization dance
has completed. Fixes #3904.

---------

Co-authored-by: Sebastian Ullrich <sebasti@nullri.ch>
2024-06-13 13:48:36 +00:00
Chris Lovett
3eeb064d83
fix: Clear Diagnostics when file is closed (#1591) 2022-10-07 17:28:15 -07:00
Sebastian Ullrich
37f5be1b26 chore: fix servertest_init_exit 2022-01-14 09:18:57 +01:00
Sebastian Ullrich
5b653197db chore: use --run for servertests
/cc @Garmelon
2021-12-21 16:04:21 +01:00
Wojciech Nawrocki
a2760d0144 test: multi-process server 2020-12-26 13:22:47 +01:00
Sebastian Ullrich
b2fda9b9ae chore: disable randomly failing test
/cc @mhuisi @Vtech234
2020-12-25 18:48:58 +01:00
Wojciech Nawrocki
1b9ae69729 feat: port basic server tests 2020-12-23 20:00:36 +01:00
Leonardo de Moura
fa101444b4 chore: fix tests 2020-10-25 09:11:13 -07:00
Wojciech Nawrocki
098c7af1b6 feat: server tests 2020-08-31 06:50:01 -07:00