-
Notifications
You must be signed in to change notification settings - Fork 334
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
Workspace folder changes are not sent to the server if they occur during initialisation #451
Comments
We are hitting this case when automatically cloning java projects at startup and adding them to the workspace. |
@dbaeumer with a bit of guidance, we could invest some time in whipping up a PR. |
I'm working on a PR. |
@tsmaeder thanks for looking into this. Here is how I would tackle this: Options one:
Option two:
Since I think this will not happen frequently I would go for the second options. |
I've been working on option 2. The hard part is testing. |
Particularly becuase updateWorkspaceFolders does not return a promise. |
@dbaeumer I am trying to write a unit test using the vscode API (in the test suite in client-tests). However, try as I might, "updateWorkspaceFolders" never seems to have any effects. What am I missing? |
I'm missing that this is turned off explicitly when in tests. Grmpfl! Hmm...any suggestions on how to write a test for this? |
@dbaeumer I refactored the feature to be able to test the notification behaviour without using the plugin API and wrote tests using that test interface. |
@tsmaeder sorry for the late response, but I needed to do some work around LSIF. I will look into your PR beginning of next week. |
@tsmaeder reviewed the PR. |
This got addressed by @tsmaeder |
@dbaeumer so is this in the latest release? I didn't see it in the changelog. |
It is in currently in next which we plan to make official beginning of next week. |
Version number is |
I don't have an easy repro for this because it involves setting up a server, but I've noticed that if you add/remove workspace folders while the initialisation is happening, the workspace events never make it to the server, so the server ends up with the original workspace list that was transmitted in the
initialize
request, even though the client modified them prior to getting a response.I think probably the client should queue up any workspace folder changes during initialization and transmit them after the
initialized
notification. It may also be worth calling this out in the LSP spec since it seems like something that could easily be implementing wrong elsewhere.The text was updated successfully, but these errors were encountered: