Reconsider addWorkspaceFolder() implementation #19624
Labels
area/plugins
kind/enhancement
A feature request - must adhere to the feature request template.
kind/task
Internal things, technical debt, and to-do tasks to be performed.
Is your task related to a problem? Please describe.
addWorkspaceFolder() method is responsible for the logic that add projects as workspace folders step by step, it respects the documentation for
theia.workspace.updateWorkspaceFolders()
API.The method returns a promise and it's expected that the promise is resolved when a project is added as workspace folder.
But at the moment it's not true - there is no guarantee that a project is added as a workspace folder when a promise is resolved.
The promise can be resolved, for example, when a project just added to a queue.
Previously, it was not critical, the goal of the current implementation was - add projects as workspace folders with respect the documentation.
But now we are starting to rely on a returned promise within eclipse-che/che-theia#1079, so we should revisit addWorkspaceFolder() and improve it.
Describe the solution you'd like
I believe we should resolve a returned promise when we get an event from
theia
side that a project was added as workspace folder.Please pay attention on the the documentation.
Describe alternatives you've considered
Additional context
AFAIK the problem has no influence for cloning process or adding projects to projects tree and so on.
At the moment it is actual for the recommendations plugin.
The text was updated successfully, but these errors were encountered: