Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display initialization progress and index asynchronously #24

Closed
wants to merge 2 commits into from

Conversation

fwcd
Copy link
Owner

@fwcd fwcd commented Mar 15, 2021

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.

image

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):

image

Hence why this PR is marked as a draft for now.

@fwcd fwcd added the enhancement New feature or request label Mar 15, 2021
@fwcd fwcd changed the title Display initialization progress Display initialization progress and index asynchronously Oct 14, 2024
@fwcd fwcd marked this pull request as draft October 14, 2024 02:18
@fwcd
Copy link
Owner Author

fwcd commented Oct 14, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant