jupyterlab-lsp
jupyterlab-lsp copied to clipboard
[wip] defer initialization until event loop is available
References
- minimal fix for #851
Code changes
- moves full initialization off critical path to starting
JupyterServerApp
- when it does initialize, moves potentially-expensive actions to a thread pool executor to not inadvertently block other early functions
- when done, set a ready flag
- makes more of the handler methods asynchronous, and wait on the ready flag
User-facing changes
- slow startup would now be deferred, allowing the server to start more quickly
- the initial request for language status might be delayed some
- typically it takes a while and many hundreds of HTTP requests, to get all the way up to a full-rendered document that could even request whether a language server is available
- the debug log message comes after the server announces its location, making it harder to find the server URL
Backwards-incompatible changes
- n/a, though some of the internal methods
Future Work
- this is still "blocks" (from an information theory perspective) the ability to start any session until all servers are discovered
- theoretically with an
isComplete
flag on the response, we could handle partial setup better, and hoist more errors to the client log
- theoretically with an
Chores
- [x] linted
- [ ] tested
- the new server initialize code isn't under unit test, probably should be
- benchmark startup somehow?
- [ ] documented
- [ ] changelog entry
Continued in #882