Closed fwcd closed 3 weeks ago
Alternatively we could also look into LSP/VSCode's support for progress reporting during initialization, which requires using the progress token provided in the initialize params: https://hackage.haskell.org/package/lsp-types-2.3.0.0/docs/Language-LSP-Protocol-Types.html#t:InitializeParams
For that it would probably also make sense to move out all of our heavy lifting (compiling/indexing) from the initialized notification handler to doInitialize
, where we can actually access these params. This could be done in a separate PR, essentially we'd just have to migrate the function signature of initializedHandler
to whatever doInitialize
expects and then remove the handler from the notification handlers.
This causes e.g. VSCode to display initialization progress in the status bar. This PR also moves the indexing to a
forkIO
thread, since otherwise the progress will not show up.In the future we may also consider displaying more fine-grained progress.
One problem with asynchronous initialization is that the client will eagerly emit errors while the modules are still compiling (unless a
.curry/language-server
directory with previously compiled artifacts already exists):Hence why this PR is marked as a draft for now.