enso/app/gui2/ydoc-server
Adam Obuchowicz de406c69fa
Automatic reconnect with Language Server. (#9691)
Fixes #8520

If the websocket is closed not by us, we automatically try to reconnect with it, and initialize the protocol again. **Restoring state (execution contexts, attached visualizations) is not part of this PR**.

It's a part of making IDE work after hibernation (or LS crash).

# Important Notes
It required somewhat heavy refactoring:
1. I decided to use an existing implementation of reconnecting websocket. Replaced (later discovered by me) our implementation.
2. The LanguageServer class now handles both reconnecting and re-initializing - that make usage of it simpler (no more `Promise<LanguageServer>` - each method will just wait for (re)connection and initialization.
3. The stuff in `net` src's module was partially moved to shared's counterpart (with tests). Merged `exponentialBackoff` implementations, which also brought me to
4. Rewriting LS client, so it returns Result instead of throwing, what is closer our desired state, and allows us using exponentialBackoff method without any wrappers.
2024-04-19 13:39:45 +00:00
..
__tests__ Extract tests to their own files (#9229) 2024-03-06 09:53:12 +00:00
edits.ts Fix project edits (#9594) 2024-04-02 12:33:14 +00:00
fileFormat.ts Color picker (#9570) 2024-04-02 11:27:13 +00:00
index.ts Extract tests to their own files (#9229) 2024-03-06 09:53:12 +00:00
languageServerSession.ts Automatic reconnect with Language Server. (#9691) 2024-04-19 13:39:45 +00:00
serialization.ts Refactor for YJs AST (#8840) 2024-01-24 19:22:05 +00:00
ydoc.ts Fixes for Language Server sync server (#8514) 2023-12-19 05:41:14 +00:00