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

Metals/BSP: errors in build.sc result in looped workspace reload #1560

Open
lefou opened this issue Nov 10, 2021 · 2 comments
Open

Metals/BSP: errors in build.sc result in looped workspace reload #1560

lefou opened this issue Nov 10, 2021 · 2 comments

Comments

@lefou
Copy link
Member

lefou commented Nov 10, 2021

And the concrete error isn't shown to the user.

This is probably, because we complete the initial workspace reload request successfully and too early, whereas we should wait for the script build and report errors if any.

@lefou
Copy link
Member Author

lefou commented Nov 28, 2021

Same, when the buildfile initially contains errors and the BSP session starts.

@lefou lefou mentioned this issue Nov 29, 2021
@lefou
Copy link
Member Author

lefou commented Nov 29, 2021

There are two cases:

  1. We just start the BSP server when the buildfile is invalid
  2. We receive a reload workspace request when the buildfile is invalid

1. We just start

When starting Mill, we detect the need for recompilation of the buildfile and only if that succeeds, we continue. In BSP mode, we start the server early to avoid timeouts caused by initial long compilation times. Because of this design, and also as we never receive an Evaluator instance later, we never complete the workspace initialize request.

We need to change that logic to at least initialize the workspace with the minimal dumb mill-build target, so that the user is able to edit the buildfile and correct the issues. After that we should receive a reload workspace request (or request one by ourselves) and should get a second chance to initialize all build targets.

2. We receive a reload workspace request

Currently, we just return the request without waiting for success or failure of the buildfile recompilation.

We need to change that logic to wait for the compilation result and report the success as the outcome of the reload request.

IIUC, the issue is that the BSP specification expects us the keep the previous workspace module when we are unable to reload the workspace. But we already closed the Mill session and will no longer be able to run any request, until the buildfile issues are fixes. Se we probably want to fall back to the same solution as in 1.

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

No branches or pull requests

1 participant