Recollect Java bundles when granting workspace trust#1995
Recollect Java bundles when granting workspace trust#1995testforstephen merged 2 commits intoredhat-developer:masterfrom
Conversation
Signed-off-by: Jinbo Wang <jinbwan@microsoft.com>
|
// @Eskibear |
|
If there's some way to use extensions.onDidChange() and something like https://github.com/redhat-developer/vscode-microprofile/blob/master/src/languageServer/plugin.ts#L45-L68 to avoid the timeout that would be great. Otherwise I'd just confirm that the timeout can be made no smaller. |
|
Update: We also created an issue microsoft/vscode#127055 to ask Update 2: So if we choose to use the solution of But I also see some side effects if we choose to restart LS silently with |
|
If the
This way at least we never wait the maximum amount of time. I know we've discussed that we can't tell whether the change came from the workspace trust action, but how likely is it for a user to be able to perform an installation action near the "trust action" and have this still fail ? |
Signed-off-by: Jinbo Wang <jinbwan@microsoft.com>
|
I have changed to polling every 100ms and timeout after 1s. I tried it in two machines, both them could get the extension changes at 400ms ~500ms. Machine 2 - macOS
Once the standard server is initialized, we have extra logic to cover the case of installing new extension. vscode-java/src/standardLanguageClient.ts Lines 402 to 406 in 7ac2be5 If you're talking about the time window between the action of starting standard server and registering |
Signed-off-by: Jinbo Wang jinbwan@microsoft.com
Fixes #1994
In untrusted workspaces, those extensions that do not declare support for workspace trust are not visible to the
extensions.all API. Since the variableclientOptionsis preconfigured when activating the Java extension, it becomes outdated after we trust the workspace. The list of Java bundles needs to be recollected before switching to standard mode.It seems that
extensions.allstill does not include the new available Java extensions during the callbackonDidGrantWorkspaceTrust. This looks like a VS code bug. A workaround would be to add a timeout to allow Java extensions to get the latest available Java bundles.